/optee_os/core/lib/libtomcrypt/src/ciphers/ |
A D | kseed.c | 245 F(P[0], P[1], P[2], P[3], K[0], K[1]); in rounds() 246 F(P[2], P[3], P[0], P[1], K[2], K[3]); in rounds() 260 ulong32 P[4]; in kseed_ecb_encrypt() local 261 LOAD32H(P[0], pt); in kseed_ecb_encrypt() 262 LOAD32H(P[1], pt+4); in kseed_ecb_encrypt() 263 LOAD32H(P[2], pt+8); in kseed_ecb_encrypt() 266 STORE32H(P[2], ct); in kseed_ecb_encrypt() 282 ulong32 P[4]; in kseed_ecb_decrypt() local 283 LOAD32H(P[0], ct); in kseed_ecb_decrypt() 284 LOAD32H(P[1], ct+4); in kseed_ecb_decrypt() [all …]
|
/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | md5.c | 154 P( local.A, local.B, local.C, local.D, 0, 7, 0xD76AA478 ); in mbedtls_internal_md5_process() 155 P( local.D, local.A, local.B, local.C, 1, 12, 0xE8C7B756 ); in mbedtls_internal_md5_process() 156 P( local.C, local.D, local.A, local.B, 2, 17, 0x242070DB ); in mbedtls_internal_md5_process() 157 P( local.B, local.C, local.D, local.A, 3, 22, 0xC1BDCEEE ); in mbedtls_internal_md5_process() 158 P( local.A, local.B, local.C, local.D, 4, 7, 0xF57C0FAF ); in mbedtls_internal_md5_process() 159 P( local.D, local.A, local.B, local.C, 5, 12, 0x4787C62A ); in mbedtls_internal_md5_process() 160 P( local.C, local.D, local.A, local.B, 6, 17, 0xA8304613 ); in mbedtls_internal_md5_process() 161 P( local.B, local.C, local.D, local.A, 7, 22, 0xFD469501 ); in mbedtls_internal_md5_process() 162 P( local.A, local.B, local.C, local.D, 8, 7, 0x698098D8 ); in mbedtls_internal_md5_process() 163 P( local.D, local.A, local.B, local.C, 9, 12, 0x8B44F7AF ); in mbedtls_internal_md5_process() [all …]
|
A D | sha1.c | 196 P( local.E, local.A, local.B, local.C, local.D, R(16) ); in mbedtls_internal_sha1_process() 197 P( local.D, local.E, local.A, local.B, local.C, R(17) ); in mbedtls_internal_sha1_process() 198 P( local.C, local.D, local.E, local.A, local.B, R(18) ); in mbedtls_internal_sha1_process() 199 P( local.B, local.C, local.D, local.E, local.A, R(19) ); in mbedtls_internal_sha1_process() 207 P( local.A, local.B, local.C, local.D, local.E, R(20) ); in mbedtls_internal_sha1_process() 208 P( local.E, local.A, local.B, local.C, local.D, R(21) ); in mbedtls_internal_sha1_process() 209 P( local.D, local.E, local.A, local.B, local.C, R(22) ); in mbedtls_internal_sha1_process() 210 P( local.C, local.D, local.E, local.A, local.B, R(23) ); in mbedtls_internal_sha1_process() 211 P( local.B, local.C, local.D, local.E, local.A, R(24) ); in mbedtls_internal_sha1_process() 212 P( local.A, local.B, local.C, local.D, local.E, R(25) ); in mbedtls_internal_sha1_process() [all …]
|
A D | md4.c | 146 #define P(a,b,c,d,x,s) \ in mbedtls_internal_md4_process() macro 154 P( local.A, local.B, local.C, local.D, local.X[ 0], 3 ); in mbedtls_internal_md4_process() 155 P( local.D, local.A, local.B, local.C, local.X[ 1], 7 ); in mbedtls_internal_md4_process() 156 P( local.C, local.D, local.A, local.B, local.X[ 2], 11 ); in mbedtls_internal_md4_process() 157 P( local.B, local.C, local.D, local.A, local.X[ 3], 19 ); in mbedtls_internal_md4_process() 158 P( local.A, local.B, local.C, local.D, local.X[ 4], 3 ); in mbedtls_internal_md4_process() 171 #undef P in mbedtls_internal_md4_process() 175 #define P(a,b,c,d,x,s) \ in mbedtls_internal_md4_process() macro 199 #undef P in mbedtls_internal_md4_process() 203 #define P(a,b,c,d,x,s) \ in mbedtls_internal_md4_process() macro [all …]
|
A D | rsa_internal.c | 64 mbedtls_mpi *P, mbedtls_mpi *Q ) in mbedtls_rsa_deduce_primes() argument 88 if( P == NULL || Q == NULL || P->p != NULL || Q->p != NULL ) in mbedtls_rsa_deduce_primes() 135 if( mbedtls_mpi_cmp_int( P, 1 ) != 0 ) in mbedtls_rsa_deduce_primes() 154 if( mbedtls_mpi_cmp_int( P, 1 ) == 1 && in mbedtls_rsa_deduce_primes() 155 mbedtls_mpi_cmp_mpi( P, N ) == -1 ) in mbedtls_rsa_deduce_primes() 208 if( mbedtls_mpi_cmp_int( P, 1 ) <= 0 || in mbedtls_rsa_deduce_private_exponent() 256 if( P == NULL ) in mbedtls_rsa_validate_crt() 296 if( P == NULL || Q == NULL ) in mbedtls_rsa_validate_crt() 353 if( f_rng != NULL && P != NULL && in mbedtls_rsa_validate_params() 375 if( P != NULL && Q != NULL && N != NULL ) in mbedtls_rsa_validate_params() [all …]
|
A D | dhm.c | 147 ctx->len = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_read_params() 173 if( mbedtls_mpi_cmp_int( &ctx->P, 0 ) == 0 ) in dhm_make_common() 196 &ctx->P , &ctx->RP ) ); in dhm_make_common() 239 n1 = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_make_params() 244 DHM_MPI_EXPORT( &ctx->P , n1 ); in mbedtls_dhm_make_params() 262 const mbedtls_mpi *P, in mbedtls_dhm_set_group() argument 267 DHM_VALIDATE_RET( P != NULL ); in mbedtls_dhm_set_group() 270 if( ( ret = mbedtls_mpi_copy( &ctx->P, P ) ) != 0 || in mbedtls_dhm_set_group() 276 ctx->len = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_set_group() 471 mbedtls_mpi_free( &ctx->P ); in mbedtls_dhm_free() [all …]
|
A D | ecp.c | 1528 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &S, &P->Z, &P->Z ) ); in ecp_double_jac() 1537 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &S, &P->X, &P->X ) ); in ecp_double_jac() 1552 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &T, &P->Y, &P->Y ) ); in ecp_double_jac() 1572 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &U, &P->Y, &P->Z ) ); in ecp_double_jac() 1640 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &T1, &P->Z, &P->Z ) ); in ecp_add_mixed() 2450 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &P->Z, &P->Z, &grp->P ) ); in ecp_normalize_mxz() 2451 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &P->X, &P->X, &P->Z ) ); in ecp_normalize_mxz() 2485 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &P->X, &P->X, &l ) ); in ecp_randomize_mxz() 2486 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &P->Z, &P->Z, &l ) ); in ecp_randomize_mxz() 2532 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mod( grp, &A, &P->X, &P->Z ) ); in ecp_double_add_mxz() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_map.c | 27 int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) in ltc_ecc_map() argument 32 LTC_ARGCHK(P != NULL); in ltc_ecc_map() 36 if (mp_iszero(P->z)) { in ltc_ecc_map() 37 return ltc_ecc_set_point_xyz(0, 0, 1, P); in ltc_ecc_map() 45 if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 48 if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 57 if ((err = mp_mul(P->x, t2, P->x)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 58 if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 59 if ((err = mp_mul(P->y, t1, P->y)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 60 if ((err = mp_montgomery_reduce(P->y, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() [all …]
|
A D | ltc_ecc_is_point_at_infinity.c | 19 int ltc_ecc_is_point_at_infinity(const ecc_point *P, void *modulus, int *retval) in ltc_ecc_is_point_at_infinity() argument 25 if (!mp_iszero(P->z)) { in ltc_ecc_is_point_at_infinity() 31 if (mp_iszero(P->x) && mp_iszero(P->y)) { in ltc_ecc_is_point_at_infinity() 40 if ((err = mp_mulmod(P->y, P->y, modulus, y2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point_at_infinity() 43 if ((err = mp_mulmod(P->x, P->x, modulus, x3)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point_at_infinity() 44 if ((err = mp_mulmod(P->x, x3, modulus, x3)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point_at_infinity()
|
A D | ltc_ecc_projective_add_point.c | 30 int ltc_ecc_projective_add_point(const ecc_point *P, const ecc_point *Q, ecc_point *R, void *ma, vo… in ltc_ecc_projective_add_point() argument 35 LTC_ARGCHK(P != NULL); in ltc_ecc_projective_add_point() 45 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_add_point() 55 err = ltc_ecc_copy_point(P, R); in ltc_ecc_projective_add_point() 59 if ((mp_cmp(P->x, Q->x) == LTC_MP_EQ) && (mp_cmp(P->z, Q->z) == LTC_MP_EQ)) { in ltc_ecc_projective_add_point() 60 if (mp_cmp(P->y, Q->y) == LTC_MP_EQ) { in ltc_ecc_projective_add_point() 63 return ltc_ecc_projective_dbl_point(P, R, ma, modulus, mp); in ltc_ecc_projective_add_point() 66 if (mp_cmp(P->y, t1) == LTC_MP_EQ) { in ltc_ecc_projective_add_point() 73 if ((err = mp_copy(P->x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 74 if ((err = mp_copy(P->y, y)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() [all …]
|
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_test.c | 193 const unsigned char P[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, in ocb3_test() 258 P, sizeof(P), in ocb3_test() 264 compare_testvector(outct, sizeof(P), C, sizeof(C), "OCB3 CT", x)) { in ocb3_test() 276 if ((res != 1) || compare_testvector(outct, sizeof(C), P, sizeof(P), "OCB3", x)) { in ocb3_test() 287 if ((err = ocb3_encrypt(&ocb, P, 32, outct)) != CRYPT_OK) return err; in ocb3_test() 288 if ((err = ocb3_encrypt_last(&ocb, P+32, sizeof(P)-32, outct+32)) != CRYPT_OK) return err; in ocb3_test() 291 …if (compare_testvector(outct, sizeof(P), C, sizeof(C), "OCB3 CT", x)) return CRYPT_FAIL_T… in ocb3_test() 299 …if (compare_testvector(outct, sizeof(C), P, sizeof(P), "OCB3 PT", x)) return CRYPT_FAIL_T… in ocb3_test()
|
/optee_os/core/lib/libtomcrypt/src/modes/xts/ |
A D | xts_decrypt.c | 18 static int _tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char *T, const symmetr… in _tweak_uncrypt() argument 26 …*(LTC_FAST_TYPE_PTR_CAST(&P[x])) = *(LTC_FAST_TYPE_PTR_CAST(&C[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&T[… in _tweak_uncrypt() 30 P[x] = C[x] ^ T[x]; in _tweak_uncrypt() 34 err = cipher_descriptor[xts->cipher]->ecb_decrypt(P, P, &xts->key1); in _tweak_uncrypt() 38 *(LTC_FAST_TYPE_PTR_CAST(&P[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&T[x])); in _tweak_uncrypt() 42 P[x] = P[x] ^ T[x]; in _tweak_uncrypt()
|
/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
A D | rsa_internal.h | 97 mbedtls_mpi *P, mbedtls_mpi *Q ); 120 int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, 146 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, 181 int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, 216 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
|
A D | ecp_internal.h | 170 mbedtls_ecp_point *R, const mbedtls_ecp_point *P, 195 mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); 252 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, 273 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), 289 mbedtls_ecp_point *P );
|
/optee_os/out/arm/export-ta_arm64/include/mbedtls/ |
A D | rsa_internal.h | 97 mbedtls_mpi *P, mbedtls_mpi *Q ); 120 int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, 146 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, 181 int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, 216 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
|
A D | ecp_internal.h | 170 mbedtls_ecp_point *R, const mbedtls_ecp_point *P, 195 mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); 252 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, 273 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), 289 mbedtls_ecp_point *P );
|
A D | ecp.h | 257 mbedtls_mpi P; /*!< The prime modulus of the base field. */ member 662 int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); 712 int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P, 727 int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix, 756 const mbedtls_ecp_point *P, 783 mbedtls_ecp_point *P, 954 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 988 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 1029 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 1074 const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
/optee_os/out/arm/export-ta_arm32/host_include/mbedtls/ |
A D | rsa_internal.h | 97 mbedtls_mpi *P, mbedtls_mpi *Q ); 120 int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, 146 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, 181 int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, 216 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
|
A D | ecp_internal.h | 170 mbedtls_ecp_point *R, const mbedtls_ecp_point *P, 195 mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); 252 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, 273 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), 289 mbedtls_ecp_point *P );
|
A D | ecp.h | 257 mbedtls_mpi P; /*!< The prime modulus of the base field. */ member 662 int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); 712 int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P, 727 int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix, 756 const mbedtls_ecp_point *P, 783 mbedtls_ecp_point *P, 954 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 988 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 1029 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 1074 const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
/optee_os/out/arm/export-ta_arm32/include/mbedtls/ |
A D | rsa_internal.h | 97 mbedtls_mpi *P, mbedtls_mpi *Q ); 120 int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, 146 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, 181 int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, 216 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
|
A D | ecp_internal.h | 170 mbedtls_ecp_point *R, const mbedtls_ecp_point *P, 195 mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); 252 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, 273 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), 289 mbedtls_ecp_point *P );
|
A D | ecp.h | 257 mbedtls_mpi P; /*!< The prime modulus of the base field. */ member 662 int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); 712 int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P, 727 int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix, 756 const mbedtls_ecp_point *P, 783 mbedtls_ecp_point *P, 954 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 988 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 1029 const mbedtls_mpi *m, const mbedtls_ecp_point *P, 1074 const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
/optee_os/out/arm/export-ta_arm64/host_include/mbedtls/ |
A D | rsa_internal.h | 97 mbedtls_mpi *P, mbedtls_mpi *Q ); 120 int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, 146 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, 181 int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, 216 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
|
A D | ecp_internal.h | 170 mbedtls_ecp_point *R, const mbedtls_ecp_point *P, 195 mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); 252 mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, 273 mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), 289 mbedtls_ecp_point *P );
|