Lines Matching refs:grp
19 mbedtls_ecp_group grp;
25 mbedtls_ecp_group_init( &grp );
31 TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 );
32 TEST_ASSERT( mbedtls_ecp_gen_keypair( &grp, &d, &Q,
36 TEST_ASSERT( mbedtls_ecdsa_sign( &grp, &r, &s, &d, buf, sizeof( buf ),
39 TEST_ASSERT( mbedtls_ecdsa_verify( &grp, buf, sizeof( buf ), &Q, &r, &s ) == 0 );
42 mbedtls_ecp_group_free( &grp );
51 mbedtls_ecp_group grp;
57 mbedtls_ecp_group_init( &grp );
66 TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 );
67 TEST_ASSERT( mbedtls_ecp_gen_keypair( &grp, &d, &Q,
71 TEST_ASSERT( mbedtls_ecdsa_sign( &grp, &r, &s, &d, buf, sizeof( buf ),
74 TEST_ASSERT( mbedtls_ecdsa_verify( &grp, buf, sizeof( buf ), &Q, &r, &s ) == 0 );
77 mbedtls_ecp_group_free( &grp );
89 mbedtls_ecp_group grp;
94 mbedtls_ecp_group_init( &grp );
100 TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 );
111 if( grp.nbits % 8 != 0 )
113 unsigned char shift = 8 - ( grp.nbits % 8 );
122 TEST_ASSERT( mbedtls_ecdsa_sign( &grp, &r, &s, &d, hash->x, hash->len,
132 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len,
136 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len,
137 &grp.G, &r_check, &s_check ), MBEDTLS_ERR_ECP_VERIFY_FAILED );
143 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
145 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
147 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
153 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
155 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
157 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
161 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
162 &grp.N, &s_check ), MBEDTLS_ERR_ECP_VERIFY_FAILED );
163 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
164 &r_check, &grp.N ), MBEDTLS_ERR_ECP_VERIFY_FAILED );
165 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
166 &grp.N, &grp.N ), MBEDTLS_ERR_ECP_VERIFY_FAILED );
169 TEST_EQUAL( mbedtls_mpi_sub_mpi( &r, &r_check, &grp.N ), 0 );
170 TEST_EQUAL( mbedtls_mpi_sub_mpi( &s, &s_check, &grp.N ), 0 );
172 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
174 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
176 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
180 TEST_EQUAL( mbedtls_mpi_add_mpi( &r, &r_check, &grp.N ), 0 );
181 TEST_EQUAL( mbedtls_mpi_add_mpi( &s, &s_check, &grp.N ), 0 );
183 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
185 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
187 TEST_EQUAL( mbedtls_ecdsa_verify( &grp, hash->x, hash->len, &Q,
192 mbedtls_ecp_group_free( &grp );
204 mbedtls_ecp_group grp;
207 mbedtls_ecp_group_init( &grp );
211 TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 );
217 mbedtls_ecdsa_sign_det_ext( &grp, &r, &s, &d,
227 mbedtls_ecp_group_free( &grp );
368 TEST_ASSERT( mbedtls_ecp_group_load( &ctx.grp, id ) == 0 );
369 TEST_ASSERT( mbedtls_ecp_point_read_binary( &ctx.grp, &ctx.Q,
434 TEST_ASSERT( mbedtls_ecp_group_load( &ctx.grp, id ) == 0 );
481 TEST_EQUAL( mbedtls_ecp_group_load( &ctx.grp, grp_id ), 0 );
493 TEST_EQUAL( mbedtls_ecp_check_pubkey( &ctx.grp, &ctx.Q ),
497 int result = mbedtls_ecdsa_verify( &ctx.grp, content->x, content->len, &ctx.Q, &sig_r, &sig_s );