/optee_os-3.20.0/core/lib/libtomcrypt/ |
A D | aes_accel.c | 101 LTC_ARGCHK(pt); in aes_ecb_encrypt_nblocks() 114 LTC_ARGCHK(pt); in aes_ecb_decrypt_nblocks() 127 return aes_ecb_encrypt_nblocks(pt, ct, 1, skey); in rijndael_ecb_encrypt() 133 return aes_ecb_decrypt_nblocks(ct, pt, 1, skey); in rijndael_ecb_decrypt() 140 LTC_ARGCHK(pt); in aes_cbc_encrypt_nblocks() 155 LTC_ARGCHK(pt); in aes_cbc_decrypt_nblocks() 170 LTC_ARGCHK(pt); in aes_ctr_encrypt_nblocks() 191 LTC_ARGCHK(pt); in aes_xts_encrypt_nblocks() 199 crypto_accel_aes_xts_enc(ct, pt, skey1->rijndael.eK, in aes_xts_encrypt_nblocks() 211 LTC_ARGCHK(pt); in aes_xts_decrypt_nblocks() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/ciphers/ |
A D | skipjack.c | 144 LTC_ARGCHK(pt != NULL); in s_skipjack_ecb_encrypt() 149 w1 = ((unsigned)pt[0]<<8)|pt[1]; in s_skipjack_ecb_encrypt() 150 w2 = ((unsigned)pt[2]<<8)|pt[3]; in s_skipjack_ecb_encrypt() 151 w3 = ((unsigned)pt[4]<<8)|pt[5]; in s_skipjack_ecb_encrypt() 152 w4 = ((unsigned)pt[6]<<8)|pt[7]; in s_skipjack_ecb_encrypt() 208 LTC_ARGCHK(pt != NULL); in s_skipjack_ecb_decrypt() 243 pt[0] = (w1>>8)&255; pt[1] = w1&255; in s_skipjack_ecb_decrypt() 244 pt[2] = (w2>>8)&255; pt[3] = w2&255; in s_skipjack_ecb_decrypt() 245 pt[4] = (w3>>8)&255; pt[5] = w3&255; in s_skipjack_ecb_decrypt() 246 pt[6] = (w4>>8)&255; pt[7] = w4&255; in s_skipjack_ecb_decrypt() [all …]
|
A D | rc2.c | 154 LTC_ARGCHK(pt != NULL); in s_rc2_ecb_encrypt() 160 x76 = ((unsigned)pt[7] << 8) + (unsigned)pt[6]; in s_rc2_ecb_encrypt() 161 x54 = ((unsigned)pt[5] << 8) + (unsigned)pt[4]; in s_rc2_ecb_encrypt() 162 x32 = ((unsigned)pt[3] << 8) + (unsigned)pt[2]; in s_rc2_ecb_encrypt() 163 x10 = ((unsigned)pt[1] << 8) + (unsigned)pt[0]; in s_rc2_ecb_encrypt() 233 LTC_ARGCHK(pt != NULL); in s_rc2_ecb_decrypt() 265 pt[0] = (unsigned char)x10; in s_rc2_ecb_decrypt() 266 pt[1] = (unsigned char)(x10 >> 8); in s_rc2_ecb_decrypt() 267 pt[2] = (unsigned char)x32; in s_rc2_ecb_decrypt() 269 pt[4] = (unsigned char)x54; in s_rc2_ecb_decrypt() [all …]
|
A D | noekeon.c | 114 LTC_ARGCHK(pt != NULL); in s_noekeon_ecb_encrypt() 117 LOAD32H(a,&pt[0]); LOAD32H(b,&pt[4]); in s_noekeon_ecb_encrypt() 118 LOAD32H(c,&pt[8]); LOAD32H(d,&pt[12]); in s_noekeon_ecb_encrypt() 145 int err = s_noekeon_ecb_encrypt(pt, ct, skey); in noekeon_ecb_encrypt() 168 LTC_ARGCHK(pt != NULL); in s_noekeon_ecb_decrypt() 190 STORE32H(a,&pt[0]); STORE32H(b, &pt[4]); in s_noekeon_ecb_decrypt() 191 STORE32H(c,&pt[8]); STORE32H(d, &pt[12]); in s_noekeon_ecb_decrypt() 198 int err = s_noekeon_ecb_decrypt(ct, pt, skey); in noekeon_ecb_decrypt() 215 unsigned char key[16], pt[16], ct[16]; in noekeon_test() 276 noekeon_ecb_encrypt(tests[i].pt, tmp[0], &key); in noekeon_test() [all …]
|
A D | rc6.c | 117 int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey) in s_rc6_ecb_encrypt() 125 LTC_ARGCHK(pt != NULL); in s_rc6_ecb_encrypt() 127 LOAD32L(a,&pt[0]);LOAD32L(b,&pt[4]);LOAD32L(c,&pt[8]);LOAD32L(d,&pt[12]); in s_rc6_ecb_encrypt() 155 int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey) in rc6_ecb_encrypt() argument 157 int err = s_rc6_ecb_encrypt(pt, ct, skey); in rc6_ecb_encrypt() 180 LTC_ARGCHK(pt != NULL); in s_rc6_ecb_decrypt() 206 STORE32L(a,&pt[0]);STORE32L(b,&pt[4]);STORE32L(c,&pt[8]);STORE32L(d,&pt[12]); in s_rc6_ecb_decrypt() 214 int err = s_rc6_ecb_decrypt(ct, pt, skey); in rc6_ecb_decrypt() 231 unsigned char key[32], pt[16], ct[16]; in rc6_test() 278 rc6_ecb_encrypt(tests[x].pt, tmp[0], &key); in rc6_test() [all …]
|
A D | kseed.c | 254 LOAD32H(P[0], pt); in kseed_ecb_encrypt() 255 LOAD32H(P[1], pt+4); in kseed_ecb_encrypt() 256 LOAD32H(P[2], pt+8); in kseed_ecb_encrypt() 257 LOAD32H(P[3], pt+12); in kseed_ecb_encrypt() 281 STORE32H(P[2], pt); in kseed_ecb_decrypt() 282 STORE32H(P[3], pt+4); in kseed_ecb_decrypt() 283 STORE32H(P[0], pt+8); in kseed_ecb_decrypt() 284 STORE32H(P[1], pt+12); in kseed_ecb_decrypt() 306 unsigned char pt[16], ct[16], key[16]; in kseed_test() 339 kseed_ecb_encrypt(tests[x].pt, buf[0], &skey); in kseed_test() [all …]
|
A D | rc5.c | 130 LTC_ARGCHK(pt != NULL); in s_rc5_ecb_encrypt() 137 LOAD32L(A, &pt[0]); in s_rc5_ecb_encrypt() 138 LOAD32L(B, &pt[4]); in s_rc5_ecb_encrypt() 167 int err = s_rc5_ecb_encrypt(pt, ct, skey); in rc5_ecb_encrypt() 190 LTC_ARGCHK(pt != NULL); in s_rc5_ecb_decrypt() 219 STORE32L(A, &pt[0]); in s_rc5_ecb_decrypt() 220 STORE32L(B, &pt[4]); in s_rc5_ecb_decrypt() 228 int err = s_rc5_ecb_decrypt(ct, pt, skey); in rc5_ecb_decrypt() 244 unsigned char key[16], pt[8], ct[8]; in rc5_test() 276 rc5_ecb_encrypt(tests[x].pt, tmp[0], &key); in rc5_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_cipher.h | 520 unsigned char *pt, unsigned long ptlen, 544 unsigned char *pt, unsigned long ptlen, 603 int (*accel_xts_encrypt)(const unsigned char *pt, unsigned char *ct, 618 int (*accel_xts_decrypt)(const unsigned char *ct, unsigned char *pt, 635 int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey); 636 int rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey); 645 int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey); 646 int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey); 656 int rc2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey); 981 const unsigned char *pt, unsigned long ptlen, [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/chacha/ |
A D | chacha_test.c | 32 …char pt[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the f… in chacha_test() 36 len = XSTRLEN(pt); in chacha_test() 41 …if ((err = chacha_crypt(&st, (unsigned char*)pt, 35, out )) != CRYPT_OK) return err; in chacha_test() 42 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 35, 35, out + 35)) != CRYPT_OK) return err; in chacha_test() 43 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70)) != CRYPT_OK) return err; in chacha_test() 44 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75)) != CRYPT_OK) return err; in chacha_test() 45 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80)) != CRYPT_OK) return err; in chacha_test() 51 …if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in chacha_test() 57 …if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in chacha_test() 62 … n, sizeof(n), 1, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in chacha_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/ctr/ |
A D | ctr_encrypt.c | 41 static int s_ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_C… in s_ctr_encrypt() argument 57 …FAST_TYPE_PTR_CAST((unsigned char *)ct + x)) = *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pt + x)) ^ in s_ctr_encrypt() 60 pt += ctr->blocklen; in s_ctr_encrypt() 67 *ct++ = *pt++ ^ ctr->pad[ctr->padlen++]; in s_ctr_encrypt() 86 int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CTR *ctr) in ctr_encrypt() argument 91 LTC_ARGCHK(pt != NULL); in ctr_encrypt() 117 pt += (len / ctr->blocklen) * ctr->blocklen; in ctr_encrypt() 127 if ((err = s_ctr_encrypt(pt, ct, incr, ctr)) != CRYPT_OK) { in ctr_encrypt() 130 pt += incr; in ctr_encrypt() 133 return ctr_encrypt(pt, ct, len, ctr); in ctr_encrypt() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/rc4/ |
A D | rc4_test.c | 16 const unsigned char pt[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; in rc4_stream_test() 21 if ((err = rc4_stream_crypt(&st, pt, sizeof(pt), buf)) != CRYPT_OK) return err; in rc4_stream_test() 26 if ((err = rc4_stream_memory(key, sizeof(key), pt, sizeof(pt), buf)) != CRYPT_OK) return err; in rc4_stream_test()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/sosemanuk/ |
A D | sosemanuk_test.c | 23 … char pt[] = "Kilroy was here, and there. ...and everywhere!"; /* len = 46 bytes */ in sosemanuk_test() 25 len = XSTRLEN(pt); in sosemanuk_test() 29 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt, 5, out)) != CRYPT_OK) return … in sosemanuk_test() 30 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt + 5, 25, out + 5)) != CRYPT_OK) return … in sosemanuk_test() 31 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt + 30, 10, out + 30)) != CRYPT_OK) return … in sosemanuk_test() 32 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt + 40, len - 40, out + 40)) != CRYPT_OK) return … in sosemanuk_test() 38 if ((err = sosemanuk_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in sosemanuk_test() 43 (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in sosemanuk_test()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/salsa20/ |
A D | salsa20_test.c | 29 char pt[] = "Kilroy was here, and there. ...and everywhere!"; /* len = 46 bytes */ in salsa20_test() 35 len = XSTRLEN(pt); in salsa20_test() 42 …if ((err = salsa20_crypt(&st, (unsigned char*)pt, 5, out)) != CRYPT_OK) return er… in salsa20_test() 43 …if ((err = salsa20_crypt(&st, (unsigned char*)pt + 5, 25, out + 5)) != CRYPT_OK) return er… in salsa20_test() 44 …if ((err = salsa20_crypt(&st, (unsigned char*)pt + 30, 10, out + 30)) != CRYPT_OK) return er… in salsa20_test() 45 …if ((err = salsa20_crypt(&st, (unsigned char*)pt + 40, len - 40, out + 40)) != CRYPT_OK) return er… in salsa20_test() 53 if ((err = salsa20_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in salsa20_test() 58 (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in salsa20_test()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/ecb/ |
A D | ecb_decrypt.c | 20 int ecb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_ECB *ecb) in ecb_decrypt() argument 23 LTC_ARGCHK(pt != 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()
|
A D | ecb_encrypt.c | 20 int ecb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_ECB *ecb) in ecb_encrypt() argument 23 LTC_ARGCHK(pt != 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()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb/ |
A D | ocb_encrypt_authenticate_memory.c | 28 const unsigned char *pt, unsigned long ptlen, in ocb_encrypt_authenticate_memory() argument 37 LTC_ARGCHK(pt != NULL); in ocb_encrypt_authenticate_memory() 53 if ((err = ocb_encrypt(ocb, pt, ct)) != CRYPT_OK) { in ocb_encrypt_authenticate_memory() 57 pt += ocb->block_len; in ocb_encrypt_authenticate_memory() 61 err = ocb_done_encrypt(ocb, pt, ptlen, ct, tag, taglen); in ocb_encrypt_authenticate_memory()
|
A D | ocb_decrypt_verify_memory.c | 30 unsigned char *pt, in ocb_decrypt_verify_memory() argument 39 LTC_ARGCHK(pt != NULL); in ocb_decrypt_verify_memory() 55 if ((err = ocb_decrypt(ocb, ct, pt)) != CRYPT_OK) { in ocb_decrypt_verify_memory() 59 pt += ocb->block_len; in ocb_decrypt_verify_memory() 63 err = ocb_done_decrypt(ocb, ct, ctlen, pt, tag, taglen, stat); in ocb_decrypt_verify_memory()
|
A D | ocb_decrypt.c | 19 int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt) in ocb_decrypt() argument 25 LTC_ARGCHK(pt != NULL); in ocb_decrypt() 46 if ((err = cipher_descriptor[ocb->cipher]->ecb_decrypt(tmp, pt, &ocb->key)) != CRYPT_OK) { in ocb_decrypt() 50 pt[x] ^= Z[x]; in ocb_decrypt() 55 ocb->checksum[x] ^= pt[x]; in ocb_decrypt()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/lrw/ |
A D | lrw_decrypt.c | 19 int lrw_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_LRW *lrw) in lrw_decrypt() argument 23 LTC_ARGCHK(pt != NULL); in lrw_decrypt() 32 …return cipher_descriptor[lrw->cipher]->accel_lrw_decrypt(ct, pt, len, lrw->IV, lrw->tweak, &lrw->k… in lrw_decrypt() 35 return lrw_process(ct, pt, len, LRW_DECRYPT, lrw); in lrw_decrypt()
|
A D | lrw_encrypt.c | 19 int lrw_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_LRW *lrw) in lrw_encrypt() argument 23 LTC_ARGCHK(pt != NULL); in lrw_encrypt() 32 …return cipher_descriptor[lrw->cipher]->accel_lrw_encrypt(pt, ct, len, lrw->IV, lrw->tweak, &lrw->k… in lrw_encrypt() 35 return lrw_process(pt, ct, len, LRW_ENCRYPT, lrw); in lrw_encrypt()
|
/optee_os-3.20.0/ta/avb/ |
A D | entry.c | 85 if (pt != exp_pt) in read_rb_idx() 141 if (pt != exp_pt) in write_rb_idx() 189 if (pt != exp_pt) in read_lock_state() 227 if (pt != exp_pt) in write_lock_state() 267 if (pt != exp_pt) in write_persist_value() 317 if (pt != exp_pt) in read_persist_value() 378 uint32_t pt, in TA_InvokeCommandEntryPoint() argument 383 return read_rb_idx(pt, params); in TA_InvokeCommandEntryPoint() 385 return write_rb_idx(pt, params); in TA_InvokeCommandEntryPoint() 387 return read_lock_state(pt, params); in TA_InvokeCommandEntryPoint() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/xts/ |
A D | xts_decrypt.c | 53 int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, unsigned char *twe… in xts_decrypt() argument 61 LTC_ARGCHK(pt != NULL); in xts_decrypt() 89 …if ((err = cipher_descriptor[xts->cipher]->accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1, &xts-… in xts_decrypt() 94 pt += lim * 16; in xts_decrypt() 105 if ((err = s_tweak_uncrypt(ct, pt, T, xts)) != CRYPT_OK) { in xts_decrypt() 109 pt += 16; in xts_decrypt() 126 pt[16 + i] = PP[i]; in xts_decrypt() 133 if ((err = s_tweak_uncrypt(CC, pt, T, xts)) != CRYPT_OK) { in xts_decrypt()
|
A D | xts_encrypt.c | 55 int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *twe… in xts_encrypt() argument 63 LTC_ARGCHK(pt != NULL); in xts_encrypt() 91 …if ((err = cipher_descriptor[xts->cipher]->accel_xts_encrypt(pt, ct, lim, tweak, &xts->key1, &xts-… in xts_encrypt() 96 pt += lim * 16; in xts_encrypt() 108 if ((err = s_tweak_crypt(pt, ct, T, xts)) != CRYPT_OK) { in xts_encrypt() 112 pt += 16; in xts_encrypt() 119 if ((err = s_tweak_crypt(pt, CC, T, xts)) != CRYPT_OK) { in xts_encrypt() 125 PP[i] = pt[16 + i]; in xts_encrypt()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/cbc/ |
A D | cbc_decrypt.c | 21 int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CBC *cbc) in cbc_decrypt() argument 31 LTC_ARGCHK(pt != NULL); in cbc_decrypt() 54 …return cipher_descriptor[cbc->cipher]->accel_cbc_decrypt(ct, pt, len / cbc->blocklen, cbc->IV, &cb… in cbc_decrypt() 67 *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pt + x)) = tmpy; in cbc_decrypt() 73 pt[x] = tmpy; in cbc_decrypt() 78 pt += cbc->blocklen; in cbc_decrypt()
|
A D | cbc_encrypt.c | 21 int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CBC *cbc) in cbc_encrypt() argument 25 LTC_ARGCHK(pt != NULL); in cbc_encrypt() 48 …return cipher_descriptor[cbc->cipher]->accel_cbc_encrypt(pt, ct, len / cbc->blocklen, cbc->IV, &cb… in cbc_encrypt() 54 …TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) ^= *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pt + x)); in cbc_encrypt() 58 cbc->IV[x] ^= pt[x]; in cbc_encrypt() 79 pt += cbc->blocklen; in cbc_encrypt()
|