Home
last modified time | relevance | path

Searched refs:cipher (Results 1 – 25 of 188) sorted by relevance

12345678

/optee_os/core/drivers/crypto/crypto_api/cipher/
A Dcipher.c40 if (cipher->op && cipher->op->free_ctx) in cipher_free_ctx()
41 cipher->op->free_ctx(cipher->ctx); in cipher_free_ctx()
43 free(cipher); in cipher_free_ctx()
90 if (cipher->op && cipher->op->init) { in cipher_init()
134 if (cipher->op && cipher->op->update) { in cipher_update()
160 if (cipher->op && cipher->op->final) in cipher_final()
161 cipher->op->final(cipher->ctx); in cipher_final()
182 cipher = calloc(1, sizeof(*cipher)); in drvcrypt_cipher_alloc_ctx()
183 if (!cipher) in drvcrypt_cipher_alloc_ctx()
187 if (cipher->op && cipher->op->alloc_ctx) in drvcrypt_cipher_alloc_ctx()
[all …]
/optee_os/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_init.c36 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xcbc_init()
41 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in xcbc_init()
52 if (keylen < 2UL*cipher_descriptor[cipher]->block_length) { in xcbc_init()
56 k1 = keylen - 2*cipher_descriptor[cipher]->block_length; in xcbc_init()
59 …XMEMCPY(xcbc->K[2], key+k1 + cipher_descriptor[cipher]->block_length, cipher_descriptor[cipher]->b… in xcbc_init()
62 k1 = cipher_descriptor[cipher]->block_length; in xcbc_init()
76 for (x = 0; x < cipher_descriptor[cipher]->block_length; x++) { 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.c29 int xcbc_memory(int cipher, in xcbc_memory() argument
38 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xcbc_memory()
43 if (cipher_descriptor[cipher]->xcbc_memory != NULL) { in xcbc_memory()
44 return cipher_descriptor[cipher]->xcbc_memory(key, keylen, in, inlen, out, outlen); in xcbc_memory()
52 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory()
/optee_os/core/lib/libtomcrypt/src/modes/f8/
A Df8_start.c32 int f8_start( int cipher, const unsigned char *IV, in f8_start() argument
45 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f8_start()
50 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in f8_start()
57 f8->cipher = cipher; in f8_start()
58 f8->blocklen = cipher_descriptor[cipher]->block_length; in f8_start()
74 if ((err = cipher_descriptor[cipher]->setup(tkey, keylen, num_rounds, &f8->key)) != CRYPT_OK) { in f8_start()
79 if ((err = cipher_descriptor[f8->cipher]->ecb_encrypt(IV, f8->MIV, &f8->key)) != CRYPT_OK) { in f8_start()
80 cipher_descriptor[f8->cipher]->done(&f8->key); in f8_start()
87 cipher_descriptor[f8->cipher]->done(&f8->key); in f8_start()
90 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &f8->key); in f8_start()
/optee_os/core/lib/libtomcrypt/src/modes/ecb/
A Decb_decrypt.c33 if ((err = cipher_is_valid(ecb->cipher)) != CRYPT_OK) { in ecb_decrypt()
36 if (len % cipher_descriptor[ecb->cipher]->block_length) { in ecb_decrypt()
41 if (cipher_descriptor[ecb->cipher]->accel_ecb_decrypt != NULL) { in ecb_decrypt()
42 …return cipher_descriptor[ecb->cipher]->accel_ecb_decrypt(ct, pt, len / cipher_descriptor[ecb->ciph… in ecb_decrypt()
45 if ((err = cipher_descriptor[ecb->cipher]->ecb_decrypt(ct, pt, &ecb->key)) != CRYPT_OK) { in ecb_decrypt()
48 pt += cipher_descriptor[ecb->cipher]->block_length; in ecb_decrypt()
49 ct += cipher_descriptor[ecb->cipher]->block_length; in ecb_decrypt()
50 len -= cipher_descriptor[ecb->cipher]->block_length; in ecb_decrypt()
A Decb_encrypt.c33 if ((err = cipher_is_valid(ecb->cipher)) != CRYPT_OK) { in ecb_encrypt()
36 if (len % cipher_descriptor[ecb->cipher]->block_length) { in ecb_encrypt()
41 if (cipher_descriptor[ecb->cipher]->accel_ecb_encrypt != NULL) { in ecb_encrypt()
42 …return cipher_descriptor[ecb->cipher]->accel_ecb_encrypt(pt, ct, len / cipher_descriptor[ecb->ciph… in ecb_encrypt()
45 if ((err = cipher_descriptor[ecb->cipher]->ecb_encrypt(pt, ct, &ecb->key)) != CRYPT_OK) { in ecb_encrypt()
48 pt += cipher_descriptor[ecb->cipher]->block_length; in ecb_encrypt()
49 ct += cipher_descriptor[ecb->cipher]->block_length; in ecb_encrypt()
50 len -= cipher_descriptor[ecb->cipher]->block_length; in ecb_encrypt()
A Decb_start.c29 int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, symmetric_ECB *ecb) in ecb_start() argument
35 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ecb_start()
38 ecb->cipher = cipher; in ecb_start()
39 ecb->blocklen = cipher_descriptor[cipher]->block_length; in ecb_start()
40 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ecb->key); in ecb_start()
/optee_os/core/lib/libtomcrypt/src/mac/f9/
A Df9_init.c26 int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long keylen) in f9_init() argument
34 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f9_init()
39 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in f9_init()
44 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &f9->key)) != CRYPT_OK) { in f9_init()
54 zeromem(f9->IV, cipher_descriptor[cipher]->block_length); in f9_init()
55 zeromem(f9->ACC, cipher_descriptor[cipher]->block_length); in f9_init()
56 f9->blocksize = cipher_descriptor[cipher]->block_length; in f9_init()
57 f9->cipher = cipher; in f9_init()
A Df9_done.c32 if ((err = cipher_is_valid(f9->cipher)) != CRYPT_OK) { in f9_done()
36 if ((f9->blocksize > cipher_descriptor[f9->cipher]->block_length) || (f9->blocksize < 0) || in f9_done()
43 cipher_descriptor[f9->cipher]->ecb_encrypt(f9->IV, f9->IV, &f9->key); in f9_done()
51 … if ((err = cipher_descriptor[f9->cipher]->setup(f9->akey, f9->keylen, 0, &f9->key)) != CRYPT_OK) { in f9_done()
56 cipher_descriptor[f9->cipher]->ecb_encrypt(f9->ACC, f9->ACC, &f9->key); in f9_done()
57 cipher_descriptor[f9->cipher]->done(&f9->key); in f9_done()
A Df9_memory.c29 int f9_memory(int cipher, in f9_memory() argument
38 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f9_memory()
43 if (cipher_descriptor[cipher]->f9_memory != NULL) { in f9_memory()
44 return cipher_descriptor[cipher]->f9_memory(key, keylen, in, inlen, out, outlen); in f9_memory()
52 if ((err = f9_init(f9, cipher, key, keylen)) != CRYPT_OK) { in f9_memory()
/optee_os/core/lib/libtomcrypt/src/prngs/
A Dyarrow.c49 prng->u.yarrow.cipher = register_cipher(&aes_enc_desc); in yarrow_start()
53 prng->u.yarrow.cipher = register_cipher(&aes_desc); in yarrow_start()
60 prng->u.yarrow.cipher = register_cipher(&rc6_desc); in yarrow_start()
62 prng->u.yarrow.cipher = register_cipher(&rc5_desc); in yarrow_start()
64 prng->u.yarrow.cipher = register_cipher(&saferp_desc); in yarrow_start()
66 prng->u.yarrow.cipher = register_cipher(&rc2_desc); in yarrow_start()
70 prng->u.yarrow.cipher = register_cipher(&anubis_desc); in yarrow_start()
72 prng->u.yarrow.cipher = register_cipher(&kseed_desc); in yarrow_start()
76 prng->u.yarrow.cipher = register_cipher(&cast5_desc); in yarrow_start()
78 prng->u.yarrow.cipher = register_cipher(&xtea_desc); in yarrow_start()
[all …]
/optee_os/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_mac.h51 int omac_memory(int cipher,
59 int omac_file(int cipher,
86 int pmac_memory(int cipher,
96 int pmac_file(int cipher,
182 int cipher, member
190 int xcbc_memory(int cipher,
198 int xcbc_file(int cipher,
215 int cipher, member
224 int f9_memory(int cipher,
232 int f9_file(int cipher,
[all …]
/optee_os/core/lib/libtomcrypt/src/modes/ctr/
A Dctr_start.c31 int ctr_start( int cipher, in ctr_start() argument
44 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ctr_start()
49 ctr->ctrlen = (ctr_mode & 255) ? (ctr_mode & 255) : cipher_descriptor[cipher]->block_length; in ctr_start()
50 if (ctr->ctrlen > cipher_descriptor[cipher]->block_length) { in ctr_start()
55 ctr->ctrlen = cipher_descriptor[cipher]->block_length - ctr->ctrlen; in ctr_start()
59 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ctr->key)) != CRYPT_OK) { in ctr_start()
64 ctr->blocklen = cipher_descriptor[cipher]->block_length; in ctr_start()
65 ctr->cipher = cipher; in ctr_start()
93 return cipher_descriptor[ctr->cipher]->ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key); in ctr_start()
/optee_os/core/lib/libtomcrypt/src/modes/xts/
A Dxts_init.c27 int xts_start(int cipher, const unsigned char *key1, const unsigned char *key2, unsigned long keyle… in xts_start() argument
38 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xts_start()
42 if (cipher_descriptor[cipher]->block_length != 16) { in xts_start()
47 if ((err = cipher_descriptor[cipher]->setup(key1, keylen, num_rounds, &xts->key1)) != CRYPT_OK) { in xts_start()
50 if ((err = cipher_descriptor[cipher]->setup(key2, keylen, num_rounds, &xts->key2)) != CRYPT_OK) { in xts_start()
53 xts->cipher = cipher; in xts_start()
/optee_os/core/lib/libtomcrypt/src/modes/cfb/
A Dcfb_start.c30 int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, in cfb_start() argument
39 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in cfb_start()
45 cfb->cipher = cipher; in cfb_start()
46 cfb->blocklen = cipher_descriptor[cipher]->block_length; in cfb_start()
52 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &cfb->key)) != CRYPT_OK) { in cfb_start()
58 return cipher_descriptor[cfb->cipher]->ecb_encrypt(cfb->IV, cfb->IV, &cfb->key); in cfb_start()
/optee_os/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_memory.c40 int ccm_memory(int cipher, in ccm_memory() argument
77 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ccm_memory()
80 if (cipher_descriptor[cipher]->block_length != 16) { in ccm_memory()
90 if (cipher_descriptor[cipher]->accel_ccm_memory != NULL) { in ccm_memory()
91 return cipher_descriptor[cipher]->accel_ccm_memory( in ccm_memory()
127 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, skey)) != CRYPT_OK) { in ccm_memory()
173 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory()
207 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory()
311 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory()
321 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { in ccm_memory()
[all …]
A Dccm_init.c26 int ccm_init(ccm_state *ccm, int cipher, in ccm_init() argument
37 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ccm_init()
40 if (cipher_descriptor[cipher]->block_length != 16) { in ccm_init()
51 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &ccm->K)) != CRYPT_OK) { in ccm_init()
54 ccm->cipher = cipher; in ccm_init()
/optee_os/core/lib/libtomcrypt/src/mac/omac/
A Domac_init.c28 int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen) in omac_init() argument
36 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in omac_init()
41 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in omac_init()
47 switch (cipher_descriptor[cipher]->block_length) { in omac_init()
57 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &omac->key)) != CRYPT_OK) { in omac_init()
64 zeromem(omac->Lu[0], cipher_descriptor[cipher]->block_length); in omac_init()
65 …if ((err = cipher_descriptor[cipher]->ecb_encrypt(omac->Lu[0], omac->Lu[0], &omac->key)) != CRYPT_… in omac_init()
87 omac->cipher_idx = cipher; in omac_init()
/optee_os/core/drivers/crypto/crypto_api/acipher/
A Drsa.c106 const uint8_t *cipher, in crypto_acipher_rsanopad_decrypt() argument
119 cipher, cipher_len); in crypto_acipher_rsanopad_decrypt()
132 rsa_data.cipher.data = (uint8_t *)cipher; in crypto_acipher_rsanopad_decrypt()
133 rsa_data.cipher.length = cipher_len; in crypto_acipher_rsanopad_decrypt()
173 if (!cipher) { in crypto_acipher_rsanopad_encrypt()
184 rsa_data.cipher.data = cipher; in crypto_acipher_rsanopad_encrypt()
200 const uint8_t *cipher, in crypto_acipher_rsaes_decrypt() argument
241 rsa_data.cipher.data = (uint8_t *)cipher; in crypto_acipher_rsaes_decrypt()
242 rsa_data.cipher.length = cipher_len; in crypto_acipher_rsaes_decrypt()
290 if (!cipher) { in crypto_acipher_rsaes_encrypt()
[all …]
/optee_os/core/drivers/crypto/se050/glue/
A Duser.c57 sss_status_t glue_symmetric_context_init(void **cipher) in glue_symmetric_context_init() argument
59 if (crypto_cipher_alloc_ctx(cipher, TEE_ALG_AES_CBC_NOPAD)) in glue_symmetric_context_init()
65 sss_status_t glue_cipher_one_go(void *cipher, TEE_OperationMode mode, in glue_cipher_one_go() argument
70 if (crypto_cipher_init(cipher, mode, key, key_len, NULL, 0, iv, iv_len)) in glue_cipher_one_go()
73 if (crypto_cipher_update(cipher, 0, true, src, len, dst)) in glue_cipher_one_go()
76 crypto_cipher_final(cipher); in glue_cipher_one_go()
81 void glue_context_free(void *cipher) in glue_context_free() argument
83 crypto_cipher_free_ctx(cipher); in glue_context_free()
/optee_os/core/lib/libtomcrypt/src/modes/cbc/
A Dcbc_start.c29 int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, in cbc_start() argument
39 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in cbc_start()
44 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &cbc->key)) != CRYPT_OK) { in cbc_start()
49 cbc->blocklen = cipher_descriptor[cipher]->block_length; in cbc_start()
50 cbc->cipher = cipher; in cbc_start()
/optee_os/core/lib/libtomcrypt/src/modes/ofb/
A Dofb_start.c30 int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, in ofb_start() argument
39 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ofb_start()
44 ofb->cipher = cipher; in ofb_start()
45 ofb->blocklen = cipher_descriptor[cipher]->block_length; in ofb_start()
52 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ofb->key); in ofb_start()
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_init.c27 int gcm_init(gcm_state *gcm, int cipher, in gcm_init() argument
46 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in gcm_init()
49 if (cipher_descriptor[cipher]->block_length != 16) { in gcm_init()
54 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &gcm->K)) != CRYPT_OK) { in gcm_init()
60 if ((err = cipher_descriptor[cipher]->ecb_encrypt(B, gcm->H, &gcm->K)) != CRYPT_OK) { in gcm_init()
67 gcm->cipher = cipher; in gcm_init()
/optee_os/core/lib/libtomcrypt/src/encauth/ocb/
A Docb_init.c46 int ocb_init(ocb_state *ocb, int cipher, in ocb_init() argument
56 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ocb_init()
61 ocb->block_len = cipher_descriptor[cipher]->block_length; in ocb_init()
76 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &ocb->key)) != CRYPT_OK) { in ocb_init()
82 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ocb->L, ocb->L, &ocb->key)) != CRYPT_OK) { in ocb_init()
90 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ocb->R, ocb->R, &ocb->key)) != CRYPT_OK) { in ocb_init()
131 ocb->cipher = cipher; in ocb_init()
/optee_os/core/lib/libtomcrypt/src/modes/lrw/
A Dlrw_start.c30 int lrw_start( int cipher, in lrw_start() argument
55 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in lrw_start()
58 if (cipher_descriptor[cipher]->block_length != 16) { in lrw_start()
63 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &lrw->key)) != CRYPT_OK) { in lrw_start()
66 lrw->cipher = cipher; in lrw_start()

Completed in 22 milliseconds

12345678