Home
last modified time | relevance | path

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

123456

/optee_os/core/drivers/crypto/crypto_api/cipher/
H A Dcipher.c36 struct crypto_cipher *cipher = to_cipher_ctx(ctx); in cipher_free_ctx() local
38 if (cipher->op && cipher->op->free_ctx) in cipher_free_ctx()
39 cipher->op->free_ctx(cipher->ctx); in cipher_free_ctx()
41 free(cipher); in cipher_free_ctx()
78 struct crypto_cipher *cipher = to_cipher_ctx(ctx); in cipher_init() local
88 if (cipher->op && cipher->op->init) { in cipher_init()
90 .ctx = cipher->ctx, in cipher_init()
100 ret = cipher->op->init(&dinit); in cipher_init()
120 struct crypto_cipher *cipher = to_cipher_ctx(ctx); in cipher_update() local
132 if (cipher->op && cipher->op->update) { in cipher_update()
[all …]
/optee_os/core/lib/libtomcrypt/src/mac/xcbc/
H A Dxcbc_init.c19 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen) in xcbc_init() argument
29 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xcbc_init()
34 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in xcbc_init()
45 if (keylen < 2UL*cipher_descriptor[cipher]->block_length) { in xcbc_init()
49 k1 = keylen - 2*cipher_descriptor[cipher]->block_length; in xcbc_init()
51 XMEMCPY(xcbc->K[1], key+k1, cipher_descriptor[cipher]->block_length); in xcbc_init()
52 …XMEMCPY(xcbc->K[2], key+k1 + cipher_descriptor[cipher]->block_length, cipher_descriptor[cipher]->b… in xcbc_init()
55 k1 = cipher_descriptor[cipher]->block_length; in xcbc_init()
63 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, skey)) != CRYPT_OK) { in xcbc_init()
69 for (x = 0; x < cipher_descriptor[cipher]->block_length; x++) { in xcbc_init()
[all …]
H A Dxcbc_memory.c22 int xcbc_memory(int cipher, in xcbc_memory() argument
31 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xcbc_memory()
36 if (cipher_descriptor[cipher]->xcbc_memory != NULL) { in xcbc_memory()
37 return cipher_descriptor[cipher]->xcbc_memory(key, keylen, in, inlen, out, outlen); in xcbc_memory()
45 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory()
/optee_os/core/lib/libtomcrypt/src/modes/ecb/
H A Decb_encrypt.c26 if ((err = cipher_is_valid(ecb->cipher)) != CRYPT_OK) { in ecb_encrypt()
29 if (len % cipher_descriptor[ecb->cipher]->block_length) { in ecb_encrypt()
34 if (cipher_descriptor[ecb->cipher]->accel_ecb_encrypt != NULL) { in ecb_encrypt()
35 …return cipher_descriptor[ecb->cipher]->accel_ecb_encrypt(pt, ct, len / cipher_descriptor[ecb->ciph… in ecb_encrypt()
38 if ((err = cipher_descriptor[ecb->cipher]->ecb_encrypt(pt, ct, &ecb->key)) != CRYPT_OK) { in ecb_encrypt()
41 pt += cipher_descriptor[ecb->cipher]->block_length; in ecb_encrypt()
42 ct += cipher_descriptor[ecb->cipher]->block_length; in ecb_encrypt()
43 len -= cipher_descriptor[ecb->cipher]->block_length; in ecb_encrypt()
H A Decb_decrypt.c26 if ((err = cipher_is_valid(ecb->cipher)) != CRYPT_OK) { in ecb_decrypt()
29 if (len % cipher_descriptor[ecb->cipher]->block_length) { in ecb_decrypt()
34 if (cipher_descriptor[ecb->cipher]->accel_ecb_decrypt != NULL) { in ecb_decrypt()
35 …return cipher_descriptor[ecb->cipher]->accel_ecb_decrypt(ct, pt, len / cipher_descriptor[ecb->ciph… in ecb_decrypt()
38 if ((err = cipher_descriptor[ecb->cipher]->ecb_decrypt(ct, pt, &ecb->key)) != CRYPT_OK) { in ecb_decrypt()
41 pt += cipher_descriptor[ecb->cipher]->block_length; in ecb_decrypt()
42 ct += cipher_descriptor[ecb->cipher]->block_length; in ecb_decrypt()
43 len -= cipher_descriptor[ecb->cipher]->block_length; in ecb_decrypt()
H A Decb_start.c22 int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, symmetric_ECB *ecb) in ecb_start() argument
28 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ecb_start()
31 ecb->cipher = cipher; in ecb_start()
32 ecb->blocklen = cipher_descriptor[cipher]->block_length; in ecb_start()
33 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ecb->key); in ecb_start()
/optee_os/core/lib/libtomcrypt/src/mac/f9/
H A Df9_init.c19 int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long keylen) in f9_init() argument
27 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f9_init()
32 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in f9_init()
37 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &f9->key)) != CRYPT_OK) { in f9_init()
47 zeromem(f9->IV, cipher_descriptor[cipher]->block_length); in f9_init()
48 zeromem(f9->ACC, cipher_descriptor[cipher]->block_length); in f9_init()
49 f9->blocksize = cipher_descriptor[cipher]->block_length; in f9_init()
50 f9->cipher = cipher; in f9_init()
H A Df9_memory.c22 int f9_memory(int cipher, in f9_memory() argument
31 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f9_memory()
36 if (cipher_descriptor[cipher]->f9_memory != NULL) { in f9_memory()
37 return cipher_descriptor[cipher]->f9_memory(key, keylen, in, inlen, out, outlen); in f9_memory()
45 if ((err = f9_init(f9, cipher, key, keylen)) != CRYPT_OK) { in f9_memory()
H A Df9_done.c25 if ((err = cipher_is_valid(f9->cipher)) != CRYPT_OK) { in f9_done()
29 if ((f9->blocksize > cipher_descriptor[f9->cipher]->block_length) || (f9->blocksize < 0) || in f9_done()
36 cipher_descriptor[f9->cipher]->ecb_encrypt(f9->IV, f9->IV, &f9->key); in f9_done()
44 … if ((err = cipher_descriptor[f9->cipher]->setup(f9->akey, f9->keylen, 0, &f9->key)) != CRYPT_OK) { in f9_done()
49 cipher_descriptor[f9->cipher]->ecb_encrypt(f9->ACC, f9->ACC, &f9->key); in f9_done()
50 cipher_descriptor[f9->cipher]->done(&f9->key); in f9_done()
/optee_os/core/lib/libtomcrypt/src/modes/f8/
H A Df8_start.c25 int f8_start( int cipher, const unsigned char *IV, in f8_start() argument
38 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f8_start()
43 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in f8_start()
50 f8->cipher = cipher; in f8_start()
51 f8->blocklen = cipher_descriptor[cipher]->block_length; in f8_start()
67 if ((err = cipher_descriptor[cipher]->setup(tkey, keylen, num_rounds, &f8->key)) != CRYPT_OK) { in f8_start()
72 if ((err = cipher_descriptor[f8->cipher]->ecb_encrypt(IV, f8->MIV, &f8->key)) != CRYPT_OK) { in f8_start()
73 cipher_descriptor[f8->cipher]->done(&f8->key); in f8_start()
80 cipher_descriptor[f8->cipher]->done(&f8->key); in f8_start()
83 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &f8->key); in f8_start()
/optee_os/core/lib/libtomcrypt/src/modes/ctr/
H A Dctr_start.c24 int ctr_start( int cipher, in ctr_start() argument
37 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ctr_start()
42 ctr->ctrlen = (ctr_mode & 255) ? (ctr_mode & 255) : cipher_descriptor[cipher]->block_length; in ctr_start()
43 if (ctr->ctrlen > cipher_descriptor[cipher]->block_length) { in ctr_start()
48 ctr->ctrlen = cipher_descriptor[cipher]->block_length - ctr->ctrlen; in ctr_start()
52 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ctr->key)) != CRYPT_OK) { in ctr_start()
57 ctr->blocklen = cipher_descriptor[cipher]->block_length; in ctr_start()
58 ctr->cipher = cipher; in ctr_start()
86 return cipher_descriptor[ctr->cipher]->ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key); in ctr_start()
/optee_os/core/lib/libtomcrypt/src/modes/xts/
H A Dxts_init.c20 int xts_start(int cipher, const unsigned char *key1, const unsigned char *key2, unsigned long keyle… in xts_start() argument
31 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xts_start()
35 if (cipher_descriptor[cipher]->block_length != 16) { in xts_start()
40 if ((err = cipher_descriptor[cipher]->setup(key1, keylen, num_rounds, &xts->key1)) != CRYPT_OK) { in xts_start()
43 if ((err = cipher_descriptor[cipher]->setup(key2, keylen, num_rounds, &xts->key2)) != CRYPT_OK) { in xts_start()
46 xts->cipher = cipher; in xts_start()
/optee_os/core/lib/libtomcrypt/src/modes/cfb/
H A Dcfb_start.c23 int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, in cfb_start() argument
32 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in cfb_start()
38 cfb->cipher = cipher; in cfb_start()
39 cfb->blocklen = cipher_descriptor[cipher]->block_length; in cfb_start()
45 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &cfb->key)) != CRYPT_OK) { in cfb_start()
51 return cipher_descriptor[cfb->cipher]->ecb_encrypt(cfb->IV, cfb->IV, &cfb->key); in cfb_start()
/optee_os/core/lib/libtomcrypt/src/prngs/
H A Dyarrow.c40 prng->u.yarrow.cipher = register_cipher(&rijndael_enc_desc); in yarrow_start()
42 prng->u.yarrow.cipher = register_cipher(&aes_enc_desc); in yarrow_start()
44 prng->u.yarrow.cipher = register_cipher(&rijndael_desc); in yarrow_start()
46 prng->u.yarrow.cipher = register_cipher(&aes_desc); in yarrow_start()
49 prng->u.yarrow.cipher = register_cipher(&blowfish_desc); in yarrow_start()
51 prng->u.yarrow.cipher = register_cipher(&twofish_desc); in yarrow_start()
53 prng->u.yarrow.cipher = register_cipher(&rc6_desc); in yarrow_start()
55 prng->u.yarrow.cipher = register_cipher(&rc5_desc); in yarrow_start()
57 prng->u.yarrow.cipher = register_cipher(&saferp_desc); in yarrow_start()
59 prng->u.yarrow.cipher = register_cipher(&rc2_desc); in yarrow_start()
[all …]
/optee_os/core/drivers/crypto/versal/
H A Drsa.c34 struct versal_mbox_mem cipher = { }; in do_encrypt() local
50 rsa_data->cipher.data, in do_encrypt()
51 &rsa_data->cipher.length); in do_encrypt()
60 rsa_data->cipher.data, in do_encrypt()
61 &rsa_data->cipher.length); in do_encrypt()
66 rsa_data->cipher.data, in do_encrypt()
67 &rsa_data->cipher.length); in do_encrypt()
84 versal_mbox_alloc(rsa_data->cipher.length, NULL, &cipher); in do_encrypt()
93 arg.ibuf[1].mem = cipher; in do_encrypt()
108 rsa_data->cipher.length = rsa_data->key.n_size; in do_encrypt()
[all …]
/optee_os/core/lib/libtomcrypt/src/headers/
H A Dtomcrypt_mac.h41 int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen);
44 int omac_memory(int cipher,
48 int omac_memory_multi(int cipher,
53 int omac_file(int cipher,
76 int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned long keylen);
80 int pmac_memory(int cipher,
85 int pmac_memory_multi(int cipher,
91 int pmac_file(int cipher,
186 int cipher, member
191 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen);
[all …]
/optee_os/core/lib/libtomcrypt/src/modes/cbc/
H A Dcbc_start.c22 int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, in cbc_start() argument
32 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { 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()
/optee_os/core/lib/libtomcrypt/src/modes/ofb/
H A Dofb_start.c23 int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, in ofb_start() argument
32 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ofb_start()
37 ofb->cipher = cipher; in ofb_start()
38 ofb->blocklen = cipher_descriptor[cipher]->block_length; in ofb_start()
45 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ofb->key); in ofb_start()
/optee_os/core/lib/libtomcrypt/src/mac/omac/
H A Domac_init.c21 int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen) in omac_init() argument
29 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in omac_init()
34 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { in omac_init()
40 switch (cipher_descriptor[cipher]->block_length) { in omac_init()
50 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &omac->key)) != CRYPT_OK) { in omac_init()
57 zeromem(omac->Lu[0], cipher_descriptor[cipher]->block_length); in omac_init()
58 …if ((err = cipher_descriptor[cipher]->ecb_encrypt(omac->Lu[0], omac->Lu[0], &omac->key)) != CRYPT_… in omac_init()
80 omac->cipher_idx = cipher; in omac_init()
/optee_os/core/drivers/crypto/se050/glue/
H 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/encauth/ccm/
H A Dccm_init.c19 int ccm_init(ccm_state *ccm, int cipher, in ccm_init() argument
30 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ccm_init()
33 if (cipher_descriptor[cipher]->block_length != 16) { in ccm_init()
44 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &ccm->K)) != CRYPT_OK) { in ccm_init()
47 ccm->cipher = cipher; in ccm_init()
H A Dccm_memory.c33 int ccm_memory(int cipher, in ccm_memory() argument
70 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in ccm_memory()
73 if (cipher_descriptor[cipher]->block_length != 16) { in ccm_memory()
83 if (cipher_descriptor[cipher]->accel_ccm_memory != NULL) { in ccm_memory()
84 return cipher_descriptor[cipher]->accel_ccm_memory( in ccm_memory()
123 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()
198 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()
242 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { in ccm_memory()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
H A Dgcm_init.c20 int gcm_init(gcm_state *gcm, int cipher, in gcm_init() argument
39 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in gcm_init()
42 if (cipher_descriptor[cipher]->block_length != 16) { in gcm_init()
47 if ((err = cipher_descriptor[cipher]->setup(key, keylen, 0, &gcm->K)) != CRYPT_OK) { in gcm_init()
53 if ((err = cipher_descriptor[cipher]->ecb_encrypt(B, gcm->H, &gcm->K)) != CRYPT_OK) { in gcm_init()
60 gcm->cipher = cipher; in gcm_init()
/optee_os/core/drivers/crypto/crypto_api/acipher/
H A Drsa.c108 const uint8_t *cipher, in crypto_acipher_rsanopad_decrypt() argument
116 if (!key || !msg || !cipher || !msg_len) { in crypto_acipher_rsanopad_decrypt()
121 cipher, cipher_len); in crypto_acipher_rsanopad_decrypt()
134 rsa_data.cipher.data = (uint8_t *)cipher; in crypto_acipher_rsanopad_decrypt()
135 rsa_data.cipher.length = cipher_len; in crypto_acipher_rsanopad_decrypt()
149 uint8_t *cipher, size_t *cipher_len) in crypto_acipher_rsanopad_encrypt() argument
160 cipher, cipher_len ? *cipher_len : 0); in crypto_acipher_rsanopad_encrypt()
175 if (!cipher) { in crypto_acipher_rsanopad_encrypt()
186 rsa_data.cipher.data = cipher; in crypto_acipher_rsanopad_encrypt()
187 rsa_data.cipher.length = *cipher_len; in crypto_acipher_rsanopad_encrypt()
[all …]
/optee_os/core/lib/libtomcrypt/src/modes/lrw/
H A Dlrw_start.c23 int lrw_start( int cipher, in lrw_start() argument
48 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in lrw_start()
51 if (cipher_descriptor[cipher]->block_length != 16) { in lrw_start()
56 if ((err = cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &lrw->key)) != CRYPT_OK) { in lrw_start()
59 lrw->cipher = cipher; in lrw_start()

123456