Lines Matching defs:context
111 MD2Transform(MD2_CTX *context)
116 for (l = context->C[15], j = 0; j < 16; j++) {
117 context->X[32 + j] = context->X[j] ^ context->X[16 + j];
118 l = context->C[j] ^= S[context->X[16 + j] ^ l];
124 t = context->X[k] = (context->X[k] ^ S[t]);
127 context->i = 16;
131 MD2Init(MD2_CTX *context)
133 _DIAGASSERT(context != 0);
135 context->i = 16;
136 memset(&context->C[0], 0, sizeof(context->C));
137 memset(&context->X[0], 0, sizeof(context->X));
141 MD2Update(MD2_CTX *context, const unsigned char *input, unsigned int inputLen)
145 _DIAGASSERT(context != 0);
149 piece = 32 - context->i;
152 memcpy(&context->X[context->i], &input[idx], (size_t)piece);
153 if ((context->i += piece) == 32)
154 MD2Transform(context); /* resets i */
159 MD2Final(unsigned char digest[16], MD2_CTX *context)
164 _DIAGASSERT(context != 0);
167 padlen = 32 - context->i;
170 MD2Update(context, pad[padlen], padlen);
173 MD2Update(context, &context->C[0], (unsigned int) sizeof(context->C));
176 memcpy(digest, &context->X[0], (size_t)16);
178 /* reset the context */
179 MD2Init(context);