/optee_os-3.20.0/core/drivers/crypto/crypto_api/cipher/ |
A D | cipher.c | 39 if (cipher->op && cipher->op->free_ctx) in cipher_free_ctx() 40 cipher->op->free_ctx(cipher->ctx); in cipher_free_ctx() 42 free(cipher); in cipher_free_ctx() 89 if (cipher->op && cipher->op->init) { in cipher_init() 133 if (cipher->op && cipher->op->update) { in cipher_update() 159 if (cipher->op && cipher->op->final) in cipher_final() 160 cipher->op->final(cipher->ctx); in cipher_final() 181 cipher = calloc(1, sizeof(*cipher)); in drvcrypt_cipher_alloc_ctx() 182 if (!cipher) in drvcrypt_cipher_alloc_ctx() 186 if (cipher->op && cipher->op->alloc_ctx) in drvcrypt_cipher_alloc_ctx() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/xcbc/ |
A D | xcbc_init.c | 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() 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() 69 for (x = 0; x < cipher_descriptor[cipher]->block_length; x++) { 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 | 22 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-3.20.0/core/lib/libtomcrypt/src/modes/ecb/ |
A D | ecb_decrypt.c | 26 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()
|
A D | ecb_encrypt.c | 26 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()
|
A D | ecb_start.c | 22 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-3.20.0/core/lib/libtomcrypt/src/mac/f9/ |
A D | f9_init.c | 19 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()
|
A D | f9_memory.c | 22 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()
|
A D | f9_done.c | 25 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-3.20.0/core/lib/libtomcrypt/src/modes/f8/ |
A D | f8_start.c | 25 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-3.20.0/core/lib/libtomcrypt/src/modes/xts/ |
A D | xts_init.c | 20 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-3.20.0/core/lib/libtomcrypt/src/modes/ctr/ |
A D | ctr_start.c | 24 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-3.20.0/core/lib/libtomcrypt/src/modes/cfb/ |
A D | cfb_start.c | 23 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-3.20.0/core/lib/libtomcrypt/src/modes/cbc/ |
A D | cbc_start.c | 22 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-3.20.0/core/lib/libtomcrypt/src/modes/ofb/ |
A D | ofb_start.c | 23 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-3.20.0/core/lib/libtomcrypt/src/prngs/ |
A D | yarrow.c | 42 prng->u.yarrow.cipher = register_cipher(&aes_enc_desc); in yarrow_start() 46 prng->u.yarrow.cipher = register_cipher(&aes_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() 63 prng->u.yarrow.cipher = register_cipher(&anubis_desc); in yarrow_start() 65 prng->u.yarrow.cipher = register_cipher(&kseed_desc); in yarrow_start() 69 prng->u.yarrow.cipher = register_cipher(&cast5_desc); in yarrow_start() 71 prng->u.yarrow.cipher = register_cipher(&xtea_desc); in yarrow_start() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/omac/ |
A D | omac_init.c | 21 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-3.20.0/core/lib/libtomcrypt/src/encauth/ccm/ |
A D | ccm_init.c | 19 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()
|
A D | ccm_memory.c | 33 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() 169 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory() 203 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory() 307 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory() 317 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { in ccm_memory() [all …]
|
/optee_os-3.20.0/core/drivers/crypto/se050/glue/ |
A D | user.c | 57 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-3.20.0/core/drivers/crypto/versal/ |
A D | rsa.c | 52 rsa_data->cipher.data, in do_encrypt() 61 rsa_data->cipher.data, in do_encrypt() 67 rsa_data->cipher.data, in do_encrypt() 85 versal_mbox_alloc(rsa_data->cipher.length, NULL, &cipher); in do_encrypt() 94 arg.ibuf[1].mem = cipher; in do_encrypt() 110 memcpy(rsa_data->cipher.data, cipher.buf, rsa_data->key.n_size); in do_encrypt() 113 free(cipher.buf); in do_encrypt() 175 versal_mbox_alloc(rsa_data->cipher.length, rsa_data->cipher.data, in do_decrypt() 176 &cipher); in do_decrypt() 187 arg.ibuf[2].mem = cipher; in do_decrypt() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 44 int omac_memory(int cipher, 53 int omac_file(int cipher, 80 int pmac_memory(int cipher, 91 int pmac_file(int cipher, 186 int cipher, member 194 int xcbc_memory(int cipher, 203 int xcbc_file(int cipher, 220 int cipher, member 229 int f9_memory(int cipher, 238 int f9_file(int cipher, [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_init.c | 20 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-3.20.0/core/lib/libtomcrypt/src/misc/crypt/ |
A D | crypt_register_cipher.c | 15 int register_cipher(const struct ltc_cipher_descriptor *cipher) in register_cipher() argument 19 LTC_ARGCHK(cipher != NULL); in register_cipher() 24 if (cipher_descriptor[x] != NULL && cipher_descriptor[x]->ID == cipher->ID) { in register_cipher() 33 cipher_descriptor[x] = cipher; in register_cipher()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/lrw/ |
A D | lrw_start.c | 23 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()
|