Lines Matching refs:chc
15 @file chc.c
16 CHC support. (Tom St Denis)
23 /* chc settings */
38 Initialize the CHC state with a given cipher
116 cipher_descriptor[cipher_idx].ecb_encrypt(buf, md->chc.state, key);
119 md->chc.length = 0;
120 md->chc.curlen = 0;
121 zeromem(md->chc.buf, sizeof(md->chc.buf));
141 if ((err = cipher_descriptor[cipher_idx].setup(md->chc.state, cipher_blocksize, 0, key)) != CRYPT_OK) {
148 md->chc.state[x] ^= T[0][x] ^ T[1][x];
160 HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize)
208 if (md->chc.curlen >= sizeof(md->chc.buf)) {
213 md->chc.length += md->chc.curlen * 8;
216 md->chc.buf[md->chc.curlen++] = (unsigned char)0x80;
222 if (md->chc.curlen > (unsigned long)(cipher_blocksize - 8)) {
223 while (md->chc.curlen < (unsigned long)cipher_blocksize) {
224 md->chc.buf[md->chc.curlen++] = (unsigned char)0;
226 chc_compress(md, md->chc.buf);
227 md->chc.curlen = 0;
231 while (md->chc.curlen < (unsigned long)(cipher_blocksize - 8)) {
232 md->chc.buf[md->chc.curlen++] = (unsigned char)0;
236 STORE64L(md->chc.length, md->chc.buf+(cipher_blocksize-8));
237 chc_compress(md, md->chc.buf);
240 XMEMCPY(out, md->chc.state, cipher_blocksize);
296 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/chc/chc.c,v $ */