| /optee_os/core/arch/arm/crypto/ |
| H A D | sha3_armv8a_ce_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 7 /* Core SHA-3 transform using v8 Crypto Extensions */ 12 .irp b,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,\ 14 .set .Lv\b\().2d, \b 15 .set .Lv\b\().16b, \b 48 ld1 { v0.1d- v3.1d}, [x0] 49 ld1 { v4.1d- v7.1d}, [x8], #32 50 ld1 { v8.1d-v11.1d}, [x8], #32 51 ld1 {v12.1d-v15.1d}, [x8], #32 52 ld1 {v16.1d-v19.1d}, [x8], #32 [all …]
|
| H A D | sm4_armv8a_ce_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 8 * Cryptographic Extension for ARMv8.2-A. 10 * The CE implementation refers to Linux kernel (sm4-ce-core.S contributed 16 .arch armv8.2-a+crypto+sm4 40 /* round keys: v0-v7 */ 50 /* plain blocks: v8-v15 */ 72 stp x15, x16, [sp, #-0x10]! 73 stp x17, x18, [sp, #-0x10]! 74 stp x19, x20, [sp, #-0x10]! 75 stp x21, x22, [sp, #-0x10]! [all …]
|
| H A D | sm4_armv8a_aese_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 8 * optional Cryptographic Extension for ARMv8-A. 10 * The NEON implementation refers to Linux kernel (sm4-neon-core.S contributed 21 .arch armv8-a+crypto 49 /* round keys: v0-v7 */ 59 /* plain blocks: v8-v15 */ 93 stp x15, x16, [sp, #-0x10]! 94 stp x17, x18, [sp, #-0x10]! 95 stp x19, x20, [sp, #-0x10]! 96 stp x21, x22, [sp, #-0x10]! [all …]
|
| H A D | ghash-ce-core_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 4 * Copyright (C) 2014 - 2017 Linaro Ltd. <ard.biesheuvel@linaro.org> 14 * Only increase the lowest quarter, that is, 32-bits of the counter. If 67 .arch armv8-a+crypto 78 ext t3.8b, \ad\().8b, \ad\().8b, #1 // A1 79 ext t5.8b, \ad\().8b, \ad\().8b, #2 // A2 80 ext t7.8b, \ad\().8b, \ad\().8b, #3 // A3 86 tbl t3.16b, {\ad\().16b}, perm1.16b // A1 87 tbl t5.16b, {\ad\().16b}, perm2.16b // A2 88 tbl t7.16b, {\ad\().16b}, perm3.16b // A3 [all …]
|
| H A D | aes_modes_armv8a_ce_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 6 * - AES cipher for ARMv8 with Crypto Extensions 7 * - Chaining mode wrappers for AES 12 .arch armv8-a+crypto 19 ld1 {v17.16b-v18.16b}, [\rk], #32 20 1111: ld1 {v19.16b-v20.16b}, [\rk], #32 21 2222: ld1 {v21.16b-v24.16b}, [\rk], #64 22 ld1 {v25.16b-v28.16b}, [\rk], #64 23 ld1 {v29.16b-v31.16b}, [\rk] 42 aes\de \i0\().16b, \k\().16b [all …]
|
| H A D | sm3_armv8a_ce_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 12 .irp b, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 13 .set .Lv\b\().4s, \b 54 ext \s4\().16b, \s1\().16b, \s2\().16b, #12 55 ext v6.16b, \s0\().16b, \s1\().16b, #12 56 ext v7.16b, \s2\().16b, \s3\().16b, #8 60 eor v10.16b, \s0\().16b, \s1\().16b 78 ld1 {v8.4s-v9.4s}, [x0] 81 ext v8.16b, v8.16b, v8.16b, #8 82 ext v9.16b, v9.16b, v9.16b, #8 [all …]
|
| H A D | sha512_armv8a_ce_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 7 /* Core SHA-384/SHA-512 transform using v8 Crypto Extensions */ 12 .irp b,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 13 .set .Lq\b, \b 14 .set .Lv\b\().2d, \b 34 * The SHA-512 round constants 86 ext v6.16b, v\i2\().16b, v\i3\().16b, #8 87 ext v5.16b, v5.16b, v5.16b, #8 88 ext v7.16b, v\i1\().16b, v\i2\().16b, #8 91 ext v5.16b, v\in3\().16b, v\in4\().16b, #8 [all …]
|
| H A D | sha256_armv8a_ce_a64.S | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 3 * Copyright (c) 2015-2020, Linaro Limited 7 /* Core SHA-224/SHA-256 transform using v8 Crypto Extensions */ 11 .arch armv8-a+crypto 29 mov dg2v.16b, dg0v.16b 57 ld1 { v0.4s- v3.4s}, [x8], #64 58 ld1 { v4.4s- v7.4s}, [x8], #64 59 ld1 { v8.4s-v11.4s}, [x8], #64 60 ld1 {v12.4s-v15.4s}, [x8] 68 0: ld1 {v16.16b-v19.16b}, [x1], #64 [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/safer/ |
| H A D | saferp.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 29 /* ROUND(b,i) 37 * array of 16 bytes b[0..15] which is the block of data 40 #define ROUND(b, i) do { \ argument 41 b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \ 42 b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \ 43 b[2] = safer_lbox[(b[2] + skey->saferp.K[i][2]) & 255] ^ skey->saferp.K[i+1][2]; \ 44 b[3] = (safer_ebox[(b[3] ^ skey->saferp.K[i][3]) & 255] + skey->saferp.K[i+1][3]) & 255; \ 45 b[4] = (safer_ebox[(b[4] ^ skey->saferp.K[i][4]) & 255] + skey->saferp.K[i+1][4]) & 255; \ [all …]
|
| /optee_os/core/lib/libtomcrypt/src/math/ |
| H A D | ltm_desc.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 78 static int neg(void *a, void *b) in neg() argument 81 LTC_ARGCHK(b != NULL); in neg() 82 return mpi_to_ltc_error(mp_neg(a, b)); in neg() 85 static int copy(void *a, void *b) in copy() argument 88 LTC_ARGCHK(b != NULL); in copy() 89 return mpi_to_ltc_error(mp_copy(a, b)); in copy() 92 static int init_copy(void **a, void *b) in init_copy() argument 96 LTC_ARGCHK(b != NULL); in init_copy() [all …]
|
| H A D | gmp_desc.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 31 static int neg(void *a, void *b) in neg() argument 34 LTC_ARGCHK(b != NULL); in neg() 35 mpz_neg(b, a); in neg() 39 static int copy(void *a, void *b) in copy() argument 42 LTC_ARGCHK(b != NULL); in copy() 43 mpz_set(b, a); in copy() 47 static int init_copy(void **a, void *b) in init_copy() argument 52 return copy(b, *a); in init_copy() [all …]
|
| H A D | tfm_desc.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 54 static int neg(void *a, void *b) in neg() argument 57 LTC_ARGCHK(b != NULL); in neg() 58 fp_neg(((fp_int*)a), ((fp_int*)b)); in neg() 62 static int copy(void *a, void *b) in copy() argument 65 LTC_ARGCHK(b != NULL); in copy() 66 fp_copy(a, b); in copy() 70 static int init_copy(void **a, void *b) in init_copy() argument 75 return copy(b, *a); in init_copy() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/hashes/ |
| H A D | md5.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 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; [all …]
|
| H A D | sha1.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 42 ulong32 a,b,c,d,e,W[80],i; in ss_sha1_compress() local 47 /* copy the state into 512-bits into W[0..15] */ in ss_sha1_compress() 53 a = md->sha1.state[0]; in ss_sha1_compress() 54 b = md->sha1.state[1]; in ss_sha1_compress() 55 c = md->sha1.state[2]; in ss_sha1_compress() 56 d = md->sha1.state[3]; in ss_sha1_compress() 57 e = md->sha1.state[4]; in ss_sha1_compress() 61 W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); in ss_sha1_compress() [all …]
|
| H A D | md4.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 54 #define FF(a, b, c, d, x, s) { \ argument 55 (a) += F ((b), (c), (d)) + (x); \ 58 #define GG(a, b, c, d, x, s) { \ argument 59 (a) += G ((b), (c), (d)) + (x) + 0x5a827999UL; \ 62 #define HH(a, b, c, d, x, s) { \ argument 63 (a) += H ((b), (c), (d)) + (x) + 0x6ed9eba1UL; \ 73 ulong32 x[16], a, b, c, d; in ss_md4_compress() local 77 a = md->md4.state[0]; in ss_md4_compress() [all …]
|
| /optee_os/lib/libutils/isoc/arch/arm/ |
| H A D | arm32_aeabi_softfloat.c | 1 // SPDX-License-Identifier: BSD-2-Clause 11 * On ARM32 EABI defines both a soft-float ABI and a hard-float ABI, 12 * hard-float is basically a super set of soft-float. Hard-float requires 13 * all the support routines provided for soft-float, but the compiler may 16 * The AEABI functions uses soft-float calling convention even if the 17 * functions are compiled for hard-float. So where float and double would 69 * From ARM Run-time ABI for ARM Architecture 72 * 4.1.2 The floating-point helper functions 76 * Table 2, Standard aeabi_double_t precision floating-point arithmetic helper 80 aeabi_double_t __aeabi_dadd(aeabi_double_t a, aeabi_double_t b) in __aeabi_dadd() argument [all …]
|
| /optee_os/core/lib/libtomcrypt/ |
| H A D | mpi_desc.c | 1 // SPDX-License-Identifier: BSD-2-Clause 86 static int neg(void *a, void *b) in neg() argument 88 if (mbedtls_mpi_copy(b, a)) in neg() 90 ((mbedtls_mpi *)b)->s *= -1; in neg() 94 static int copy(void *a, void *b) in copy() argument 96 if (mbedtls_mpi_copy(b, a)) in copy() 101 static int init_copy(void **a, void *b) in init_copy() argument 106 return copy(b, *a); in init_copy() 109 /* ---- trivial ---- */ 110 static int set_int(void *a, ltc_mp_digit b) in set_int() argument [all …]
|
| /optee_os/core/lib/libtomcrypt/src/headers/ |
| H A D | tomcrypt_math.h | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 6 #define LTC_MP_LT -1 22 /* Number of rounds of the Miller-Rabin test 38 /* ---- init/deinit functions ---- */ 66 /* ---- data movement ---- */ 82 /* ---- trivial low level functions ---- */ 113 @param b The right side integer 114 @return LTC_MP_LT if a < b, 115 LTC_MP_GT if a > b and [all …]
|
| H A D | tomcrypt_private.h | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 10 #define LTC_STATIC_ASSERT(msg, cond) typedef char ltc_static_assert_##msg[(cond) ? 1 : -1]; 22 /* Poor-man's `uintptr_t` since we can't use stdint.h 23 * c.f. https://github.com/DCIT/perl-CryptX/issues/95#issuecomment-1745280962 */ 31 …IGN_BUF(buf, n) ((void*)((ltc_uintptr)&((unsigned char*)(buf))[n - 1] & (~(CONSTPTR(n) - CONSTPTR(… 125 if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \ 128 if (((md-> state_var .length + inlen * 8) < md-> state_var .length) \ 133 if (md-> state_var .curlen == 0 && inlen >= block_size) { \ 143 md-> state_var .length += blocks * block_size * 8; \ [all …]
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | sha1.c | 2 * FIPS-180-1 compliant SHA-1 implementation 5 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 8 * The SHA-1 standard was published by NIST in 1993. 10 * http://www.itl.nist.gov/fipspubs/fip180-1.htm 48 * SHA-1 context setup 52 ctx->total[0] = 0; in mbedtls_sha1_starts() 53 ctx->total[1] = 0; in mbedtls_sha1_starts() 55 ctx->state[0] = 0x67452301; in mbedtls_sha1_starts() 56 ctx->state[1] = 0xEFCDAB89; in mbedtls_sha1_starts() 57 ctx->state[2] = 0x98BADCFE; in mbedtls_sha1_starts() [all …]
|
| H A D | md5.c | 5 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 52 ctx->total[0] = 0; in mbedtls_md5_starts() 53 ctx->total[1] = 0; in mbedtls_md5_starts() 55 ctx->state[0] = 0x67452301; in mbedtls_md5_starts() 56 ctx->state[1] = 0xEFCDAB89; in mbedtls_md5_starts() 57 ctx->state[2] = 0x98BADCFE; in mbedtls_md5_starts() 58 ctx->state[3] = 0x10325476; in mbedtls_md5_starts() 68 uint32_t X[16], A, B, C, D; in mbedtls_internal_md5_process() member 89 (((x) << (n)) | (((x) & 0xFFFFFFFF) >> (32 - (n)))) in mbedtls_internal_md5_process() 91 #define P(a, b, c, d, k, s, t) \ in mbedtls_internal_md5_process() argument [all …]
|
| H A D | ripemd160.c | 2 * RIPE MD-160 implementation 5 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 9 * The RIPEMD-160 algorithm was designed by RIPE in 1996 11 * http://ehash.iaik.tugraz.at/wiki/RIPEMD-160 49 * RIPEMD-160 context setup 53 ctx->total[0] = 0; in mbedtls_ripemd160_starts() 54 ctx->total[1] = 0; in mbedtls_ripemd160_starts() 56 ctx->state[0] = 0x67452301; in mbedtls_ripemd160_starts() 57 ctx->state[1] = 0xEFCDAB89; in mbedtls_ripemd160_starts() 58 ctx->state[2] = 0x98BADCFE; in mbedtls_ripemd160_starts() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/encauth/gcm/ |
| H A D | gcm_gf_mult.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 58 for (x = 15; x > 0; x--) { in s_gcm_rightshift() 59 a[x] = (a[x]>>1) | ((a[x-1]<<7)&0x80); in s_gcm_rightshift() 64 /* c = b*a */ 72 @param b Second value 73 @param c Destination for a * b 75 void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c) in gcm_gf_mult() argument 83 if (b[x>>3] & mask[x&7]) { in gcm_gf_mult() 106 @param b Second value [all …]
|
| /optee_os/core/kernel/ |
| H A D | tee_misc.c | 1 // SPDX-License-Identifier: BSD-2-Clause 24 return -1; in tee_hs2b_rem_base() 27 *out = in - 48; in tee_hs2b_rem_base() 29 *out = in - 55; in tee_hs2b_rem_base() 34 uint32_t tee_b2hs(uint8_t *b, uint8_t *hs, uint32_t blen, uint32_t hslen) in tee_b2hs() argument 42 hs[i * 2 + 1] = tee_b2hs_add_base(b[i] & 0xf); in tee_b2hs() 43 hs[i * 2] = tee_b2hs_add_base(b[i] >> 4); in tee_b2hs() 50 uint32_t tee_hs2b(uint8_t *hs, uint8_t *b, uint32_t hslen, uint32_t blen) in tee_hs2b() argument 65 b[i] = (hi << 4) + lo; in tee_hs2b() 71 static bool is_valid_conf_and_notnull_size(paddr_t b, paddr_size_t bl, in is_valid_conf_and_notnull_size() argument [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/ |
| H A D | rc5.c | 1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 51 ulong32 L[64], *S, A, B, i, j, v, s, t, l; in s_rc5_setup() local 70 skey->rc5.rounds = num_rounds; in s_rc5_setup() 71 S = skey->rc5.K; in s_rc5_setup() 83 A <<= (ulong32)((8 * (4 - (keylen&3)))); in s_rc5_setup() 94 for (A = B = i = j = v = 0; v < s; v++) { in s_rc5_setup() 95 A = S[i] = ROLc(S[i] + A + B, 3); in s_rc5_setup() 96 B = L[j] = ROL(L[j] + A + B, (A+B)); in s_rc5_setup() 126 ulong32 A, B; in s_rc5_ecb_encrypt() local [all …]
|