/optee_os/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_gf_mult.c | 127 for (i = 0; i < 4; i++) { in gcm_gf_mult() 132 for (i = 0; i < 2; i++) { in gcm_gf_mult() 142 for (i = 1; i < (int)WPV; i++) { in gcm_gf_mult() 149 for (i = 0; i < (int)WPV; i++) { in gcm_gf_mult() 150 B[M(3)][i] = B[M(1)][i] ^ B[M(2)][i]; in gcm_gf_mult() 151 B[M(5)][i] = B[M(1)][i] ^ B[M(4)][i]; in gcm_gf_mult() 169 for (i = (BPD/4)-1; i >= 0; i--) { in gcm_gf_mult() 192 for (i = 0; i < 8; i++) { in gcm_gf_mult() 196 for (i = 0; i < 4; i++) { in gcm_gf_mult() 202 for (i = 31; i >= 16; i--) { in gcm_gf_mult() [all …]
|
/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | des.c | 451 for( i = 0; i < 16; i++ ) in mbedtls_des_setkey() 510 for( i = 0; i < 16; i += 2 ) in mbedtls_des_setkey_dec() 528 for( i = 0; i < 32; i += 2 ) in des3_set2key() 582 for( i = 0; i < 32; i += 2 ) in des3_set3key() 641 for( i = 0; i < 8; i++ ) in mbedtls_des_crypt_ecb() 677 for( i = 0; i < 8; i++ ) in mbedtls_des_crypt_cbc() 728 for( i = 0; i < 8; i++ ) in mbedtls_des3_crypt_ecb() 734 for( i = 0; i < 8; i++ ) in mbedtls_des3_crypt_ecb() 740 for( i = 0; i < 8; i++ ) in mbedtls_des3_crypt_ecb() 883 for( i = 0; i < 6; i++ ) in mbedtls_des_self_test() [all …]
|
A D | gcm.c | 136 for( i = 4; i > 0; i >>= 1 ) in gcm_gen_table() 146 for( i = 2; i <= 8; i *= 2 ) in gcm_gen_table() 241 for( i = 15; i >= 0; i-- ) in gcm_mult() 319 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_starts() 328 for( i = 0; i < 16; i++ ) in mbedtls_gcm_starts() 346 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_starts() 392 for( i = 16; i > 12; i-- ) in mbedtls_gcm_update() 402 for( i = 0; i < use_len; i++ ) in mbedtls_gcm_update() 406 out_p[i] = ectr[i] ^ p[i]; in mbedtls_gcm_update() 450 for( i = 0; i < 16; i++ ) in mbedtls_gcm_finish() [all …]
|
A D | xtea.c | 81 int i; in mbedtls_xtea_setup() local 85 for( i = 0; i < 4; i++ ) in mbedtls_xtea_setup() 87 GET_UINT32_BE( ctx->k[i], key, i << 2 ); in mbedtls_xtea_setup() 108 for( i = 0; i < 32; i++ ) in mbedtls_xtea_crypt_ecb() 119 for( i = 0; i < 32; i++ ) in mbedtls_xtea_crypt_ecb() 141 int i; in mbedtls_xtea_crypt_cbc() local 154 for( i = 0; i < 8; i++ ) in mbedtls_xtea_crypt_cbc() 155 output[i] = (unsigned char)( output[i] ^ iv[i] ); in mbedtls_xtea_crypt_cbc() 168 for( i = 0; i < 8; i++ ) in mbedtls_xtea_crypt_cbc() 169 output[i] = (unsigned char)( input[i] ^ iv[i] ); in mbedtls_xtea_crypt_cbc() [all …]
|
A D | camellia.c | 367 for( i = 0; i < keybits / 8; ++i ) in mbedtls_camellia_setkey_enc() 371 for( i = 0; i < 8; i++ ) in mbedtls_camellia_setkey_enc() 378 for( i = 0; i < 6; i++ ) { in mbedtls_camellia_setkey_enc() 390 for( i = 0; i < 8; i++ ) in mbedtls_camellia_setkey_enc() 394 for( i = 0; i < 4; ++i ) in mbedtls_camellia_setkey_enc() 400 for( i = 0; i < 4; ++i ) in mbedtls_camellia_setkey_enc() 408 for( i = 0; i < 4; ++i ) in mbedtls_camellia_setkey_enc() 436 for( i = 0; i < 20; i++ ) { in mbedtls_camellia_setkey_enc() 593 for( i = 0; i < 16; i++ ) in mbedtls_camellia_crypt_cbc() 607 for( i = 0; i < 16; i++ ) in mbedtls_camellia_crypt_cbc() [all …]
|
A D | aria.c | 424 for( i = 0; i < 4; i++ ) in aria_rot128() 480 i = i < 2 ? i + 1 : 0; in mbedtls_aria_setkey_enc() 482 i = i < 2 ? i + 1 : 0; in mbedtls_aria_setkey_enc() 516 for( i = 0, j = ctx->nr; i < j; i++, j-- ) in mbedtls_aria_setkey_dec() 527 for( i = 1; i < ctx->nr; i++ ) in mbedtls_aria_setkey_dec() 640 for( i = 0; i < MBEDTLS_ARIA_BLOCKSIZE; i++ ) in mbedtls_aria_crypt_cbc() 654 for( i = 0; i < MBEDTLS_ARIA_BLOCKSIZE; i++ ) in mbedtls_aria_crypt_cbc() 955 for( i = 0; i < 3; i++ ) in mbedtls_aria_self_test() 980 for( i = 0; i < 3; i++ ) in mbedtls_aria_self_test() 1010 for( i = 0; i < 3; i++ ) in mbedtls_aria_self_test() [all …]
|
A D | chacha20.c | 150 for( i = 0U; i < 10U; i++ ) in chacha20_block() 170 for( i = 0U; i < 16; i++ ) in chacha20_block() 280 for( i = 0U; i < 64U; i += 8U ) in mbedtls_chacha20_update() 282 output[offset + i ] = input[offset + i ] ^ ctx->keystream8[i ]; in mbedtls_chacha20_update() 283 output[offset + i+1] = input[offset + i+1] ^ ctx->keystream8[i+1]; in mbedtls_chacha20_update() 284 output[offset + i+2] = input[offset + i+2] ^ ctx->keystream8[i+2]; in mbedtls_chacha20_update() 285 output[offset + i+3] = input[offset + i+3] ^ ctx->keystream8[i+3]; in mbedtls_chacha20_update() 286 output[offset + i+4] = input[offset + i+4] ^ ctx->keystream8[i+4]; in mbedtls_chacha20_update() 303 for( i = 0U; i < size; i++) in mbedtls_chacha20_update() 305 output[offset + i] = input[offset + i] ^ ctx->keystream8[i]; in mbedtls_chacha20_update() [all …]
|
A D | blowfish.c | 104 for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS; ++i ) in blowfish_enc() 133 for( i = MBEDTLS_BLOWFISH_ROUNDS + 1; i > 1; --i ) in blowfish_dec() 189 for( i = 0; i < 4; i++ ) in mbedtls_blowfish_setkey() 196 for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS + 2; ++i ) in mbedtls_blowfish_setkey() 205 ctx->P[i] = P[i] ^ data; in mbedtls_blowfish_setkey() 211 for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS + 2; i += 2 ) in mbedtls_blowfish_setkey() 218 for( i = 0; i < 4; i++ ) in mbedtls_blowfish_setkey() 293 for( i = 0; i < MBEDTLS_BLOWFISH_BLOCKSIZE;i++ ) in mbedtls_blowfish_crypt_cbc() 307 for( i = 0; i < MBEDTLS_BLOWFISH_BLOCKSIZE; i++ ) in mbedtls_blowfish_crypt_cbc() 308 output[i] = (unsigned char)( input[i] ^ iv[i] ); in mbedtls_blowfish_crypt_cbc() [all …]
|
A D | sha512.c | 264 for( i = 0; i < 8; i++ ) in mbedtls_internal_sha512_process() 265 local.A[i] = ctx->state[i]; in mbedtls_internal_sha512_process() 268 for( i = 0; i < 80; i++ ) in mbedtls_internal_sha512_process() 276 local.W[i] = S1(local.W[i - 2]) + local.W[i - 7] + in mbedtls_internal_sha512_process() 290 for( i = 0; i < 16; i++ ) in mbedtls_internal_sha512_process() 295 for( ; i < 80; i++ ) in mbedtls_internal_sha512_process() 297 local.W[i] = S1(local.W[i - 2]) + local.W[i - 7] + in mbedtls_internal_sha512_process() 305 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process() 324 for( i = 0; i < 8; i++ ) in mbedtls_internal_sha512_process() 325 ctx->state[i] += local.A[i]; in mbedtls_internal_sha512_process() [all …]
|
A D | md2.c | 119 int i, j; in mbedtls_internal_md2_process() local 122 for( i = 0; i < 16; i++ ) in mbedtls_internal_md2_process() 124 ctx->state[i + 16] = ctx->buffer[i]; in mbedtls_internal_md2_process() 126 (unsigned char)( ctx->buffer[i] ^ ctx->state[i]); in mbedtls_internal_md2_process() 129 for( i = 0; i < 18; i++ ) in mbedtls_internal_md2_process() 143 for( i = 0; i < 16; i++ ) in mbedtls_internal_md2_process() 146 ( ctx->cksum[i] ^ PI_SUBST[ctx->buffer[i] ^ t] ); in mbedtls_internal_md2_process() 214 size_t i; in mbedtls_md2_finish_ret() local 219 for( i = ctx->left; i < 16; i++ ) in mbedtls_md2_finish_ret() 324 int i, ret = 0; in mbedtls_md2_self_test() local [all …]
|
A D | arc4.c | 64 int i, j, a; in mbedtls_arc4_setup() local 72 for( i = 0; i < 256; i++ ) in mbedtls_arc4_setup() 73 m[i] = (unsigned char) i; in mbedtls_arc4_setup() 77 for( i = 0; i < 256; i++, k++ ) in mbedtls_arc4_setup() 81 a = m[i]; in mbedtls_arc4_setup() 83 m[i] = m[j]; in mbedtls_arc4_setup() 95 size_t i; in mbedtls_arc4_crypt() local 102 for( i = 0; i < length; i++ ) in mbedtls_arc4_crypt() 110 output[i] = (unsigned char) in mbedtls_arc4_crypt() 154 int i, ret = 0; in mbedtls_arc4_self_test() local [all …]
|
A D | sha256.c | 210 for( i = 0; i < 8; i++ ) in mbedtls_internal_sha256_process() 211 local.A[i] = ctx->state[i]; in mbedtls_internal_sha256_process() 214 for( i = 0; i < 64; i++ ) in mbedtls_internal_sha256_process() 217 GET_UINT32_BE( local.W[i], data, 4 * i ); in mbedtls_internal_sha256_process() 231 for( i = 0; i < 16; i++ ) in mbedtls_internal_sha256_process() 232 GET_UINT32_BE( local.W[i], data, 4 * i ); in mbedtls_internal_sha256_process() 234 for( i = 0; i < 16; i += 8 ) in mbedtls_internal_sha256_process() 254 for( i = 16; i < 64; i += 8 ) in mbedtls_internal_sha256_process() 275 for( i = 0; i < 8; i++ ) in mbedtls_internal_sha256_process() 276 ctx->state[i] += local.A[i]; in mbedtls_internal_sha256_process() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ |
A D | tweetnacl.c | 14 #define FOR(i,n) for (i = 0;i < n;++i) argument 39 FOR(i,n) d |= x[i]^y[i]; in vn() 51 FOR(i,16) r[i]=a[i]; in set25519() 80 FOR(i,16) t[i]=n[i]; in pack25519() 86 for(i=1;i<15;i++) { in pack25519() 126 FOR(i,16) o[i]=a[i]+b[i]; in A() 132 FOR(i,16) o[i]=a[i]-b[i]; in Z() 141 FOR(i,16) o[i]=t[i]; in M() 180 FOR(i,31) z[i]=n[i]; in tweetnacl_crypto_scalarmult() 186 d[i]=a[i]=c[i]=0; in tweetnacl_crypto_scalarmult() [all …]
|
/optee_os/lib/libutils/isoc/newlib/ |
A D | str-two-way.h | 256 while (i < needle_len && (CANON_ELEMENT (needle[i]) in two_way_short_needle() 258 ++i; in two_way_short_needle() 265 --i; in two_way_short_needle() 292 ++i; in two_way_short_needle() 299 --i; in two_way_short_needle() 342 for (i = 0; i < 1U << CHAR_BIT; i++) in two_way_long_needle() 344 for (i = 0; i < needle_len; i++) in two_way_long_needle() 380 ++i; in two_way_long_needle() 387 --i; in two_way_long_needle() 424 ++i; in two_way_long_needle() [all …]
|
/optee_os/core/lib/libtomcrypt/src/misc/pkcs5/ |
A D | pkcs_5_test.c | 160 int i, err; in pkcs_5_test() 172 for(i=0; i < (int)(sizeof(cases_5_2) / sizeof(cases_5_2[0])); i++) { in pkcs_5_test() 175 if((err = pkcs_5_alg2((unsigned char*)cases_5_2[i].P, cases_5_2[i].P_len, in pkcs_5_test() 176 (unsigned char*)cases_5_2[i].S, cases_5_2[i].S_len, in pkcs_5_test() 184 … else if (compare_testvector(DK, dkLen, cases_5_2[i].DK, cases_5_2[i].dkLen, "PKCS#5_2", i)) { in pkcs_5_test() 190 for(i=0; i < (int)(sizeof(cases_5_1) / sizeof(case_item)); i++, tested++) { in pkcs_5_test() 192 if((err = pkcs_5_alg1((unsigned char*)cases_5_1[i].P, cases_5_1[i].P_len, in pkcs_5_test() 201 … else if (compare_testvector(DK, dkLen, cases_5_1[i].DK, cases_5_1[i].dkLen, "PKCS#5_1", i)) { in pkcs_5_test() 207 for(i = 0; i < (int)(sizeof(cases_5_1o) / sizeof(cases_5_1o[0])); i++, tested++) { in pkcs_5_test() 209 if ((err = pkcs_5_alg1_openssl((unsigned char*)cases_5_1o[i].P, cases_5_1o[i].P_len, in pkcs_5_test() [all …]
|
/optee_os/core/crypto/ |
A D | sm4.c | 156 for (i = 0; i < 32; i++) { in sm4_setkey() 157 k[i + 4] = k[i] ^ sm4CalciRK(k[i + 1] ^ k[i + 2] ^ k[i + 3] ^ in sm4_setkey() 159 SK[i] = k[i + 4]; in sm4_setkey() 176 for (i = 0; i < 32; i++) in sm4_one_round() 177 ulbuf[i + 4] = sm4F(ulbuf[i], ulbuf[i + 1], ulbuf[i + 2], in sm4_one_round() 199 for (i = 0; i < 16; i++) in sm4_setkey_dec() 226 for (i = 0; i < 16; i++) in sm4_crypt_cbc() 227 output[i] = (uint8_t)(input[i] ^ iv[i]); in sm4_crypt_cbc() 239 for (i = 0; i < 16; i++) in sm4_crypt_cbc() 260 for (i = 0; i < 16; i++) in sm4_crypt_ctr() [all …]
|
/optee_os/core/lib/libtomcrypt/src/stream/salsa20/ |
A D | salsa20_crypt.c | 30 int i; in _salsa20_block() local 32 for (i = rounds; i > 0; i -= 2) { in _salsa20_block() 42 for (i = 0; i < 16; ++i) { in _salsa20_block() 43 x[i] += input[i]; in _salsa20_block() 44 STORE32L(x[i], output + 4 * i); in _salsa20_block() 59 unsigned long i, j; in salsa20_crypt() local 70 for (i = 0; i < j; ++i, st->ksleft--) out[i] = in[i] ^ st->kstream[64 - st->ksleft]; in salsa20_crypt() 81 for (i = 0; i < inlen; ++i) out[i] = in[i] ^ buf[i]; in salsa20_crypt() 83 for (i = inlen; i < 64; ++i) st->kstream[i] = buf[i]; in salsa20_crypt() 86 for (i = 0; i < 64; ++i) out[i] = in[i] ^ buf[i]; in salsa20_crypt()
|
/optee_os/core/lib/libtomcrypt/src/hashes/ |
A D | sha1.c | 55 for (i = 0; i < 16; i++) { in _sha1_compress() 56 LOAD32H(W[i], buf + (4*i)); in _sha1_compress() 67 for (i = 16; i < 80; i++) { in _sha1_compress() 68 W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); in _sha1_compress() 80 for (i = 0; i < 20; ) { in _sha1_compress() 98 for (i = 0; i < 20; ) { in _sha1_compress() 194 int i; in sha1_done() local 231 for (i = 0; i < 5; i++) { in sha1_done() 232 STORE32H(md->sha1.state[i], out+(4*i)); in sha1_done() 265 int i; in sha1_test() [all …]
|
A D | blake2b.c | 181 for (i = 0; i < 8; ++i) { in blake2b_init0() 194 for (i = 0; i < 8; ++i) { in blake2b_init_param() 318 for (i = 0; i < 16; ++i) { in _blake2b_compress() 319 LOAD64L(m[i], buf + i * sizeof(m[i])); in _blake2b_compress() 322 for (i = 0; i < 8; ++i) { in _blake2b_compress() 348 for (i = 0; i < 8; ++i) { in _blake2b_compress() 349 md->blake2b.h[i] = md->blake2b.h[i] ^ v[i] ^ v[i + 8]; in _blake2b_compress() 482 for (i = 0; tests[i].msg != NULL; i++) { in blake2b_512_test() 529 for (i = 0; tests[i].msg != NULL; i++) { in blake2b_384_test() 582 for (i = 0; tests[i].msg != NULL; i++) { in blake2b_256_test() [all …]
|
A D | blake2s.c | 173 for (i = 0; i < 8; ++i) { in blake2s_init0() 188 for (i = 0; i < 8; ++i) { in blake2s_init_param() 310 for (i = 0; i < 16; ++i) { in _blake2s_compress() 311 LOAD32L(m[i], buf + i * sizeof(m[i])); in _blake2s_compress() 314 for (i = 0; i < 8; ++i) { in _blake2s_compress() 338 for (i = 0; i < 8; ++i) { in _blake2s_compress() 339 md->blake2s.h[i] = md->blake2s.h[i] ^ v[i] ^ v[i + 8]; in _blake2s_compress() 472 for (i = 0; tests[i].msg != NULL; i++) { in blake2s_256_test() 516 for (i = 0; tests[i].msg != NULL; i++) { in blake2s_224_test() 558 for (i = 0; tests[i].msg != NULL; i++) { in blake2s_160_test() [all …]
|
A D | sha3.c | 171 for(i = 0; i < 5; i++) { in keccakf() 172 bc[i] = s[i] ^ s[i + 5] ^ s[i + 10] ^ s[i + 15] ^ s[i + 20]; in keccakf() 174 for(i = 0; i < 5; i++) { in keccakf() 182 for(i = 0; i < 24; i++) { in keccakf() 190 for(i = 0; i < 5; i++) { in keccakf() 191 bc[i] = s[j + i]; in keccakf() 193 for(i = 0; i < 5; i++) { in keccakf() 214 for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { in _done() 302 for(i = 0; i < words; i++, in += sizeof(ulong64)) { in sha3_process() 350 for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { in sha3_shake_done() [all …]
|
/optee_os/core/lib/libtomcrypt/src/stream/chacha/ |
A D | chacha_crypt.c | 29 int i; in _chacha_block() local 31 for (i = rounds; i > 0; i -= 2) { in _chacha_block() 41 for (i = 0; i < 16; ++i) { in _chacha_block() 42 x[i] += input[i]; in _chacha_block() 43 STORE32L(x[i], output + 4 * i); in _chacha_block() 58 unsigned long i, j; in chacha_crypt() local 69 for (i = 0; i < j; ++i, st->ksleft--) out[i] = in[i] ^ st->kstream[64 - st->ksleft]; in chacha_crypt() 86 for (i = 0; i < inlen; ++i) out[i] = in[i] ^ buf[i]; in chacha_crypt() 88 for (i = inlen; i < 64; ++i) st->kstream[i] = buf[i]; in chacha_crypt() 91 for (i = 0; i < 64; ++i) out[i] = in[i] ^ buf[i]; in chacha_crypt()
|
/optee_os/core/lib/libtomcrypt/src/ciphers/ |
A D | idea.c | 64 for (i = 0; i < 15; i++) { in _mul_inv() 83 for (i = 0; i < 8; i++) { in _setup_key() 84 _LOAD16(e_key[i], key + 2 * i); in _setup_key() 86 for (; i < LTC_IDEA_KEYLEN; i++) { in _setup_key() 87 j = (i - i % 8) - 8; in _setup_key() 88 e_key[i] = _LOW16((e_key[j+(i+1)%8] << 9) | (e_key[j+(i+2)%8] >> 7)); in _setup_key() 92 for (i = 0; i < LTC_IDEA_ROUNDS; i++) { in _setup_key() 94 d_key[i*6+1] = _add_inv(e_key[(LTC_IDEA_ROUNDS-i)*6+1+(i>0 ? 1 : 0)]); in _setup_key() 95 d_key[i*6+2] = _add_inv(e_key[(LTC_IDEA_ROUNDS-i)*6+2-(i>0 ? 1 : 0)]); in _setup_key() 110 int i; in _process_block() local [all …]
|
/optee_os/core/lib/libtomcrypt/src/hashes/sha2/ |
A D | sha512.c | 102 for (i = 0; i < 8; i++) { in _sha512_compress() 103 S[i] = md->sha512.state[i]; in _sha512_compress() 107 for (i = 0; i < 16; i++) { in _sha512_compress() 108 LOAD64H(W[i], buf + (8*i)); in _sha512_compress() 112 for (i = 16; i < 80; i++) { in _sha512_compress() 113 W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; in _sha512_compress() 118 for (i = 0; i < 80; i++) { in _sha512_compress() 137 for (i = 0; i < 80; i += 8) { in _sha512_compress() 151 for (i = 0; i < 8; i++) { in _sha512_compress() 152 md->sha512.state[i] = md->sha512.state[i] + S[i]; in _sha512_compress() [all …]
|
/optee_os/core/drivers/imx/dcp/ |
A D | dcp_utils.c | 77 unsigned int i = 0; in dcp_left_shift_buffer() local 81 for (i = 0; i < buffer_size; i++) { in dcp_left_shift_buffer() 103 unsigned int i = 0; in dcp_reverse() local 105 for (i = 0; i < size; i++) in dcp_reverse() 106 out[i] = in[size - 1 - i]; in dcp_reverse() 111 unsigned int i = 0; in dcp_xor() local 113 for (i = 0; i < size; i++) in dcp_xor() 114 out[i] = a[i] ^ b[i]; in dcp_xor() 121 for (i = len; i < DCP_AES128_BLOCK_SIZE; i++) { in dcp_cmac_padding() 122 if (i == len) in dcp_cmac_padding() [all …]
|