Searched refs:omac (Results 1 – 9 of 9) sorted by relevance
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/omac/ |
A D | omac_done.c | 24 LTC_ARGCHK(omac != NULL); in omac_done() 31 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) || in omac_done() 32 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) { in omac_done() 37 if (omac->buflen != omac->blklen) { in omac_done() 39 omac->block[omac->buflen++] = 0x80; in omac_done() 42 while (omac->buflen < omac->blklen) { in omac_done() 43 omac->block[omac->buflen++] = 0x00; in omac_done() 52 omac->block[x] ^= omac->prev[x] ^ omac->Lu[mode][x]; in omac_done() 56 …if ((err = cipher_descriptor[omac->cipher_idx]->ecb_encrypt(omac->block, omac->block, &omac->key))… in omac_done() 59 cipher_descriptor[omac->cipher_idx]->done(&omac->key); in omac_done() [all …]
|
A D | omac_process.c | 25 LTC_ARGCHK(omac != NULL); in omac_process() 31 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) || in omac_process() 32 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) { in omac_process() 47 …if ((err = cipher_descriptor[omac->cipher_idx]->ecb_encrypt(omac->prev, omac->prev, &omac->key)) !… in omac_process() 58 if (omac->buflen == omac->blklen) { in omac_process() 60 omac->block[x] ^= omac->prev[x]; in omac_process() 62 …if ((err = cipher_descriptor[omac->cipher_idx]->ecb_encrypt(omac->block, omac->prev, &omac->key)) … in omac_process() 65 omac->buflen = 0; in omac_process() 69 n = MIN(inlen, (unsigned long)(omac->blklen - omac->buflen)); in omac_process() 70 XMEMCPY(omac->block + omac->buflen, in, n); in omac_process() [all …]
|
A D | omac_init.c | 25 LTC_ARGCHK(omac != NULL); in omac_init() 58 …if ((err = cipher_descriptor[cipher]->ecb_encrypt(omac->Lu[0], omac->Lu[0], &omac->key)) != CRYPT_… in omac_init() 65 msb = omac->Lu[x][0] >> 7; in omac_init() 69 omac->Lu[x][y] = ((omac->Lu[x][y] << 1) | (omac->Lu[x][y+1] >> 7)) & 255; in omac_init() 71 omac->Lu[x][len - 1] = ((omac->Lu[x][len - 1] << 1) ^ (msb ? mask : 0)) & 255; in omac_init() 75 XMEMCPY(omac->Lu[1], omac->Lu[0], sizeof(omac->Lu[0])); in omac_init() 80 omac->cipher_idx = cipher; in omac_init() 81 omac->buflen = 0; in omac_init() 82 omac->blklen = len; in omac_init() 83 zeromem(omac->prev, sizeof(omac->prev)); in omac_init() [all …]
|
A D | omac_memory.c | 29 omac_state *omac; in omac_memory() local 47 omac = XMALLOC(sizeof(omac_state)); in omac_memory() 48 if (omac == NULL) { in omac_memory() 53 if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) { in omac_memory() 56 if ((err = omac_process(omac, in, inlen)) != CRYPT_OK) { in omac_memory() 59 if ((err = omac_done(omac, out, outlen)) != CRYPT_OK) { in omac_memory() 66 zeromem(omac, sizeof(omac_state)); in omac_memory() 69 XFREE(omac); in omac_memory()
|
A D | omac_memory_multi.c | 31 omac_state *omac; in omac_memory_multi() local 42 omac = XMALLOC(sizeof(omac_state)); in omac_memory_multi() 43 if (omac == NULL) { in omac_memory_multi() 48 if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) { in omac_memory_multi() 56 if ((err = omac_process(omac, curptr, curlen)) != CRYPT_OK) { in omac_memory_multi() 66 if ((err = omac_done(omac, out, outlen)) != CRYPT_OK) { in omac_memory_multi() 71 zeromem(omac, sizeof(omac_state)); in omac_memory_multi() 73 XFREE(omac); in omac_memory_multi()
|
A D | omac_file.c | 38 omac_state omac; in omac_file() 51 if ((err = omac_init(&omac, cipher, key, keylen)) != CRYPT_OK) { in omac_file() 63 if ((err = omac_process(&omac, buf, (unsigned long)x)) != CRYPT_OK) { in omac_file() 74 err = omac_done(&omac, out, outlen); in omac_file() 80 zeromem(&omac, sizeof(omac_state)); in omac_file()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_init.c | 31 omac_state *omac; in eax_init() local 49 omac = XMALLOC(sizeof(*omac)); in eax_init() 51 if (buf == NULL || omac == NULL) { in eax_init() 55 if (omac != NULL) { in eax_init() 56 XFREE(omac); in eax_init() 63 if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) { in eax_init() 68 if ((err = omac_process(omac, buf, blklen)) != CRYPT_OK) { in eax_init() 72 if ((err = omac_process(omac, nonce, noncelen)) != CRYPT_OK) { in eax_init() 77 if ((err = omac_done(omac, eax->N, &len)) != CRYPT_OK) { in eax_init() 123 zeromem(omac, sizeof(*omac)); in eax_init() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/ |
A D | sub.mk | 2 subdirs-$(_CFG_CORE_LTC_CMAC) += omac
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 41 int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen); 42 int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen); 43 int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen);
|
Completed in 10 milliseconds