/optee_os-3.20.0/lib/libmbedtls/mbedtls/library/ |
A D | ecp_curves.c | 957 p = N->p; in ecp_mod_p192() 1080 N->p[i] = ~(mbedtls_mpi_uint)0 - N->p[i]; in mbedtls_ecp_fix_negative() 1085 ++N->p[i]; in mbedtls_ecp_fix_negative() 1089 N->s = -1; in mbedtls_ecp_fix_negative() 1264 MBEDTLS_MPI_CHK( mbedtls_mpi_add_abs( N, N, &M ) ); in ecp_mod_p521() 1313 MBEDTLS_MPI_CHK( mbedtls_mpi_add_abs( N, N, &M ) ); in ecp_mod_p255() 1367 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( N, N, &M ) ); in ecp_mod_p448() 1374 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( N, N, &Q ) ); in ecp_mod_p448() 1384 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( N, N, &M ) ); in ecp_mod_p448() 1441 MBEDTLS_MPI_CHK( mbedtls_mpi_add_abs( N, N, &M ) ); in ecp_mod_koblitz() [all …]
|
A D | rsa_internal.c | 62 int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, in mbedtls_rsa_deduce_primes() argument 91 if( mbedtls_mpi_cmp_int( N, 0 ) <= 0 || in mbedtls_rsa_deduce_primes() 93 mbedtls_mpi_cmp_mpi( D, N ) >= 0 || in mbedtls_rsa_deduce_primes() 95 mbedtls_mpi_cmp_mpi( E, N ) >= 0 ) in mbedtls_rsa_deduce_primes() 126 if( N->p[0] % 8 == 1 ) in mbedtls_rsa_deduce_primes() 375 if( P != NULL && Q != NULL && N != NULL ) in mbedtls_rsa_validate_params() 378 if( mbedtls_mpi_cmp_int( N, 1 ) <= 0 || in mbedtls_rsa_validate_params() 379 mbedtls_mpi_cmp_mpi( &K, N ) != 0 ) in mbedtls_rsa_validate_params() 390 if( N != NULL && D != NULL && E != NULL ) in mbedtls_rsa_validate_params() 394 mbedtls_mpi_cmp_mpi( D, N ) >= 0 || in mbedtls_rsa_validate_params() [all …]
|
A D | rsa.c | 80 const mbedtls_mpi *N, in mbedtls_rsa_import() argument 87 if( ( N != NULL && ( ret = mbedtls_mpi_copy( &ctx->N, N ) ) != 0 ) || in mbedtls_rsa_import() 96 if( N != NULL ) in mbedtls_rsa_import() 112 if( N != NULL ) in mbedtls_rsa_import_raw() 114 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &ctx->N, N, N_len ) ); in mbedtls_rsa_import_raw() 363 if( N != NULL ) in mbedtls_rsa_export_raw() 364 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &ctx->N, N, N_len ) ); in mbedtls_rsa_export_raw() 410 if( ( N != NULL && ( ret = mbedtls_mpi_copy( N, &ctx->N ) ) != 0 ) || in mbedtls_rsa_export() 707 if( mbedtls_mpi_cmp_mpi( &pub->N, &prv->N ) != 0 || in mbedtls_rsa_check_pub_priv() 2325 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &dst->N, &src->N ) ); in mbedtls_rsa_copy() [all …]
|
A D | bignum.c | 1938 mpi_montg_init( mm, N ); in mbedtls_mpi_montg_init() 1972 n = N->n; in mpi_montmul() 2013 mpi_montmul( A, B, N, mm, T); in mbedtls_mpi_montmul() 2036 mpi_montred( A, N, mm, T ); in mbedtls_mpi_montred() 2088 MPI_VALIDATE_RET( N != NULL ); in mbedtls_mpi_exp_mod() 2090 if( mbedtls_mpi_cmp_int( N, 0 ) <= 0 || ( N->p[0] & 1 ) == 0 ) in mbedtls_mpi_exp_mod() 2103 mpi_montg_init( &mm, N ); in mbedtls_mpi_exp_mod() 2118 j = N->n + 1; in mbedtls_mpi_exp_mod() 2186 mpi_montred( X, N, mm, &T ); in mbedtls_mpi_exp_mod() 2294 mpi_montred( X, N, mm, &T ); in mbedtls_mpi_exp_mod() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/math/ |
A D | rand_bn.c | 10 int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) in rand_bn_bits() argument 15 LTC_ARGCHK(N != NULL); in rand_bn_bits() 35 if ((res = mp_read_unsigned_bin(N, buf, bytes)) != CRYPT_OK) goto cleanup; in rand_bn_bits() 50 int rand_bn_upto(void *N, void *limit, prng_state *prng, int wprng) in rand_bn_upto() argument 54 LTC_ARGCHK(N != NULL); in rand_bn_upto() 59 res = rand_bn_bits(N, bits, prng, wprng); in rand_bn_upto() 61 } while (mp_cmp_d(N, 0) != LTC_MP_GT || mp_cmp(N, limit) != LTC_MP_LT); in rand_bn_upto()
|
A D | rand_prime.c | 14 int rand_prime(void *N, long len, prng_state *prng, int wprng) in rand_prime() argument 19 LTC_ARGCHK(N != NULL); in rand_prime() 57 if ((err = mp_read_unsigned_bin(N, buf, len)) != CRYPT_OK) { in rand_prime() 63 if ((err = mp_prime_is_prime(N, LTC_MILLER_RABIN_REPS, &res)) != CRYPT_OK) { in rand_prime()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/rsa/ |
A D | rsa_exptmod.c | 61 if (mp_cmp(key->N, tmp) == LTC_MP_LT) { in rsa_exptmod() 70 err = mp_rand(rnd, mp_get_digit_count(key->N)); in rsa_exptmod() 76 err = mp_invmod(rnd, key->N, rndi); in rsa_exptmod() 82 err = mp_exptmod( rnd, key->e, key->N, rnd); in rsa_exptmod() 88 err = mp_mulmod( tmp, rnd, key->N, tmp); in rsa_exptmod() 105 …if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto … in rsa_exptmod() 124 err = mp_mulmod( tmp, rndi, key->N, tmp); in rsa_exptmod() 132 …if ((err = mp_exptmod(tmp, key->e, key->N, tmpa)) != CRYPT_OK) { goto… in rsa_exptmod() 139 …if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { got… in rsa_exptmod() 143 x = (unsigned long)mp_unsigned_bin_size(key->N); in rsa_exptmod() [all …]
|
A D | rsa_set.c | 20 int rsa_set_key(const unsigned char *N, unsigned long Nlen, in rsa_set_key() argument 28 LTC_ARGCHK(N != NULL); in rsa_set_key() 34 …if ((err = mp_read_unsigned_bin(key->N , (unsigned char *)N , Nlen)) != CRYPT_OK) { goto LBL_ER… in rsa_set_key()
|
A D | rsa_export.c | 42 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_export() 59 tmplen = (unsigned long)(mp_count_bits(key->N) / 8) * 2 + 8; in rsa_export() 72 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_export()
|
A D | rsa_key.c | 79 …s_mpi_shrink_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL… in rsa_shrink_key() 90 …return mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, LT… in rsa_init() 100 …mp_cleanup_multi(&key->q, &key->p, &key->qP, &key->dP, &key->dQ, &key->N, &key->d, &key->e, LTC_NU… in rsa_free()
|
A D | rsa_sign_hash.c | 63 modulus_bitlen = mp_count_bits((key->N)); in rsa_sign_hash_ex() 66 modulus_bytelen = mp_unsigned_bin_size((key->N)); in rsa_sign_hash_ex() 104 y = mp_unsigned_bin_size(key->N); in rsa_sign_hash_ex()
|
A D | rsa_import.c | 37 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_import_pkcs1() 52 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_import_pkcs1() 117 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_import()
|
A D | rsa_decrypt_key.c | 59 modulus_bitlen = mp_count_bits( (key->N)); in rsa_decrypt_key_ex() 62 modulus_bytelen = mp_unsigned_bin_size( (key->N)); in rsa_decrypt_key_ex()
|
A D | rsa_encrypt_key.c | 61 modulus_bitlen = mp_count_bits( (key->N)); in rsa_encrypt_key_ex() 64 modulus_bytelen = mp_unsigned_bin_size( (key->N)); in rsa_encrypt_key_ex()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_test.c | 179 const unsigned char N[] = { 0xBB,0xAA,0x99,0x88,0x77,0x66,0x55,0x44, in ocb3_test() 249 N, sizeof(N), in ocb3_test() 263 N, sizeof(N), in ocb3_test() 278 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test() 286 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test()
|
/optee_os-3.20.0/lib/libmbedtls/core/ |
A D | sm2-dsa.c | 67 res = mbed_gen_random_upto(&k, &grp.N); in sm2_mbedtls_dsa_sign() 86 mres = mbedtls_mpi_mod_mpi(&r, &r, &grp.N); in sm2_mbedtls_dsa_sign() 96 !mbedtls_mpi_cmp_mpi(&tmp, &grp.N)); in sm2_mbedtls_dsa_sign() 103 mres = mbedtls_mpi_inv_mod(&s, &s, &grp.N); in sm2_mbedtls_dsa_sign() 109 mres = mbedtls_mpi_mod_mpi(&tmp, &tmp, &grp.N); in sm2_mbedtls_dsa_sign() 118 mres = mbedtls_mpi_mod_mpi(&s, &s, &grp.N); in sm2_mbedtls_dsa_sign() 194 mbedtls_mpi_cmp_mpi(&rprime, &grp.N) >= 0) { in sm2_mbedtls_dsa_verify() 202 mbedtls_mpi_cmp_mpi(&sprime, &grp.N) >= 0) { in sm2_mbedtls_dsa_verify() 217 mres = mbedtls_mpi_mod_mpi(&t, &t, &grp.N); in sm2_mbedtls_dsa_verify() 249 mres = mbedtls_mpi_mod_mpi(&R, &R, &grp.N); in sm2_mbedtls_dsa_verify()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/ciphers/ |
A D | multi2.c | 74 static void s_encrypt(ulong32 *p, int N, const ulong32 *uk) in s_encrypt() argument 78 s_pi1(p); if (++n == N) break; in s_encrypt() 79 s_pi2(p, uk+t); if (++n == N) break; in s_encrypt() 80 s_pi3(p, uk+t); if (++n == N) break; in s_encrypt() 81 s_pi4(p, uk+t); if (++n == N) break; in s_encrypt() 86 static void s_decrypt(ulong32 *p, int N, const ulong32 *uk) in s_decrypt() argument 89 for (t = 4*(((N-1)>>2)&1), n = N; ; ) { in s_decrypt() 125 skey->multi2.N = num_rounds; in multi2_setup() 153 s_encrypt(p, skey->multi2.N, skey->multi2.uk); in multi2_ecb_encrypt() 174 s_decrypt(p, skey->multi2.N, skey->multi2.uk); in multi2_ecb_decrypt()
|
A D | anubis.c | 884 int N, R, i, pos, r; in s_anubis_setup() local 902 N = skey->anubis.keyBits >> 5; in s_anubis_setup() 907 skey->anubis.R = R = 8 + N; in s_anubis_setup() 916 for (i = 0, pos = 0; i < N; i++, pos += 4) { in s_anubis_setup() 931 K0 = T4[(kappa[N - 1] >> 24) & 0xff]; in s_anubis_setup() 932 K1 = T4[(kappa[N - 1] >> 16) & 0xff]; in s_anubis_setup() 933 K2 = T4[(kappa[N - 1] >> 8) & 0xff]; in s_anubis_setup() 934 K3 = T4[(kappa[N - 1] ) & 0xff]; in s_anubis_setup() 935 for (i = N - 2; i >= 0; i--) { in s_anubis_setup() 978 for (i = 0; i < N; i++) { in s_anubis_setup() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/sober128/ |
A D | sober128_stream.c | 17 #define N 17 macro 40 #define OFF(zero, i) (((zero)+(i)) % N) 54 for (i = 1; i < N; ++i) { in cycle() 57 R[N-1] = t; in cycle() 84 for (i = 0; i < N; ++i) { in s128_savestate() 95 for (i = 0; i < N; ++i) { in s128_reloadstate() 169 for (i = 2; i < N; ++i) { in sober128_stream_setup() 263 while (inlen >= N*4) { in sober128_stream_crypt() 281 out += 4*N; in sober128_stream_crypt() 282 in += 4*N; in sober128_stream_crypt() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/hkdf/ |
A D | hkdf.c | 37 unsigned char N; in hkdf_expand() local 72 N = 0; in hkdf_expand() 76 T[Tlen - 1] = ++N; in hkdf_expand() 90 XMEMCPY(T, out + hashsize * (N-1), hashsize); in hkdf_expand() 91 if (N == 1) { in hkdf_expand()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/dsa/ |
A D | dsa_generate_pqg.c | 25 unsigned long L, N, n, outbytes, seedbytes, counter, j, i; in s_dsa_make_params() local 71 N = (unsigned long)group_size * 8; in s_dsa_make_params() 77 if (N <= 160) { mr_tests_q = 19; } in s_dsa_make_params() 78 else if (N <= 224) { mr_tests_q = 24; } in s_dsa_make_params() 86 if (N <= 160) { mr_tests_q = 40; } in s_dsa_make_params() 87 else if (N <= 224) { mr_tests_q = 56; } in s_dsa_make_params() 99 if (N > hash_descriptor[hash]->hashsize * 8) { in s_dsa_make_params() 116 if ((err = mp_2expt(t2N1, N-1)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params()
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/include/mbedtls/ |
A D | rsa_internal.h | 95 int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E, 181 int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P,
|
A D | rsa.h | 117 mbedtls_mpi N; /*!< The public modulus. */ member 215 const mbedtls_mpi *N, 254 unsigned char const *N, size_t N_len, 335 mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q, 386 unsigned char *N, size_t N_len,
|
A D | bignum.h | 862 const mbedtls_mpi *E, const mbedtls_mpi *N, 920 const mbedtls_mpi *N, 955 const mbedtls_mpi *N ); 1058 void mbedtls_mpi_montg_init( mbedtls_mpi_uint *mm, const mbedtls_mpi *N ); 1069 const mbedtls_mpi *N, mbedtls_mpi_uint mm, 1079 void mbedtls_mpi_montred( mbedtls_mpi *A, const mbedtls_mpi *N,
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_init.c | 76 len = sizeof(eax->N); in eax_init() 77 if ((err = omac_done(omac, eax->N, &len)) != CRYPT_OK) { in eax_init() 103 …if ((err = ctr_start(cipher, eax->N, key, keylen, 0, CTR_COUNTER_BIG_ENDIAN, &eax->ctr)) != CRYPT_… in eax_init()
|