| /optee_os/core/lib/libtomcrypt/src/ciphers/aes/ |
| H A D | aes_tab.c | 24 static const ulong32 TE0[256] = { 92 static const ulong32 Te4[256] = { 162 static const ulong32 TD0[256] = { 229 static const ulong32 Td4[256] = { 327 static const ulong32 TE1[256] = { 393 static const ulong32 TE2[256] = { 459 static const ulong32 TE3[256] = { 528 static const ulong32 Te4_0[] = { 563 static const ulong32 Te4_1[] = { 598 static const ulong32 Te4_2[] = { [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/twofish/ |
| H A D | twofish_tab.c | 70 static const ulong32 mds_tab[4][256] = { 211 static const ulong32 rs_tab0[256] = { 245 static const ulong32 rs_tab1[256] = { 279 static const ulong32 rs_tab2[256] = { 313 static const ulong32 rs_tab3[256] = { 347 static const ulong32 rs_tab4[256] = { 381 static const ulong32 rs_tab5[256] = { 415 static const ulong32 rs_tab6[256] = { 449 static const ulong32 rs_tab7[256] = {
|
| H A D | twofish.c | 64 #define sbox(i, x) ((ulong32)SBOX[i][(x)&255]) 86 static ulong32 s_sbox(int i, ulong32 x) in s_sbox() 88 static ulong32 sbox(int i, ulong32 x) in s_sbox() 121 return (ulong32)y; in s_sbox() 125 static ulong32 sbox(int i, ulong32 x) in sbox() 127 ulong32 y; in sbox() 137 static ulong32 gf_mult(ulong32 a, ulong32 b, ulong32 p) in gf_mult() 139 ulong32 result, B[2], P[2]; in gf_mult() 160 static ulong32 mds_column_mult(unsigned char in, int col) in mds_column_mult() 162 ulong32 x01, x5B, xEF; in mds_column_mult() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/headers/ |
| H A D | tomcrypt_macros.h | 17 do { x = ((ulong32)((y)[3] & 255)<<24) | \ 18 ((ulong32)((y)[2] & 255)<<16) | \ 19 ((ulong32)((y)[1] & 255)<<8) | \ 20 ((ulong32)((y)[0] & 255)); } while(0) 39 do { x = ((ulong32)((y)[0] & 255)<<24) | \ 40 ((ulong32)((y)[1] & 255)<<16) | \ 41 ((ulong32)((y)[2] & 255)<<8) | \ 42 ((ulong32)((y)[3] & 255)); } while(0) 62 do { ulong32 ttt = __builtin_bswap32 ((x)); \ 91 do { x = ((ulong32)((y)[0] & 255)<<24) | \ [all …]
|
| H A D | tomcrypt_cipher.h | 11 ulong32 S[4][256]; 12 ulong32 K[18]; 19 ulong32 K[50]; 25 ulong32 K[44]; 38 unsigned char K[(60 + 60 + 4) * sizeof(ulong32)]; 39 ulong32 *eK; 40 ulong32 *dK; 47 ulong32 K[32], dK[32]; 53 ulong32 KLi1[8], KLi2[8], 68 ulong32 S[4][256], K[40]; [all …]
|
| H A D | tomcrypt_hash.h | 28 ulong32 state[8], curlen; 36 ulong32 state[5], curlen; 44 ulong32 state[4], curlen; 52 ulong32 state[4], curlen; 76 ulong32 curlen, state[4]; 84 ulong32 curlen, state[5]; 92 ulong32 curlen, state[8]; 100 ulong32 curlen, state[10]; 108 ulong32 curlen; 116 ulong32 curlen; [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/ |
| H A D | anubis.c | 37 static const ulong32 T0[256] = { 104 static const ulong32 T1[256] = { 171 static const ulong32 T2[256] = { 238 static const ulong32 T3[256] = { 305 static const ulong32 T4[256] = { 372 static const ulong32 T5[256] = { 442 static const ulong32 rc[] = { 455 static const ulong32 T0[256] = { 522 static const ulong32 T1[256] = { 589 static const ulong32 T2[256] = { [all …]
|
| H A D | multi2.c | 12 static void s_pi1(ulong32 *p) in s_pi1() 17 static void s_pi2(ulong32 *p, const ulong32 *k) in s_pi2() 19 ulong32 t; in s_pi2() 26 static void s_pi3(ulong32 *p, const ulong32 *k) in s_pi3() 28 ulong32 t; in s_pi3() 38 static void s_pi4(ulong32 *p, const ulong32 *k) in s_pi4() 40 ulong32 t; in s_pi4() 46 static void s_setup(const ulong32 *dk, const ulong32 *k, ulong32 *uk) in s_setup() 49 ulong32 p[2]; in s_setup() 74 static void s_encrypt(ulong32 *p, int N, const ulong32 *uk) in s_encrypt() [all …]
|
| H A D | camellia.c | 26 static const ulong32 SP1110[] = { 61 static const ulong32 SP0222[] = { 96 static const ulong32 SP3033[] = { 131 static const ulong32 SP4404[] = { 177 ulong32 D, U; in F() 436 ulong32 a, b; in camellia_ecb_encrypt() 451 a = (ulong32)(L >> 32); in camellia_ecb_encrypt() 452 b = (ulong32)(L & 0xFFFFFFFFUL); in camellia_ecb_encrypt() 453 b ^= ROL((a & (ulong32)(skey->camellia.kl[0] >> 32)), 1); in camellia_ecb_encrypt() 458 a = (ulong32)(R >> 32); in camellia_ecb_encrypt() [all …]
|
| H A D | blowfish.c | 25 static const ulong32 ORIG_P[16 + 2] = { 33 static const ulong32 ORIG_S[4][256] = { 298 static void s_blowfish_encipher(ulong32 *L, ulong32 *R, const symmetric_key *skey) in s_blowfish_encipher() 302 ulong32 l, r; in s_blowfish_encipher() 304 const ulong32 *S1, *S2, *S3, *S4; in s_blowfish_encipher() 331 void blowfish_enc(ulong32 *data, unsigned long blocks, const symmetric_key *skey) in blowfish_enc() 334 ulong32 *d = data; in blowfish_enc() 342 static ulong32 s_blowfish_stream2word(const unsigned char *d, int dlen, int *cur) in s_blowfish_stream2word() 346 ulong32 ret = 0; in s_blowfish_stream2word() 349 ret = (ret << 8) | ((ulong32)d[y++] & 255); in s_blowfish_stream2word() [all …]
|
| H A D | kseed.c | 27 static const ulong32 SS0[256] = { 62 static const ulong32 SS1[256] = { 97 static const ulong32 SS2[256] = { 132 static const ulong32 SS3[256] = { 167 static const ulong32 KCi[16] = { 197 ulong32 tmp, k1, k2, k3, k4; in kseed_setup() 233 static void rounds(ulong32 *P, const ulong32 *K) in rounds() 235 ulong32 T, T2; in rounds() 253 ulong32 P[4]; in kseed_ecb_encrypt() 275 ulong32 P[4]; in kseed_ecb_decrypt()
|
| H A D | cast5.c | 25 static const ulong32 S1[256] = { 70 static const ulong32 S2[256] = { 115 static const ulong32 S3[256] = { 160 static const ulong32 S4[256] = { 205 static const ulong32 S5[256] = { 250 static const ulong32 S6[256] = { 295 static const ulong32 S7[256] = { 340 static const ulong32 S8[256] = { 406 ulong32 x[4], z[4]; in s_cast5_setup() 489 burn_stack(sizeof(ulong32)*8 + 16 + sizeof(int)*2); in cast5_setup() [all …]
|
| H A D | rc5.c | 27 static const ulong32 stab[50] = { 51 ulong32 L[64], *S, A, B, i, j, v, s, t, l; in s_rc5_setup() 74 for (A = i = j = 0; i < (ulong32)keylen; ) { in s_rc5_setup() 75 A = (A << 8) | ((ulong32)(key[i++] & 255)); in s_rc5_setup() 83 A <<= (ulong32)((8 * (4 - (keylen&3)))); in s_rc5_setup() 88 t = (ulong32)(2 * (num_rounds + 1)); in s_rc5_setup() 108 burn_stack(sizeof(ulong32) * 122 + sizeof(int)); in rc5_setup() 126 ulong32 A, B; in s_rc5_ecb_encrypt() 127 const ulong32 *K; in s_rc5_ecb_encrypt() 168 burn_stack(sizeof(ulong32) * 2 + sizeof(int)); in rc5_ecb_encrypt() [all …]
|
| H A D | rc6.c | 26 static const ulong32 stab[44] = { 48 ulong32 L[64], S[50], A, B, i, j, v, s, l; in s_rc6_setup() 64 for (A = i = j = 0; i < (ulong32)keylen; ) { in s_rc6_setup() 65 A = (A << 8) | ((ulong32)(key[i++] & 255)); in s_rc6_setup() 103 burn_stack(sizeof(ulong32) * 122); in rc6_setup() 120 ulong32 a,b,c,d,t,u; in s_rc6_ecb_encrypt() 121 const ulong32 *K; in s_rc6_ecb_encrypt() 158 burn_stack(sizeof(ulong32) * 6 + sizeof(int)); in rc6_ecb_encrypt() 175 ulong32 a,b,c,d,t,u; in s_rc6_ecb_decrypt() 176 const ulong32 *K; in s_rc6_ecb_decrypt() [all …]
|
| H A D | kasumi.c | 93 static ulong32 FO( ulong32 in, int round_no, const symmetric_key *key) in FO() 114 return (((ulong32)right)<<16)+left; in FO() 117 static ulong32 FL( ulong32 in, int round_no, const symmetric_key *key ) in FL() 130 return (((ulong32)l)<<16) + r; in FL() 135 ulong32 left, right, temp; in kasumi_ecb_encrypt() 162 ulong32 left, right, temp; in kasumi_ecb_decrypt()
|
| H A D | des.c | 43 static const ulong32 bytebit[8] = 48 static const ulong32 bigbyte[24] = 82 static const ulong32 SP1[64] = 102 static const ulong32 SP2[64] = 122 static const ulong32 SP3[64] = 142 static const ulong32 SP4[64] = 162 static const ulong32 SP5[64] = 182 static const ulong32 SP6[64] = 202 static const ulong32 SP7[64] = 222 static const ulong32 SP8[64] = [all …]
|
| /optee_os/core/lib/libtomcrypt/src/stream/rabbit/ |
| H A D | rabbit.c | 64 static LTC_INLINE ulong32 ss_rabbit_g_func(ulong32 x); 72 static LTC_INLINE ulong32 ss_rabbit_g_func(ulong32 x) in ss_rabbit_g_func() 74 ulong32 a, b, h, l; in ss_rabbit_g_func() 81 h = ((((ulong32)(a*a)>>17) + (ulong32)(a*b))>>15) + b*b; in ss_rabbit_g_func() 85 return (ulong32)(h^l); in ss_rabbit_g_func() 93 ulong32 g[8], c_old[8], i; in ss_rabbit_next_state() 101 p_instance->c[0] = (ulong32)(p_instance->c[0] + 0x4D34D34D + p_instance->carry); in ss_rabbit_next_state() 102 p_instance->c[1] = (ulong32)(p_instance->c[1] + 0xD34D34D3 + (p_instance->c[0] < c_old[0])); in ss_rabbit_next_state() 103 p_instance->c[2] = (ulong32)(p_instance->c[2] + 0x34D34D34 + (p_instance->c[1] < c_old[1])); in ss_rabbit_next_state() 104 p_instance->c[3] = (ulong32)(p_instance->c[3] + 0x4D34D34D + (p_instance->c[2] < c_old[2])); in ss_rabbit_next_state() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/mac/poly1305/ |
| H A D | poly1305.c | 17 ulong32 r0,r1,r2,r3,r4; in s_poly1305_block() 18 ulong32 s1,s2,s3,s4; in s_poly1305_block() 19 ulong32 h0,h1,h2,h3,h4; in s_poly1305_block() 20 ulong32 tmp; in s_poly1305_block() 22 ulong32 c; in s_poly1305_block() 57 c = (ulong32)(d0 >> 26); h0 = (ulong32)d0 & 0x3ffffff; in s_poly1305_block() 58 d1 += c; c = (ulong32)(d1 >> 26); h1 = (ulong32)d1 & 0x3ffffff; in s_poly1305_block() 59 d2 += c; c = (ulong32)(d2 >> 26); h2 = (ulong32)d2 & 0x3ffffff; in s_poly1305_block() 60 d3 += c; c = (ulong32)(d3 >> 26); h3 = (ulong32)d3 & 0x3ffffff; in s_poly1305_block() 61 d4 += c; c = (ulong32)(d4 >> 26); h4 = (ulong32)d4 & 0x3ffffff; in s_poly1305_block() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/stream/sober128/ |
| H A D | sober128_stream.c | 22 static ulong32 BYTE2WORD(const unsigned char *b) in BYTE2WORD() 24 ulong32 t; in BYTE2WORD() 29 static void XORWORD(ulong32 w, const unsigned char *in, unsigned char *out) in XORWORD() 31 ulong32 t; in XORWORD() 47 static void cycle(ulong32 *R) in cycle() 49 ulong32 t; in cycle() 72 static ulong32 nltap(const sober128_state *st) in nltap() 74 ulong32 t; in nltap() 104 ulong32 newkonst; in s128_genkonst() 125 ulong32 t; in s128_diffuse() [all …]
|
| H A D | sober128tab.c | 14 static const ulong32 Multab[256] = { 99 static const ulong32 Sbox[256] = {
|
| /optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/ |
| H A D | sosemanuk.c | 36 #define T32(x) ((x) & (ulong32)0xFFFFFFFF) 207 ulong32 r0, r1, r2, r3, r4; \ in sosemanuk_setup() 229 ulong32 tt = (wi) ^ (wi5) ^ (wi3) \ in sosemanuk_setup() 230 ^ (wi1) ^ (0x9E3779B9 ^ (ulong32)(cc)); \ in sosemanuk_setup() 249 ulong32 w0, w1, w2, w3, w4, w5, w6, w7; in sosemanuk_setup() 368 ulong32 r0, r1, r2, r3, r4; in sosemanuk_setiv() 440 static const ulong32 mul_a[] = { 510 static const ulong32 mul_ia[] = { 609 ulong32 tt, or1; \ in s_sosemanuk_internal() 659 ulong32 s00 = st->s00; in s_sosemanuk_internal() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/misc/ |
| H A D | crc32.c | 13 static const ulong32 CRC32_NEGL = 0xffffffffUL; 26 static const ulong32 crc32_m_tab[] = 145 ulong32 crc; in crc32_update() 161 ulong32 crc; in crc32_finish()
|
| /optee_os/core/lib/libtomcrypt/src/misc/ssh/ |
| H A D | ssh_encode_sequence_multi.c | 24 ulong32 size; in ssh_encode_sequence_multi() 29 ulong32 u32data; in ssh_encode_sequence_multi() 46 LTC_UNUSED_PARAM( va_arg(args, ulong32) ); in ssh_encode_sequence_multi() 104 u32data = va_arg(args, ulong32); in ssh_encode_sequence_multi()
|
| /optee_os/core/lib/libtomcrypt/src/stream/chacha/ |
| H A D | chacha_ivctr64.c | 28 st->input[12] = (ulong32)(counter & 0xFFFFFFFF); in chacha_ivctr64() 29 st->input[13] = (ulong32)(counter >> 32); in chacha_ivctr64()
|
| /optee_os/core/lib/libtomcrypt/src/stream/salsa20/ |
| H A D | salsa20_ivctr64.c | 31 st->input[8] = (ulong32)(counter & 0xFFFFFFFF); in salsa20_ivctr64() 32 st->input[9] = (ulong32)(counter >> 32); in salsa20_ivctr64()
|