Lines Matching refs:omac
21 Terminate an OMAC stream
22 @param omac The OMAC state
27 int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen)
32 LTC_ARGCHK(omac != NULL);
35 if ((err = cipher_is_valid(omac->cipher_idx)) != CRYPT_OK) {
39 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) ||
40 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) {
45 if (omac->buflen != omac->blklen) {
47 omac->block[omac->buflen++] = 0x80;
50 while (omac->buflen < omac->blklen) {
51 omac->block[omac->buflen++] = 0x00;
59 for (x = 0; x < (unsigned)omac->blklen; x++) {
60 omac->block[x] ^= omac->prev[x] ^ omac->Lu[mode][x];
64 if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->block, omac->block, &omac->key)) != CRYPT_OK) {
67 cipher_descriptor[omac->cipher_idx].done(&omac->key);
70 for (x = 0; x < (unsigned)omac->blklen && x < *outlen; x++) {
71 out[x] = omac->block[x];
76 zeromem(omac, sizeof(*omac));
84 /* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_done.c,v $ */