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