Home
last modified time | relevance | path

Searched refs:cbc (Results 1 – 13 of 13) sorted by relevance

/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/cbc/
A Dcbc_encrypt.c27 LTC_ARGCHK(cbc != NULL); in cbc_encrypt()
34 if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { in cbc_encrypt()
38 if (len % cbc->blocklen) { in cbc_encrypt()
48 …return cipher_descriptor[cbc->cipher]->accel_cbc_encrypt(pt, ct, len / cbc->blocklen, cbc->IV, &cb… in cbc_encrypt()
57 for (x = 0; x < cbc->blocklen; x++) { in cbc_encrypt()
58 cbc->IV[x] ^= pt[x]; in cbc_encrypt()
63 if ((err = cipher_descriptor[cbc->cipher]->ecb_encrypt(cbc->IV, ct, &cbc->key)) != CRYPT_OK) { in cbc_encrypt()
74 cbc->IV[x] = ct[x]; in cbc_encrypt()
78 ct += cbc->blocklen; in cbc_encrypt()
79 pt += cbc->blocklen; in cbc_encrypt()
[all …]
A Dcbc_decrypt.c33 LTC_ARGCHK(cbc != NULL); in cbc_decrypt()
40 …if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV) || cbc->blocklen > (int)sizeof(tmp))… in cbc_decrypt()
44 if (len % cbc->blocklen) { in cbc_decrypt()
54 …return cipher_descriptor[cbc->cipher]->accel_cbc_decrypt(ct, pt, len / cbc->blocklen, cbc->IV, &cb… in cbc_decrypt()
58 if ((err = cipher_descriptor[cbc->cipher]->ecb_decrypt(ct, tmp, &cbc->key)) != CRYPT_OK) { in cbc_decrypt()
70 for (x = 0; x < cbc->blocklen; x++) { in cbc_decrypt()
71 tmpy = tmp[x] ^ cbc->IV[x]; in cbc_decrypt()
72 cbc->IV[x] = ct[x]; in cbc_decrypt()
77 ct += cbc->blocklen; in cbc_decrypt()
78 pt += cbc->blocklen; in cbc_decrypt()
[all …]
A Dcbc_getiv.c19 int cbc_getiv(unsigned char *IV, unsigned long *len, const symmetric_CBC *cbc) in cbc_getiv() argument
23 LTC_ARGCHK(cbc != NULL); in cbc_getiv()
24 if ((unsigned long)cbc->blocklen > *len) { in cbc_getiv()
25 *len = cbc->blocklen; in cbc_getiv()
28 XMEMCPY(IV, cbc->IV, cbc->blocklen); in cbc_getiv()
29 *len = cbc->blocklen; in cbc_getiv()
A Dcbc_start.c23 int keylen, int num_rounds, symmetric_CBC *cbc) in cbc_start() argument
29 LTC_ARGCHK(cbc != NULL); in cbc_start()
37 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &cbc->key)) != CRYPT_OK) { in cbc_start()
42 cbc->blocklen = cipher_descriptor[cipher]->block_length; in cbc_start()
43 cbc->cipher = cipher; in cbc_start()
44 for (x = 0; x < cbc->blocklen; x++) { in cbc_start()
45 cbc->IV[x] = IV[x]; in cbc_start()
A Dcbc_done.c16 int cbc_done(symmetric_CBC *cbc) in cbc_done() argument
19 LTC_ARGCHK(cbc != NULL); in cbc_done()
21 if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { in cbc_done()
24 cipher_descriptor[cbc->cipher]->done(&cbc->key); in cbc_done()
A Dcbc_setiv.c20 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc) in cbc_setiv() argument
23 LTC_ARGCHK(cbc != NULL); in cbc_setiv()
24 if (len != (unsigned long)cbc->blocklen) { in cbc_setiv()
27 XMEMCPY(cbc->IV, IV, len); in cbc_setiv()
/optee_os-3.20.0/core/crypto/
A Daes-cts.c36 struct crypto_cipher_ctx *cbc; member
64 return crypto_cipher_init(c->cbc, mode, key1, key1_len, key2, key2_len, in cts_init()
194 return cbc_cts_update(c->cbc, c->ecb, c->mode, last_block, data, len, in cts_update()
202 crypto_cipher_final(c->cbc); in cts_final()
210 crypto_cipher_free_ctx(c->cbc); in cts_free_ctx()
221 crypto_cipher_copy_state(dst->cbc, src->cbc); in cts_copy_state()
245 res = crypto_aes_cbc_alloc_ctx(&c->cbc); in crypto_aes_cts_alloc_ctx()
A Dsub.mk22 srcs-$(CFG_CRYPTO_CBC_MAC) += cbc-mac.c
38 srcs-$(CFG_CRYPTO_CBC) += sm4-cbc.c
/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/pbes/
A Dpbes.c21 symmetric_CBC cbc; in pbes_decrypt() local
54 if ((err = cbc_start(cid, iv, k, keylen, 0, &cbc)) != CRYPT_OK) goto LBL_ERROR; in pbes_decrypt()
55 …if ((err = cbc_decrypt(arg->enc_data->data, dec_data, arg->enc_data->size, &cbc)) != CRYPT_OK) got… in pbes_decrypt()
56 if ((err = cbc_done(&cbc)) != CRYPT_OK) goto LBL_ERROR; in pbes_decrypt()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/
A Dsub.mk1 subdirs-$(_CFG_CORE_LTC_CBC) += cbc
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_cipher.h905 int keylen, int num_rounds, symmetric_CBC *cbc);
906 int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CBC *cbc);
907 int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CBC *cbc);
908 int cbc_getiv(unsigned char *IV, unsigned long *len, const symmetric_CBC *cbc);
909 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc);
910 int cbc_done(symmetric_CBC *cbc);
/optee_os-3.20.0/core/lib/libtomcrypt/
A Dcbc.c21 unsigned long len, symmetric_CBC *cbc);
A Dsub.mk120 srcs-$(_CFG_CORE_LTC_CBC) += cbc.c

Completed in 16 milliseconds