• Home
  • Raw
  • Download

Lines Matching refs:md

87 int chc_init(hash_state *md)  in chc_init()  argument
93 LTC_ARGCHK(md != NULL); in chc_init()
116 cipher_descriptor[cipher_idx].ecb_encrypt(buf, md->chc.state, key); in chc_init()
119 md->chc.length = 0; in chc_init()
120 md->chc.curlen = 0; in chc_init()
121 zeromem(md->chc.buf, sizeof(md->chc.buf)); in chc_init()
132 static int chc_compress(hash_state *md, unsigned char *buf) in chc_compress() argument
141 …if ((err = cipher_descriptor[cipher_idx].setup(md->chc.state, cipher_blocksize, 0, key)) != CRYPT_… in chc_compress()
148 md->chc.state[x] ^= T[0][x] ^ T[1][x]; in chc_compress()
159 int _chc_process(hash_state * md, const unsigned char *buf, unsigned long len);
169 int chc_process(hash_state * md, const unsigned char *in, unsigned long inlen) in chc_process() argument
173 LTC_ARGCHK(md != NULL); in chc_process()
184 return _chc_process(md, in, inlen); in chc_process()
193 int chc_done(hash_state *md, unsigned char *out) in chc_done() argument
197 LTC_ARGCHK(md != NULL); in chc_done()
208 if (md->chc.curlen >= sizeof(md->chc.buf)) { in chc_done()
213 md->chc.length += md->chc.curlen * 8; in chc_done()
216 md->chc.buf[md->chc.curlen++] = (unsigned char)0x80; in chc_done()
222 if (md->chc.curlen > (unsigned long)(cipher_blocksize - 8)) { in chc_done()
223 while (md->chc.curlen < (unsigned long)cipher_blocksize) { in chc_done()
224 md->chc.buf[md->chc.curlen++] = (unsigned char)0; in chc_done()
226 chc_compress(md, md->chc.buf); in chc_done()
227 md->chc.curlen = 0; in chc_done()
231 while (md->chc.curlen < (unsigned long)(cipher_blocksize - 8)) { in chc_done()
232 md->chc.buf[md->chc.curlen++] = (unsigned char)0; in chc_done()
236 STORE64L(md->chc.length, md->chc.buf+(cipher_blocksize-8)); in chc_done()
237 chc_compress(md, md->chc.buf); in chc_done()
240 XMEMCPY(out, md->chc.state, cipher_blocksize); in chc_done()
243 zeromem(md, sizeof(hash_state)); in chc_done()
256 md[MAXBLOCKSIZE]; in chc_test() member
268 hash_state md; in chc_test() local
280 chc_init(&md); in chc_test()
281 chc_process(&md, tests[x].msg, strlen((char *)tests[x].msg)); in chc_test()
282 chc_done(&md, out); in chc_test()
283 if (XMEMCMP(out, tests[x].md, tests[x].len)) { in chc_test()