Lines Matching refs:omac
22 Initialize an OMAC state
23 @param omac The OMAC state to initialize
29 int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen)
33 LTC_ARGCHK(omac != NULL);
58 if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &omac->key)) != CRYPT_OK) {
65 zeromem(omac->Lu[0], cipher_descriptor[cipher].block_length);
66 if ((err = cipher_descriptor[cipher].ecb_encrypt(omac->Lu[0], omac->Lu[0], &omac->key)) != CRYPT_OK) {
73 msb = omac->Lu[x][0] >> 7;
77 omac->Lu[x][y] = ((omac->Lu[x][y] << 1) | (omac->Lu[x][y+1] >> 7)) & 255;
79 omac->Lu[x][len - 1] = ((omac->Lu[x][len - 1] << 1) ^ (msb ? mask : 0)) & 255;
83 XMEMCPY(omac->Lu[1], omac->Lu[0], sizeof(omac->Lu[0]));
88 omac->cipher_idx = cipher;
89 omac->buflen = 0;
90 omac->blklen = len;
91 zeromem(omac->prev, sizeof(omac->prev));
92 zeromem(omac->block, sizeof(omac->block));
99 /* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_init.c,v $ */