Home
last modified time | relevance | path

Searched refs:xcbc (Results 1 – 7 of 7) sorted by relevance

/optee_os/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_done.c28 LTC_ARGCHK(xcbc != NULL); in xcbc_done()
36 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher]->block_length) || (xcbc->blocksize < 0) || in xcbc_done()
37 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_done()
42 if (xcbc->buflen == xcbc->blocksize) { in xcbc_done()
45 xcbc->IV[x] ^= xcbc->K[1][x]; in xcbc_done()
48 xcbc->IV[xcbc->buflen] ^= 0x80; in xcbc_done()
51 xcbc->IV[x] ^= xcbc->K[2][x]; in xcbc_done()
56 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_done()
57 cipher_descriptor[xcbc->cipher]->done(&xcbc->key); in xcbc_done()
61 out[x] = xcbc->IV[x]; in xcbc_done()
[all …]
A Dxcbc_process.c32 LTC_ARGCHK(xcbc != NULL); in xcbc_process()
40 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher]->block_length) || (xcbc->blocksize < 0) || in xcbc_process()
41 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_process()
46 if (xcbc->buflen == 0) { in xcbc_process()
51 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process()
52 in += xcbc->blocksize; in xcbc_process()
53 inlen -= xcbc->blocksize; in xcbc_process()
59 if (xcbc->buflen == xcbc->blocksize) { in xcbc_process()
60 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process()
61 xcbc->buflen = 0; in xcbc_process()
[all …]
A Dxcbc_init.c26 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen) in xcbc_init() argument
32 LTC_ARGCHK(xcbc != NULL); in xcbc_init()
57 XMEMCPY(xcbc->K[0], key, k1); in xcbc_init()
58 XMEMCPY(xcbc->K[1], key+k1, cipher_descriptor[cipher]->block_length); in xcbc_init()
77 xcbc->K[y][x] = y + 1; in xcbc_init()
79 cipher_descriptor[cipher]->ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init()
84 err = cipher_descriptor[cipher]->setup(xcbc->K[0], k1, 0, &xcbc->key); in xcbc_init()
87 zeromem(xcbc->IV, cipher_descriptor[cipher]->block_length); in xcbc_init()
88 xcbc->blocksize = cipher_descriptor[cipher]->block_length; in xcbc_init()
89 xcbc->cipher = cipher; in xcbc_init()
[all …]
A Dxcbc_memory.c34 xcbc_state *xcbc; in xcbc_memory() local
47 xcbc = XCALLOC(1, sizeof(*xcbc)); in xcbc_memory()
48 if (xcbc == NULL) { in xcbc_memory()
52 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory()
56 if ((err = xcbc_process(xcbc, in, inlen)) != CRYPT_OK) { in xcbc_memory()
60 err = xcbc_done(xcbc, out, outlen); in xcbc_memory()
62 XFREE(xcbc); in xcbc_memory()
A Dxcbc_memory_multi.c38 xcbc_state *xcbc; in xcbc_memory_multi() local
49 xcbc = XMALLOC(sizeof(xcbc_state)); in xcbc_memory_multi()
50 if (xcbc == NULL) { in xcbc_memory_multi()
55 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory_multi()
63 if ((err = xcbc_process(xcbc, curptr, curlen)) != CRYPT_OK) { in xcbc_memory_multi()
73 if ((err = xcbc_done(xcbc, out, outlen)) != CRYPT_OK) { in xcbc_memory_multi()
78 zeromem(xcbc, sizeof(xcbc_state)); in xcbc_memory_multi()
80 XFREE(xcbc); in xcbc_memory_multi()
A Dxcbc_file.c45 xcbc_state xcbc; in xcbc_file()
58 if ((err = xcbc_init(&xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_file()
70 if ((err = xcbc_process(&xcbc, buf, (unsigned long)x)) != CRYPT_OK) { in xcbc_file()
81 err = xcbc_done(&xcbc, out, outlen); in xcbc_file()
87 zeromem(&xcbc, sizeof(xcbc_state)); in xcbc_file()
/optee_os/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_mac.h187 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen);
188 int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen);
189 int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen);

Completed in 8 milliseconds