| /optee_os/core/lib/libtomcrypt/src/mac/xcbc/ |
| H A D | xcbc_init.c | 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() 72 cipher_descriptor[cipher]->ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init() 77 err = cipher_descriptor[cipher]->setup(xcbc->K[0], k1, 0, &xcbc->key); in xcbc_init() [all …]
|
| H A D | xcbc_process.c | 33 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher]->block_length) || (xcbc->blocksize < 0) || in xcbc_process() 44 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process() 53 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process()
|
| H A D | xcbc_done.c | 29 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher]->block_length) || (xcbc->blocksize < 0) || in xcbc_done() 49 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_done() 50 cipher_descriptor[xcbc->cipher]->done(&xcbc->key); in xcbc_done()
|
| /optee_os/core/lib/libtomcrypt/src/modes/ecb/ |
| H A D | ecb_encrypt.c | 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 D | ecb_decrypt.c | 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()
|
| /optee_os/core/lib/libtomcrypt/src/modes/f8/ |
| H A D | f8_start.c | 43 if (cipher_descriptor[cipher]->block_length % sizeof(LTC_FAST_TYPE)) { 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/encauth/ccm/ |
| H A D | ccm_memory.c | 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() 251 if ((err = cipher_descriptor[cipher]->ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { in ccm_memory() 262 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { in ccm_memory() [all …]
|
| H A D | ccm_done.c | 31 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_done() 40 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->ctr, ccm->CTRPAD, &ccm->K)) != CRYPT_O… in ccm_done() 44 cipher_descriptor[ccm->cipher]->done(&ccm->K); in ccm_done()
|
| /optee_os/core/lib/libtomcrypt/src/mac/f9/ |
| H A D | f9_init.c | 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()
|
| H A D | f9_done.c | 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/ctr/ |
| H A D | ctr_start.c | 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() 86 return cipher_descriptor[ctr->cipher]->ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key); in ctr_start()
|
| /optee_os/core/lib/libtomcrypt/src/misc/crypt/ |
| H A D | crypt_register_cipher.c | 24 if (cipher_descriptor[x] != NULL && cipher_descriptor[x]->ID == cipher->ID) { in register_cipher() 32 if (cipher_descriptor[x] == NULL) { in register_cipher() 33 cipher_descriptor[x] = cipher; in register_cipher()
|
| H A D | crypt_find_cipher_any.c | 28 if (cipher_descriptor[x] == NULL) { in find_cipher_any() 31 …if (blocklen <= (int)cipher_descriptor[x]->block_length && keylen <= (int)cipher_descriptor[x]->ma… in find_cipher_any()
|
| H A D | crypt_find_cipher_id.c | 19 for (x = 0; x < TAB_SIZE && cipher_descriptor[x] != NULL; x++) { in find_cipher_id() 20 if (cipher_descriptor[x]->ID == ID) { in find_cipher_id()
|
| H A D | crypt_find_cipher.c | 21 if (cipher_descriptor[x] != NULL && !XSTRCMP(cipher_descriptor[x]->name, name)) { in find_cipher()
|
| H A D | crypt_unregister_cipher.c | 24 if (cipher_descriptor[x] == cipher) { in unregister_cipher() 25 cipher_descriptor[x] = NULL; in unregister_cipher()
|
| /optee_os/core/lib/libtomcrypt/src/hashes/chc/ |
| H A D | chc.c | 43 kl = cipher_descriptor[cipher]->block_length; in chc_register() 51 if ((err = cipher_descriptor[cipher]->keysize(&kl)) != CRYPT_OK) { in chc_register() 55 if (kl != cipher_descriptor[cipher]->block_length) { in chc_register() 66 hash_descriptor[idx]->blocksize = cipher_descriptor[cipher]->block_length; in chc_register() 70 cipher_blocksize = cipher_descriptor[cipher]->block_length; in chc_register() 92 if (cipher_blocksize != cipher_descriptor[cipher_idx]->block_length) { in chc_init() 102 if ((err = cipher_descriptor[cipher_idx]->setup(buf, cipher_blocksize, 0, key)) != CRYPT_OK) { in chc_init() 108 cipher_descriptor[cipher_idx]->ecb_encrypt(buf, md->chc.state, key); in chc_init() 133 …if ((err = cipher_descriptor[cipher_idx]->setup(md->chc.state, cipher_blocksize, 0, key)) != CRYPT… in s_chc_compress() 138 cipher_descriptor[cipher_idx]->ecb_encrypt(buf, T[0], key); in s_chc_compress() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/modes/xts/ |
| H A D | xts_test.c | 23 orig = cipher_descriptor[xts.cipher]->accel_xts_encrypt; in s_xts_test_accel_xts_encrypt() 24 cipher_descriptor[xts.cipher]->accel_xts_encrypt = NULL; in s_xts_test_accel_xts_encrypt() 30 cipher_descriptor[xts.cipher]->accel_xts_encrypt = orig; in s_xts_test_accel_xts_encrypt() 50 orig = cipher_descriptor[xts.cipher]->accel_xts_decrypt; in s_xts_test_accel_xts_decrypt() 51 cipher_descriptor[xts.cipher]->accel_xts_decrypt = NULL; in s_xts_test_accel_xts_decrypt() 57 cipher_descriptor[xts.cipher]->accel_xts_decrypt = orig; in s_xts_test_accel_xts_decrypt() 208 cipher_descriptor[idx]->accel_xts_encrypt = NULL; in xts_test() 209 cipher_descriptor[idx]->accel_xts_decrypt = NULL; in xts_test() 211 cipher_descriptor[idx]->accel_xts_encrypt = s_xts_test_accel_xts_encrypt; in xts_test() 214 cipher_descriptor[idx]->accel_xts_decrypt = s_xts_test_accel_xts_decrypt; in xts_test()
|
| H A D | xts_init.c | 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()
|
| H A D | xts_decrypt.c | 27 err = cipher_descriptor[xts->cipher]->ecb_decrypt(P, P, &xts->key1); in s_tweak_uncrypt() 86 if (cipher_descriptor[xts->cipher]->accel_xts_decrypt && lim > 0) { in xts_decrypt() 89 …if ((err = cipher_descriptor[xts->cipher]->accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1, &xts-… in xts_decrypt() 100 if ((err = cipher_descriptor[xts->cipher]->ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { in xts_decrypt() 139 if ((err = cipher_descriptor[xts->cipher]->ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { in xts_decrypt()
|
| H A D | xts_encrypt.c | 27 if ((err = cipher_descriptor[xts->cipher]->ecb_encrypt(C, C, &xts->key1)) != CRYPT_OK) { in s_tweak_crypt() 88 if (cipher_descriptor[xts->cipher]->accel_xts_encrypt && lim > 0) { in xts_encrypt() 91 …if ((err = cipher_descriptor[xts->cipher]->accel_xts_encrypt(pt, ct, lim, tweak, &xts->key1, &xts-… in xts_encrypt() 103 if ((err = cipher_descriptor[xts->cipher]->ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { in xts_encrypt() 140 if ((err = cipher_descriptor[xts->cipher]->ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { in xts_encrypt()
|
| H A D | xts_done.c | 17 cipher_descriptor[xts->cipher]->done(&xts->key1); in xts_done() 18 cipher_descriptor[xts->cipher]->done(&xts->key2); in xts_done()
|
| /optee_os/core/lib/libtomcrypt/src/mac/omac/ |
| H A D | omac_init.c | 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()
|
| /optee_os/core/lib/libtomcrypt/src/modes/cfb/ |
| H A D | cfb_start.c | 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/encauth/ocb/ |
| H A D | ocb_decrypt.c | 32 LTC_ARGCHK(cipher_descriptor[ocb->cipher]->ecb_decrypt != NULL); in ocb_decrypt() 35 if (ocb->block_len != cipher_descriptor[ocb->cipher]->block_length) { in ocb_decrypt() 46 if ((err = cipher_descriptor[ocb->cipher]->ecb_decrypt(tmp, pt, &ocb->key)) != CRYPT_OK) { in ocb_decrypt()
|