Lines Matching full:xcbc
15 XCBC Support, process blocks with XCBC
20 /** Process data through XCBC-MAC
21 @param xcbc The XCBC-MAC state
26 int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen)
33 LTC_ARGCHK(xcbc != NULL);
37 if ((err = cipher_is_valid(xcbc->cipher)) != CRYPT_OK) {
41 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher].block_length) || (xcbc->blocksize < 0) ||
42 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) {
47 if (xcbc->buflen == 0) {
48 while (inlen > (unsigned long)xcbc->blocksize) {
49 for (x = 0; x < xcbc->blocksize; x += sizeof(LTC_FAST_TYPE)) {
50 *((LTC_FAST_TYPE*)&(xcbc->IV[x])) ^= *((LTC_FAST_TYPE*)&(in[x]));
52 cipher_descriptor[xcbc->cipher].ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key);
53 in += xcbc->blocksize;
54 inlen -= xcbc->blocksize;
60 if (xcbc->buflen == xcbc->blocksize) {
61 cipher_descriptor[xcbc->cipher].ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key);
62 xcbc->buflen = 0;
64 xcbc->IV[xcbc->buflen++] ^= *in++;
72 /* $Source: /cvs/libtom/libtomcrypt/src/mac/xcbc/xcbc_process.c,v $ */