Searched refs:xcbc (Results 1 – 7 of 7) sorted by relevance
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/xcbc/ |
A D | xcbc_process.c | 25 LTC_ARGCHK(xcbc != NULL); in xcbc_process() 33 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher]->block_length) || (xcbc->blocksize < 0) || in xcbc_process() 34 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_process() 39 if (xcbc->buflen == 0) { in xcbc_process() 44 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process() 45 in += xcbc->blocksize; in xcbc_process() 46 inlen -= xcbc->blocksize; in xcbc_process() 52 if (xcbc->buflen == xcbc->blocksize) { in xcbc_process() 53 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process() 54 xcbc->buflen = 0; in xcbc_process() [all …]
|
A D | xcbc_done.c | 21 LTC_ARGCHK(xcbc != NULL); in xcbc_done() 29 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher]->block_length) || (xcbc->blocksize < 0) || in xcbc_done() 30 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_done() 35 if (xcbc->buflen == xcbc->blocksize) { in xcbc_done() 38 xcbc->IV[x] ^= xcbc->K[1][x]; in xcbc_done() 41 xcbc->IV[xcbc->buflen] ^= 0x80; in xcbc_done() 44 xcbc->IV[x] ^= xcbc->K[2][x]; in xcbc_done() 49 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_done() 50 cipher_descriptor[xcbc->cipher]->done(&xcbc->key); in xcbc_done() 54 out[x] = xcbc->IV[x]; in xcbc_done() [all …]
|
A D | xcbc_init.c | 19 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen) in xcbc_init() argument 25 LTC_ARGCHK(xcbc != NULL); in xcbc_init() 50 XMEMCPY(xcbc->K[0], key, k1); in xcbc_init() 51 XMEMCPY(xcbc->K[1], key+k1, cipher_descriptor[cipher]->block_length); in xcbc_init() 70 xcbc->K[y][x] = y + 1; in xcbc_init() 72 cipher_descriptor[cipher]->ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init() 77 err = cipher_descriptor[cipher]->setup(xcbc->K[0], k1, 0, &xcbc->key); in xcbc_init() 80 zeromem(xcbc->IV, cipher_descriptor[cipher]->block_length); in xcbc_init() 81 xcbc->blocksize = cipher_descriptor[cipher]->block_length; in xcbc_init() 82 xcbc->cipher = cipher; in xcbc_init() [all …]
|
A D | xcbc_memory.c | 27 xcbc_state *xcbc; in xcbc_memory() local 40 xcbc = XCALLOC(1, sizeof(*xcbc)); in xcbc_memory() 41 if (xcbc == NULL) { in xcbc_memory() 45 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory() 49 if ((err = xcbc_process(xcbc, in, inlen)) != CRYPT_OK) { in xcbc_memory() 53 err = xcbc_done(xcbc, out, outlen); in xcbc_memory() 55 XFREE(xcbc); in xcbc_memory()
|
A D | xcbc_memory_multi.c | 31 xcbc_state *xcbc; in xcbc_memory_multi() local 42 xcbc = XMALLOC(sizeof(xcbc_state)); in xcbc_memory_multi() 43 if (xcbc == NULL) { in xcbc_memory_multi() 48 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory_multi() 56 if ((err = xcbc_process(xcbc, curptr, curlen)) != CRYPT_OK) { in xcbc_memory_multi() 66 if ((err = xcbc_done(xcbc, out, outlen)) != CRYPT_OK) { in xcbc_memory_multi() 71 zeromem(xcbc, sizeof(xcbc_state)); in xcbc_memory_multi() 73 XFREE(xcbc); in xcbc_memory_multi()
|
A D | xcbc_file.c | 38 xcbc_state xcbc; in xcbc_file() 51 if ((err = xcbc_init(&xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_file() 63 if ((err = xcbc_process(&xcbc, buf, (unsigned long)x)) != CRYPT_OK) { in xcbc_file() 74 err = xcbc_done(&xcbc, out, outlen); in xcbc_file() 80 zeromem(&xcbc, sizeof(xcbc_state)); in xcbc_file()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 191 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen); 192 int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen); 193 int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen);
|
Completed in 9 milliseconds