Searched refs:pmac (Results 1 – 8 of 8) sorted by relevance
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pmac/ |
A D | pmac_done.c | 16 LTC_ARGCHK(pmac != NULL); in pmac_done() 22 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_done() 23 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_done() 30 if (pmac->buflen == pmac->block_len) { in pmac_done() 33 pmac->checksum[x] ^= pmac->block[x] ^ pmac->Lr[x]; in pmac_done() 38 pmac->checksum[x] ^= pmac->block[x]; in pmac_done() 40 pmac->checksum[x] ^= 0x80; in pmac_done() 44 …if ((err = cipher_descriptor[pmac->cipher_idx]->ecb_encrypt(pmac->checksum, pmac->checksum, &pmac-… in pmac_done() 47 cipher_descriptor[pmac->cipher_idx]->done(&pmac->key); in pmac_done() 51 out[x] = pmac->checksum[x]; in pmac_done() [all …]
|
A D | pmac_init.c | 43 LTC_ARGCHK(pmac != NULL); in pmac_init() 90 XMEMCPY(pmac->Ls[0], L, pmac->block_len); in pmac_init() 94 pmac->Ls[x][y] = ((pmac->Ls[x-1][y] << 1) | (pmac->Ls[x-1][y+1] >> 7)) & 255; in pmac_init() 96 pmac->Ls[x][pmac->block_len-1] = (pmac->Ls[x-1][pmac->block_len-1] << 1) & 255; in pmac_init() 112 pmac->Lr[0] = L[0] >> 1; in pmac_init() 121 pmac->block_index = 1; in pmac_init() 122 pmac->cipher_idx = cipher; in pmac_init() 123 pmac->buflen = 0; in pmac_init() 124 zeromem(pmac->block, sizeof(pmac->block)); in pmac_init() 125 zeromem(pmac->Li, sizeof(pmac->Li)); in pmac_init() [all …]
|
A D | pmac_process.c | 26 LTC_ARGCHK(pmac != NULL); in pmac_process() 32 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_process() 33 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_process() 41 pmac_shift_xor(pmac); in pmac_process() 59 if (pmac->buflen == pmac->block_len) { in pmac_process() 60 pmac_shift_xor(pmac); in pmac_process() 62 Z[x] = pmac->Li[x] ^ pmac->block[x]; in pmac_process() 70 pmac->buflen = 0; in pmac_process() 74 n = MIN(inlen, (unsigned long)(pmac->block_len - pmac->buflen)); in pmac_process() 75 XMEMCPY(pmac->block + pmac->buflen, in, n); in pmac_process() [all …]
|
A D | pmac_shift_xor.c | 16 void pmac_shift_xor(pmac_state *pmac) in pmac_shift_xor() argument 19 y = pmac_ntz(pmac->block_index++); in pmac_shift_xor() 21 for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) { in pmac_shift_xor() 22 *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Li + x)) ^= in pmac_shift_xor() 23 *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Ls[y] + x)); in pmac_shift_xor() 26 for (x = 0; x < pmac->block_len; x++) { in pmac_shift_xor() 27 pmac->Li[x] ^= pmac->Ls[y][x]; in pmac_shift_xor()
|
A D | pmac_memory.c | 29 pmac_state *pmac; in pmac_memory() local 37 pmac = XMALLOC(sizeof(pmac_state)); in pmac_memory() 38 if (pmac == NULL) { in pmac_memory() 42 if ((err = pmac_init(pmac, cipher, key, keylen)) != CRYPT_OK) { in pmac_memory() 45 if ((err = pmac_process(pmac, in, inlen)) != CRYPT_OK) { in pmac_memory() 48 if ((err = pmac_done(pmac, out, outlen)) != CRYPT_OK) { in pmac_memory() 55 zeromem(pmac, sizeof(pmac_state)); in pmac_memory() 58 XFREE(pmac); in pmac_memory()
|
A D | pmac_memory_multi.c | 31 pmac_state *pmac; in pmac_memory_multi() local 42 pmac = XMALLOC(sizeof(pmac_state)); in pmac_memory_multi() 43 if (pmac == NULL) { in pmac_memory_multi() 47 if ((err = pmac_init(pmac, cipher, key, keylen)) != CRYPT_OK) { in pmac_memory_multi() 55 if ((err = pmac_process(pmac, curptr, curlen)) != CRYPT_OK) { in pmac_memory_multi() 65 if ((err = pmac_done(pmac, out, outlen)) != CRYPT_OK) { in pmac_memory_multi() 70 zeromem(pmac, sizeof(pmac_state)); in pmac_memory_multi() 72 XFREE(pmac); in pmac_memory_multi()
|
A D | pmac_file.c | 38 pmac_state pmac; in pmac_file() 52 if ((err = pmac_init(&pmac, cipher, key, keylen)) != CRYPT_OK) { in pmac_file() 64 if ((err = pmac_process(&pmac, buf, (unsigned long)x)) != CRYPT_OK) { in pmac_file() 75 err = pmac_done(&pmac, out, outlen); in pmac_file() 81 zeromem(&pmac, sizeof(pmac_state)); in pmac_file()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 76 int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned long keylen); 77 int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen); 78 int pmac_done(pmac_state *pmac, unsigned char *out, unsigned long *outlen); 100 void pmac_shift_xor(pmac_state *pmac);
|
Completed in 8 milliseconds