Lines Matching refs:f9
15 f9 Support, terminate the state
20 /** Terminate the f9-MAC state
21 @param f9 f9 state to terminate
26 int f9_done(f9_state *f9, unsigned char *out, unsigned long *outlen)
29 LTC_ARGCHK(f9 != NULL);
33 if ((err = cipher_is_valid(f9->cipher)) != CRYPT_OK) {
37 if ((f9->blocksize > cipher_descriptor[f9->cipher].block_length) || (f9->blocksize < 0) ||
38 (f9->buflen > f9->blocksize) || (f9->buflen < 0)) {
42 if (f9->buflen != 0) {
44 cipher_descriptor[f9->cipher].ecb_encrypt(f9->IV, f9->IV, &f9->key);
45 f9->buflen = 0;
46 for (x = 0; x < f9->blocksize; x++) {
47 f9->ACC[x] ^= f9->IV[x];
52 if ((err = cipher_descriptor[f9->cipher].setup(f9->akey, f9->keylen, 0, &f9->key)) != CRYPT_OK) {
57 cipher_descriptor[f9->cipher].ecb_encrypt(f9->ACC, f9->ACC, &f9->key);
58 cipher_descriptor[f9->cipher].done(&f9->key);
61 for (x = 0; x < f9->blocksize && (unsigned long)x < *outlen; x++) {
62 out[x] = f9->ACC[x];
67 zeromem(f9, sizeof(*f9));
74 /* $Source: /cvs/libtom/libtomcrypt/src/mac/f9/f9_done.c,v $ */