Home
last modified time | relevance | path

Searched refs:Q (Results 1 – 25 of 74) sorted by relevance

123

/openthread-3.5.0/third_party/mbedtls/repo/library/
Drsa_internal.c64 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()
141 Q /* temporarily use Q for storing Montgomery in mbedtls_rsa_deduce_primes()
162 MBEDTLS_MPI_CHK( mbedtls_mpi_div_mpi( Q, NULL, N, P ) ); in mbedtls_rsa_deduce_primes()
198 mbedtls_mpi const *Q, in mbedtls_rsa_deduce_private_exponent() argument
209 mbedtls_mpi_cmp_int( Q, 1 ) <= 0 || in mbedtls_rsa_deduce_private_exponent()
220 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &L, Q, 1 ) ); in mbedtls_rsa_deduce_private_exponent()
243 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_validate_crt() argument
276 if( Q == NULL ) in mbedtls_rsa_validate_crt()
282 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &K, Q, 1 ) ); in mbedtls_rsa_validate_crt()
[all …]
Decdh.c73 mbedtls_mpi *d, mbedtls_ecp_point *Q, in ecdh_gen_public_restartable() argument
86 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, Q, d, &grp->G, in ecdh_gen_public_restartable()
96 int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, in mbedtls_ecdh_gen_public() argument
102 ECDH_VALIDATE_RET( Q != NULL ); in mbedtls_ecdh_gen_public()
104 return( ecdh_gen_public_restartable( grp, d, Q, f_rng, p_rng, NULL ) ); in mbedtls_ecdh_gen_public()
114 const mbedtls_ecp_point *Q, const mbedtls_mpi *d, in ecdh_compute_shared_restartable() argument
124 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &P, d, Q, in ecdh_compute_shared_restartable()
145 const mbedtls_ecp_point *Q, const mbedtls_mpi *d, in mbedtls_ecdh_compute_shared() argument
150 ECDH_VALIDATE_RET( Q != NULL ); in mbedtls_ecdh_compute_shared()
153 return( ecdh_compute_shared_restartable( grp, z, Q, d, in mbedtls_ecdh_compute_shared()
[all …]
Drsa.c79 const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_import() argument
87 ( Q != NULL && ( ret = mbedtls_mpi_copy( &ctx->Q, Q ) ) != 0 ) || in mbedtls_rsa_import()
103 unsigned char const *Q, size_t Q_len, in mbedtls_rsa_import_raw() argument
119 if( Q != NULL ) in mbedtls_rsa_import_raw()
120 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &ctx->Q, Q, Q_len ) ); in mbedtls_rsa_import_raw()
175 mbedtls_mpi_cmp_int( &ctx->Q, 0 ) <= 0 || in rsa_check_context()
176 mbedtls_mpi_get_bit( &ctx->Q, 0 ) == 0 ) ) in rsa_check_context()
210 mbedtls_mpi_cmp_int( &ctx->Q, 0 ) <= 0 ) ) in rsa_check_context()
242 have_Q = ( mbedtls_mpi_cmp_int( &ctx->Q, 0 ) != 0 ); in mbedtls_rsa_complete()
280 &ctx->Q ) ) != 0 ) in mbedtls_rsa_complete()
[all …]
Decp.c716 mbedtls_ecp_point_init( &key->Q ); in mbedtls_ecp_keypair_init()
771 mbedtls_ecp_point_free( &key->Q ); in mbedtls_ecp_keypair_free()
777 int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ) in mbedtls_ecp_copy() argument
781 ECP_VALIDATE_RET( Q != NULL ); in mbedtls_ecp_copy()
783 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->X, &Q->X ) ); in mbedtls_ecp_copy()
784 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->Y, &Q->Y ) ); in mbedtls_ecp_copy()
785 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->Z, &Q->Z ) ); in mbedtls_ecp_copy()
832 const mbedtls_ecp_point *Q ) in mbedtls_ecp_point_cmp() argument
835 ECP_VALIDATE_RET( Q != NULL ); in mbedtls_ecp_point_cmp()
837 if( mbedtls_mpi_cmp_mpi( &P->X, &Q->X ) == 0 && in mbedtls_ecp_point_cmp()
[all …]
Dpsa_crypto_ecp.c124 mbedtls_ecp_point_read_binary( &ecp->grp, &ecp->Q, in mbedtls_psa_ecp_load_representation()
132 mbedtls_ecp_check_pubkey( &ecp->grp, &ecp->Q ) ); in mbedtls_psa_ecp_load_representation()
218 if( mbedtls_ecp_is_zero( &ecp->Q ) ) in mbedtls_psa_ecp_export_key()
222 mbedtls_ecp_mul( &ecp->grp, &ecp->Q, &ecp->d, &ecp->grp.G, in mbedtls_psa_ecp_export_key()
230 mbedtls_ecp_point_write_binary( &ecp->grp, &ecp->Q, in mbedtls_psa_ecp_export_key()
450 if( mbedtls_ecp_is_zero( &ecp->Q ) ) in mbedtls_psa_ecdsa_verify_hash()
453 mbedtls_ecp_mul( &ecp->grp, &ecp->Q, &ecp->d, &ecp->grp.G, in mbedtls_psa_ecdsa_verify_hash()
458 &ecp->Q, &r, &s ); in mbedtls_psa_ecdsa_verify_hash()
/openthread-3.5.0/third_party/mbedtls/repo/programs/pkey/
Dmpi_demo.c56 mbedtls_mpi E, P, Q, N, H, D, X, Y, Z; in main() local
58 mbedtls_mpi_init( &E ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); mbedtls_mpi_init( &N ); in main()
63 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &Q, 10, "3203" ) ); in main()
65 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &N, &P, &Q ) ); in main()
73 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " Q = ", &Q, 10, NULL ) ); in main()
77 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &Q, &Q, 1 ) ); in main()
78 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &H, &P, &Q ) ); in main()
99 mbedtls_mpi_free( &E ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); mbedtls_mpi_free( &N ); in main()
Ddh_genprime.c75 mbedtls_mpi G, P, Q; in main() local
84 mbedtls_mpi_init( &G ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
147 if( ( ret = mbedtls_mpi_sub_int( &Q, &P, 1 ) ) != 0 ) in main()
153 if( ( ret = mbedtls_mpi_div_int( &Q, NULL, &Q, 2 ) ) != 0 ) in main()
159 if( ( ret = mbedtls_mpi_is_prime_ext( &Q, 50, mbedtls_ctr_drbg_random, &ctr_drbg ) ) != 0 ) in main()
189 mbedtls_mpi_free( &G ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in main()
Dkey_app.c96 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in main() local
104 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
203 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main()
214 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q: ", &Q, 16, NULL ) ); in main()
225 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(X): ", &ecp->Q.X, 16, NULL ) ); in main()
226 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Y): ", &ecp->Q.Y, 16, NULL ) ); in main()
227 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Z): ", &ecp->Q.Z, 16, NULL ) ); in main()
276 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(X): ", &ecp->Q.X, 16, NULL ) ); in main()
277 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Y): ", &ecp->Q.Y, 16, NULL ) ); in main()
278 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Z): ", &ecp->Q.Z, 16, NULL ) ); in main()
[all …]
Dkey_app_writer.c207 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in main() local
217 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
319 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main()
330 mbedtls_mpi_write_file( "Q: ", &Q, 16, NULL ); in main()
341 mbedtls_mpi_write_file( "Q(X): ", &ecp->Q.X, 16, NULL ); in main()
342 mbedtls_mpi_write_file( "Q(Y): ", &ecp->Q.Y, 16, NULL ); in main()
343 mbedtls_mpi_write_file( "Q(Z): ", &ecp->Q.Z, 16, NULL ); in main()
394 mbedtls_mpi_write_file( "Q(X): ", &ecp->Q.X, 16, NULL ); in main()
395 mbedtls_mpi_write_file( "Q(Y): ", &ecp->Q.Y, 16, NULL ); in main()
396 mbedtls_mpi_write_file( "Q(Z): ", &ecp->Q.Z, 16, NULL ); in main()
[all …]
Drsa_genkey.c72 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in main() local
79 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
108 if( ( ret = mbedtls_rsa_export ( &rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main()
141 ( ret = mbedtls_mpi_write_file( "Q = " , &Q , 16, fpriv ) ) != 0 || in main()
161 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in main()
Drsa_sign.c68 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in main() local
72 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
101 ( ret = mbedtls_mpi_read_file( &Q , 16, f ) ) != 0 || in main()
112 if( ( ret = mbedtls_rsa_import( &rsa, &N, &P, &Q, &D, &E ) ) != 0 ) in main()
180 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in main()
Drsa_decrypt.c69 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in main() local
96 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
124 ( ret = mbedtls_mpi_read_file( &Q , 16, f ) ) != 0 || in main()
136 if( ( ret = mbedtls_rsa_import( &rsa, &N, &P, &Q, &D, &E ) ) != 0 ) in main()
199 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in main()
Dgen_key.c199 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in main() local
211 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in main()
375 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main()
386 mbedtls_mpi_write_file( "Q: ", &Q, 16, NULL ); in main()
399 mbedtls_mpi_write_file( "X_Q: ", &ecp->Q.X, 16, NULL ); in main()
400 mbedtls_mpi_write_file( "Y_Q: ", &ecp->Q.Y, 16, NULL ); in main()
434 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in main()
Decdh_curve25519.c101 ret = mbedtls_ecdh_gen_public( &ctx_cli.grp, &ctx_cli.d, &ctx_cli.Q, in main()
109 ret = mbedtls_mpi_write_binary( &ctx_cli.Q.X, cli_to_srv, 32 ); in main()
131 ret = mbedtls_ecdh_gen_public( &ctx_srv.grp, &ctx_srv.d, &ctx_srv.Q, in main()
139 ret = mbedtls_mpi_write_binary( &ctx_srv.Q.X, srv_to_cli, 32 ); in main()
/openthread-3.5.0/third_party/mbedtls/repo/include/mbedtls/
Drsa_internal.h97 mbedtls_mpi *P, mbedtls_mpi *Q );
121 mbedtls_mpi const *Q,
146 int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
182 const mbedtls_mpi *Q, const mbedtls_mpi *D,
216 int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
Decdh.h88 mbedtls_ecp_point Q; /*!< The public key. */ member
109 mbedtls_ecp_point Q; /*!< The public key. */ member
179 int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q,
218 const mbedtls_ecp_point *Q, const mbedtls_mpi *d,
Decp.h436 mbedtls_ecp_point Q; /*!< our public value */ member
668 int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
719 const mbedtls_ecp_point *Q );
1036 const mbedtls_mpi *n, const mbedtls_ecp_point *Q );
1081 const mbedtls_mpi *n, const mbedtls_ecp_point *Q,
1186 mbedtls_mpi *d, mbedtls_ecp_point *Q,
1214 mbedtls_ecp_point *Q,
Drsa.h122 mbedtls_mpi Q; /*!< The second prime factor. */ member
216 const mbedtls_mpi *P, const mbedtls_mpi *Q,
256 unsigned char const *Q, size_t Q_len,
335 mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q,
388 unsigned char *Q, size_t Q_len,
/openthread-3.5.0/third_party/mbedtls/repo/programs/fuzz/
Dfuzz_privkey.c25 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in LLVMFuzzerTestOneInput() local
28 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in LLVMFuzzerTestOneInput()
33 if ( mbedtls_rsa_export( rsa, &N, &P, &Q, &D, &E ) != 0 ) { in LLVMFuzzerTestOneInput()
40 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in LLVMFuzzerTestOneInput()
Dfuzz_pubkey.c16 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP; in LLVMFuzzerTestOneInput() local
19 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q ); in LLVMFuzzerTestOneInput()
27 if ( mbedtls_rsa_export( rsa, &N, &P, &Q, &D, &E ) != MBEDTLS_ERR_RSA_BAD_INPUT_DATA ) { in LLVMFuzzerTestOneInput()
34 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q ); in LLVMFuzzerTestOneInput()
/openthread-3.5.0/third_party/mbedtls/repo/tests/suites/
Dtest_suite_rsa.data304 RSA Check Private key #3 (No Q)
480 RSA Import (N,P,Q,D,E)
483 RSA Import (N,P,Q,D,E), inconsistent
486 RSA Import (N,P,Q,D,E), successive
489 RSA Import (N,P,Q,D,E), successive, inconsistent
492 RSA Import (-,P,Q,D,E)
495 RSA Import (-,P,Q,D,E), successive
504 RSA Import (N,P,Q,-,E)
507 RSA Import (N,P,Q,-,E), successive
510 RSA Import (-,P,Q,-,E)
[all …]
Dtest_suite_rsa.function524 mbedtls_mpi N, P, Q, E;
528 mbedtls_mpi_init( &Q ); mbedtls_mpi_init( &E );
536 TEST_ASSERT( mbedtls_test_read_mpi( &Q, radix_Q, input_Q ) == 0 );
540 TEST_ASSERT( mbedtls_rsa_import( &ctx, &N, &P, &Q, NULL, &E ) == 0 );
561 mbedtls_mpi_free( &Q ); mbedtls_mpi_free( &E );
609 mbedtls_mpi N, P, Q, E;
614 mbedtls_mpi_init( &Q ); mbedtls_mpi_init( &E );
620 TEST_ASSERT( mbedtls_test_read_mpi( &Q, radix_Q, input_Q ) == 0 );
624 TEST_ASSERT( mbedtls_rsa_import( &ctx, &N, &P, &Q, NULL, &E ) == 0 );
669 mbedtls_mpi_free( &Q ); mbedtls_mpi_free( &E );
[all …]
Dtest_suite_pkcs1_v21.function64 mbedtls_mpi N, P, Q, E;
68 mbedtls_mpi_init( &Q ); mbedtls_mpi_init( &E );
76 TEST_ASSERT( mbedtls_mpi_read_binary( &Q, input_Q->x, input_Q->len ) == 0 );
80 TEST_ASSERT( mbedtls_rsa_import( &ctx, &N, &P, &Q, NULL, &E ) == 0 );
111 mbedtls_mpi_free( &Q ); mbedtls_mpi_free( &E );
127 mbedtls_mpi N, P, Q, E;
135 mbedtls_mpi_init( &Q ); mbedtls_mpi_init( &E );
142 TEST_ASSERT( mbedtls_mpi_read_binary( &Q, input_Q->x, input_Q->len ) == 0 );
146 TEST_ASSERT( mbedtls_rsa_import( &ctx, &N, &P, &Q, NULL, &E ) == 0 );
178 mbedtls_mpi_free( &Q ); mbedtls_mpi_free( &E );
Dtest_suite_ecdsa.function211 mbedtls_ecp_point Q;
217 mbedtls_ecp_point_init( &Q );
223 TEST_ASSERT( mbedtls_ecp_gen_keypair( &grp, &d, &Q,
230 TEST_ASSERT( mbedtls_ecdsa_verify( &grp, buf, sizeof( buf ), &Q, &r, &s ) == 0 );
234 mbedtls_ecp_point_free( &Q );
243 mbedtls_ecp_point Q;
249 mbedtls_ecp_point_init( &Q );
258 TEST_ASSERT( mbedtls_ecp_gen_keypair( &grp, &d, &Q,
265 TEST_ASSERT( mbedtls_ecdsa_verify( &grp, buf, sizeof( buf ), &Q, &r, &s ) == 0 );
269 mbedtls_ecp_point_free( &Q );
[all …]
/openthread-3.5.0/third_party/mbedtls/repo/tests/
DMakefile149 if exist *.c del /Q /F *.c
150 if exist *.exe del /Q /F *.exe
151 if exist *.datax del /Q /F *.datax
152 if exist src/*.o del /Q /F src/*.o
153 if exist src/drivers/*.o del /Q /F src/drivers/*.o
154 if exist src/libmbed* del /Q /F src/libmed*
155 if exist include/test/instrument_record_status.h del /Q /F include/test/instrument_record_status.h

123