Home | History | Annotate | Download | only in f9

Lines Matching refs:f9

15   f9 Support, process blocks with f9
20 /** Process data through f9-MAC
21 @param f9 The f9-MAC state
26 int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen)
30 LTC_ARGCHK(f9 != NULL);
34 if ((err = cipher_is_valid(f9->cipher)) != CRYPT_OK) {
38 if ((f9->blocksize > cipher_descriptor[f9->cipher].block_length) || (f9->blocksize < 0) ||
39 (f9->buflen > f9->blocksize) || (f9->buflen < 0)) {
44 if (f9->buflen == 0) {
45 while (inlen >= (unsigned long)f9->blocksize) {
46 for (x = 0; x < f9->blocksize; x += sizeof(LTC_FAST_TYPE)) {
47 *((LTC_FAST_TYPE*)&(f9->IV[x])) ^= *((LTC_FAST_TYPE*)&(in[x]));
49 cipher_descriptor[f9->cipher].ecb_encrypt(f9->IV, f9->IV, &f9->key);
50 for (x = 0; x < f9->blocksize; x += sizeof(LTC_FAST_TYPE)) {
51 *((LTC_FAST_TYPE*)&(f9->ACC[x])) ^= *((LTC_FAST_TYPE*)&(f9->IV[x]));
53 in += f9->blocksize;
54 inlen -= f9->blocksize;
60 if (f9->buflen == f9->blocksize) {
61 cipher_descriptor[f9->cipher].ecb_encrypt(f9->IV, f9->IV, &f9->key);
62 for (x = 0; x < f9->blocksize; x++) {
63 f9->ACC[x] ^= f9->IV[x];
65 f9->buflen = 0;
67 f9->IV[f9->buflen++] ^= *in++;
75 /* $Source: /cvs/libtom/libtomcrypt/src/mac/f9/f9_process.c,v $ */