| /optee_os/core/lib/libtomcrypt/src/ciphers/ |
| H A D | multi2.c | 19 ulong32 t; in s_pi2() local 20 t = (p[1] + k[0]) & 0xFFFFFFFFUL; in s_pi2() 21 t = (ROL(t, 1) + t - 1) & 0xFFFFFFFFUL; in s_pi2() 22 t = (ROL(t, 4) ^ t) & 0xFFFFFFFFUL; in s_pi2() 23 p[0] ^= t; in s_pi2() 28 ulong32 t; in s_pi3() local 29 t = p[0] + k[1]; in s_pi3() 30 t = (ROL(t, 2) + t + 1) & 0xFFFFFFFFUL; in s_pi3() 31 t = (ROL(t, 8) ^ t) & 0xFFFFFFFFUL; in s_pi3() 32 t = (t + k[2]) & 0xFFFFFFFFUL; in s_pi3() [all …]
|
| H A D | rc6.c | 120 ulong32 a,b,c,d,t,u; in s_rc6_ecb_encrypt() local 133 t = (b * (b + b + 1)); t = ROLc(t, 5); \ in s_rc6_ecb_encrypt() 135 a = ROL(a^t,u) + K[0]; \ in s_rc6_ecb_encrypt() 136 c = ROL(c^u,t) + K[1]; K += 2; in s_rc6_ecb_encrypt() 175 ulong32 a,b,c,d,t,u; in s_rc6_ecb_decrypt() local 188 t = (b * (b + b + 1)); t = ROLc(t, 5); \ in s_rc6_ecb_decrypt() 190 c = ROR(c - K[1], t) ^ u; \ in s_rc6_ecb_decrypt() 191 a = ROR(a - K[0], u) ^ t; K -= 2; in s_rc6_ecb_decrypt()
|
| /optee_os/core/lib/libtomcrypt/src/misc/base32/ |
| H A D | base32_decode.c | 23 ulong64 t = 0; in base32_decode() local 90 t = (t<<5) | map[c-'0']; in base32_decode() 92 *out++ = (unsigned char)((t>>32) & 255); in base32_decode() 93 *out++ = (unsigned char)((t>>24) & 255); in base32_decode() 94 *out++ = (unsigned char)((t>>16) & 255); in base32_decode() 95 *out++ = (unsigned char)((t>> 8) & 255); in base32_decode() 96 *out++ = (unsigned char)( t & 255); in base32_decode() 98 t = 0; in base32_decode() 102 t = t << (5 * (8 - y)); in base32_decode() 103 if (y >= 2) *out++ = (unsigned char)((t>>32) & 255); in base32_decode() [all …]
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | sha3.c | 108 uint64_t t; in keccak_f1600() local 116 t = lane[(i + 4) % 5] ^ ROTR64(lane[(i + 1) % 5], 63); in keccak_f1600() 117 s[i] ^= t; s[i + 5] ^= t; s[i + 10] ^= t; s[i + 15] ^= t; s[i + 20] ^= t; in keccak_f1600() 126 t = lane[4] ^ ROTR64(lane[1], 63); in keccak_f1600() 127 s[0] ^= t; s[5] ^= t; s[10] ^= t; s[15] ^= t; s[20] ^= t; in keccak_f1600() 129 t = lane[0] ^ ROTR64(lane[2], 63); in keccak_f1600() 130 s[1] ^= t; s[6] ^= t; s[11] ^= t; s[16] ^= t; s[21] ^= t; in keccak_f1600() 132 t = lane[1] ^ ROTR64(lane[3], 63); in keccak_f1600() 133 s[2] ^= t; s[7] ^= t; s[12] ^= t; s[17] ^= t; s[22] ^= t; in keccak_f1600() 135 t = lane[2] ^ ROTR64(lane[4], 63); in keccak_f1600() [all …]
|
| H A D | aes.c | 892 } t; in mbedtls_internal_aes_encrypt() local 894 t.X[0] = MBEDTLS_GET_UINT32_LE(input, 0); t.X[0] ^= *RK++; in mbedtls_internal_aes_encrypt() 895 t.X[1] = MBEDTLS_GET_UINT32_LE(input, 4); t.X[1] ^= *RK++; in mbedtls_internal_aes_encrypt() 896 t.X[2] = MBEDTLS_GET_UINT32_LE(input, 8); t.X[2] ^= *RK++; in mbedtls_internal_aes_encrypt() 897 t.X[3] = MBEDTLS_GET_UINT32_LE(input, 12); t.X[3] ^= *RK++; in mbedtls_internal_aes_encrypt() 900 AES_FROUND(t.Y[0], t.Y[1], t.Y[2], t.Y[3], t.X[0], t.X[1], t.X[2], t.X[3]); in mbedtls_internal_aes_encrypt() 901 AES_FROUND(t.X[0], t.X[1], t.X[2], t.X[3], t.Y[0], t.Y[1], t.Y[2], t.Y[3]); in mbedtls_internal_aes_encrypt() 904 AES_FROUND(t.Y[0], t.Y[1], t.Y[2], t.Y[3], t.X[0], t.X[1], t.X[2], t.X[3]); in mbedtls_internal_aes_encrypt() 906 t.X[0] = *RK++ ^ \ in mbedtls_internal_aes_encrypt() 907 ((uint32_t) FSb[MBEDTLS_BYTE_0(t.Y[0])]) ^ in mbedtls_internal_aes_encrypt() [all …]
|
| H A D | timing.c | 68 struct _hr_time *t = (struct _hr_time *) val; in mbedtls_timing_get_timer() local 71 QueryPerformanceCounter(&t->start); in mbedtls_timing_get_timer() 78 delta = (unsigned long) ((now.QuadPart - t->start.QuadPart) * 1000ul in mbedtls_timing_get_timer() 88 struct _hr_time *t = (struct _hr_time *) val; in mbedtls_timing_get_timer() local 91 gettimeofday(&t->start, NULL); in mbedtls_timing_get_timer() 97 delta = (now.tv_sec - t->start.tv_sec) * 1000ul in mbedtls_timing_get_timer() 98 + (now.tv_usec - t->start.tv_usec) / 1000; in mbedtls_timing_get_timer()
|
| H A D | hkdf.c | 74 unsigned char t[MBEDTLS_MD_MAX_SIZE]; in mbedtls_hkdf_expand() local 111 memset(t, 0, hash_len); in mbedtls_hkdf_expand() 126 ret = mbedtls_md_hmac_update(&ctx, t, t_len); in mbedtls_hkdf_expand() 143 ret = mbedtls_md_hmac_finish(&ctx, t); in mbedtls_hkdf_expand() 149 memcpy(okm + where, t, num_to_copy); in mbedtls_hkdf_expand() 156 mbedtls_platform_zeroize(t, sizeof(t)); in mbedtls_hkdf_expand()
|
| H A D | nist_kw.c | 117 static void calc_a_xor_t(unsigned char A[KW_SEMIBLOCK_LENGTH], uint64_t t) in calc_a_xor_t() argument 120 for (i = 0; i < sizeof(t); i++) { in calc_a_xor_t() 121 A[i] ^= (t >> ((sizeof(t) - 1 - i) * 8)) & 0xff; in calc_a_xor_t() 138 uint64_t t = 0; in mbedtls_nist_kw_wrap() local 218 for (t = 1; t <= s; t++) { in mbedtls_nist_kw_wrap() 229 calc_a_xor_t(A, t); in mbedtls_nist_kw_wrap() 268 uint64_t t = 0; in unwrap() local 283 for (t = s; t >= 1; t--) { in unwrap() 284 calc_a_xor_t(A, t); in unwrap()
|
| /optee_os/core/lib/libtomcrypt/src/stream/sober128/ |
| H A D | sober128_stream.c | 24 ulong32 t; in BYTE2WORD() local 25 LOAD32L(t, b); in BYTE2WORD() 26 return t; in BYTE2WORD() 31 ulong32 t; in XORWORD() local 32 LOAD32L(t, in); in XORWORD() 33 t ^= w; in XORWORD() 34 STORE32L(t, out); in XORWORD() 49 ulong32 t; in cycle() local 53 t = R[0]; in cycle() 57 R[N-1] = t; in cycle() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/ |
| H A D | der_decode_object_identifier.c | 22 unsigned long x, y, t, len; in der_decode_object_identifier() local 59 t = 0; in der_decode_object_identifier() 61 t = (t << 7) | (in[x] & 0x7F); in der_decode_object_identifier() 68 if (t <= 79) { in der_decode_object_identifier() 69 words[0] = t / 40; in der_decode_object_identifier() 70 words[1] = t % 40; in der_decode_object_identifier() 73 words[1] = t - 80; in der_decode_object_identifier() 77 words[y++] = t; in der_decode_object_identifier() 80 t = 0; in der_decode_object_identifier()
|
| H A D | der_encode_object_identifier.c | 22 unsigned long i, x, y, z, t, mask, wordbuf; in der_encode_object_identifier() local 42 t = der_object_identifier_bits(wordbuf); in der_encode_object_identifier() 43 z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); in der_encode_object_identifier() 62 t = wordbuf & 0xFFFFFFFF; in der_encode_object_identifier() 63 if (t) { in der_encode_object_identifier() 66 while (t) { in der_encode_object_identifier() 67 out[x++] = (unsigned char)((t & 0x7F) | mask); in der_encode_object_identifier() 68 t >>= 7; in der_encode_object_identifier() 74 t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t; in der_encode_object_identifier()
|
| H A D | der_length_object_identifier.c | 34 unsigned long y, z, t, wordbuf; in der_length_object_identifier() local 54 t = der_object_identifier_bits(wordbuf); in der_length_object_identifier() 55 z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); in der_length_object_identifier()
|
| /optee_os/core/lib/libtomcrypt/src/misc/base64/ |
| H A D | base64_decode.c | 82 unsigned long t, x, y, z; in s_base64_decode_internal() local 91 for (x = y = z = t = 0; x < inlen; x++) { in s_base64_decode_internal() 117 t = (t<<6)|c; in s_base64_decode_internal() 121 out[z++] = (unsigned char)((t>>16)&255); in s_base64_decode_internal() 122 out[z++] = (unsigned char)((t>>8)&255); in s_base64_decode_internal() 123 out[z++] = (unsigned char)(t&255); in s_base64_decode_internal() 124 y = t = 0; in s_base64_decode_internal() 131 t = t << (6 * (4 - y)); in s_base64_decode_internal() 133 if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); in s_base64_decode_internal() 134 if (y == 3) out[z++] = (unsigned char) ((t >> 8) & 255); in s_base64_decode_internal()
|
| /optee_os/core/lib/libtomcrypt/src/misc/padding/ |
| H A D | padding_pad.c | 17 unsigned char pad, block_length, r, t; in s_padding_padded_length() local 28 t = 0; in s_padding_padded_length() 36 t = 1; in s_padding_padded_length() 41 if (rng_get_bytes(&t, sizeof(t), NULL) != sizeof(t)) { in s_padding_padded_length() 44 t %= (256 / block_length); in s_padding_padded_length() 45 } while (t == 0); in s_padding_padded_length() 52 t = 1; in s_padding_padded_length() 58 pad = (t * block_length) - r; in s_padding_padded_length()
|
| /optee_os/core/tee/ |
| H A D | tee_time_generic.c | 69 TEE_Time t; in tee_time_get_ta_time() local 76 res = tee_time_get_sys_time(&t); in tee_time_get_ta_time() 81 TEE_TIME_ADD(t, *offs, t2); in tee_time_get_ta_time() 84 if (TEE_TIME_LT(t2, t)) in tee_time_get_ta_time() 87 TEE_TIME_SUB(t, *offs, t2); in tee_time_get_ta_time() 90 if (TEE_TIME_LE(t, t2)) in tee_time_get_ta_time() 102 TEE_Time t; in tee_time_set_ta_time() local 108 res = tee_time_get_sys_time(&t); in tee_time_set_ta_time() 112 if (TEE_TIME_LT(t, *time)) { in tee_time_set_ta_time() 113 TEE_TIME_SUB(*time, t, offs); in tee_time_set_ta_time() [all …]
|
| H A D | tee_cryp_utl.c | 177 TEE_Time t; in __plat_rng_init() local 190 res = tee_time_get_sys_time(&t); in __plat_rng_init() 193 memset(&t, 0, sizeof(t)); in __plat_rng_init() 196 res = crypto_rng_init(&t, sizeof(t)); in __plat_rng_init()
|
| /optee_os/core/lib/libtomcrypt/src/pk/ec25519/ |
| H A D | tweetnacl.c | 61 i64 t,i,c=~(b-1); in sel25519() local 63 t= c&(p[i]^q[i]); in sel25519() 64 p[i]^=t; in sel25519() 65 q[i]^=t; in sel25519() 72 gf m,t; in pack25519() local 73 FOR(i,16) t[i]=n[i]; in pack25519() 74 car25519(t); in pack25519() 75 car25519(t); in pack25519() 76 car25519(t); in pack25519() 78 m[0]=t[0]-0xffed; in pack25519() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/modes/xts/ |
| H A D | xts_mult_x.c | 17 unsigned char t, tt; in xts_mult_x() local 19 for (x = t = 0; x < 16; x++) { in xts_mult_x() 21 I[x] = ((I[x] << 1) | t) & 0xFF; in xts_mult_x() 22 t = tt; in xts_mult_x()
|
| /optee_os/core/lib/libtomcrypt/src/hashes/ |
| H A D | md5.c | 38 #define FF(a,b,c,d,M,s,t) \ argument 39 a = (a + F(b,c,d) + M + t); a = ROL(a, s) + b; 41 #define GG(a,b,c,d,M,s,t) \ argument 42 a = (a + G(b,c,d) + M + t); a = ROL(a, s) + b; 44 #define HH(a,b,c,d,M,s,t) \ argument 45 a = (a + H(b,c,d) + M + t); a = ROL(a, s) + b; 47 #define II(a,b,c,d,M,s,t) \ argument 48 a = (a + I(b,c,d) + M + t); a = ROL(a, s) + b; 77 #define FF(a,b,c,d,M,s,t) \ argument 78 a = (a + F(b,c,d) + M + t); a = ROLc(a, s) + b; [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/ia5/ |
| H A D | der_decode_ia5_string.c | 25 int t, err; in der_decode_ia5_string() local 61 t = der_ia5_value_decode(in[x++]); in der_decode_ia5_string() 62 if (t == -1) { in der_decode_ia5_string() 65 out[y] = t; in der_decode_ia5_string()
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/printable_string/ |
| H A D | der_decode_printable_string.c | 25 int t, err; in der_decode_printable_string() local 61 t = der_printable_value_decode(in[x++]); in der_decode_printable_string() 62 if (t == -1) { in der_decode_printable_string() 65 out[y] = t; in der_decode_printable_string()
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/teletex_string/ |
| H A D | der_decode_teletex_string.c | 24 int t, err; in der_decode_teletex_string() local 60 t = der_teletex_value_decode(in[x++]); in der_decode_teletex_string() 61 if (t == -1) { in der_decode_teletex_string() 64 out[y] = t; in der_decode_teletex_string()
|
| /optee_os/lib/libmbedtls/core/ |
| H A D | sm2-pke.c | 122 uint8_t *t = NULL; in sm2_mbedtls_pke_decrypt() local 195 t = calloc(1, C2_len); in sm2_mbedtls_pke_decrypt() 196 if (!t) { in sm2_mbedtls_pke_decrypt() 201 res = sm2_kdf(x2y2, sizeof(x2y2), t, C2_len); in sm2_mbedtls_pke_decrypt() 205 if (is_zero(t, C2_len)) { in sm2_mbedtls_pke_decrypt() 214 dst[i] = src[C1_len + i] ^ t[i]; in sm2_mbedtls_pke_decrypt() 223 eom[i - out_len] = src[C1_len + i] ^ t[i]; in sm2_mbedtls_pke_decrypt() 259 free(t); in sm2_mbedtls_pke_decrypt() 312 uint8_t *t = NULL; in sm2_mbedtls_pke_encrypt() local 383 t = calloc(1, src_len); in sm2_mbedtls_pke_encrypt() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/safer/ |
| H A D | saferp.c | 220 unsigned char t[33]; in saferp_setup() local 242 t[x] = key[x]; in saferp_setup() 245 t[16] = y; in saferp_setup() 249 skey->saferp.K[0][x] = t[x]; in saferp_setup() 256 t[y] = ((t[y]<<3)|(t[y]>>5)) & 255; in saferp_setup() 262 skey->saferp.K[x][y] = (t[z] + safer_bias[x-1][y]) & 255; in saferp_setup() 270 t[x] = key[x]; in saferp_setup() 273 t[24] = y; in saferp_setup() 277 skey->saferp.K[0][x] = t[x]; in saferp_setup() 283 t[y] = ((t[y]<<3)|(t[y]>>5)) & 255; in saferp_setup() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/modes/lrw/ |
| H A D | lrw_start.c | 33 int x, y, z, t; in lrw_start() local 77 t = lrw->PC[x-1][y][15]; in lrw_start() 81 lrw->PC[x][y][0] = gcm_shift_table[t<<1]; in lrw_start() 82 lrw->PC[x][y][1] ^= gcm_shift_table[(t<<1)+1]; in lrw_start()
|