Lines Matching refs:ecdsa

150 	mbedtls_ecdsa_context ecdsa;  in ecc_generate_keypair()  local
155 memset(&ecdsa, 0, sizeof(ecdsa)); in ecc_generate_keypair()
165 mbedtls_ecdsa_init(&ecdsa); in ecc_generate_keypair()
169 lmd_res = mbedtls_ecdsa_genkey(&ecdsa, gid, mbd_rand, NULL); in ecc_generate_keypair()
175 ecc_clear_precomputed(&ecdsa.grp); in ecc_generate_keypair()
178 if ((mbedtls_mpi_bitlen(&ecdsa.Q.X) > key_size_bits) || in ecc_generate_keypair()
179 (mbedtls_mpi_bitlen(&ecdsa.Q.Y) > key_size_bits) || in ecc_generate_keypair()
180 (mbedtls_mpi_bitlen(&ecdsa.d) > key_size_bits)) { in ecc_generate_keypair()
187 if (mbedtls_mpi_bitlen(&ecdsa.Q.Z) != 1) { in ecc_generate_keypair()
194 crypto_bignum_copy(key->d, (void *)&ecdsa.d); in ecc_generate_keypair()
195 crypto_bignum_copy(key->x, (void *)&ecdsa.Q.X); in ecc_generate_keypair()
196 crypto_bignum_copy(key->y, (void *)&ecdsa.Q.Y); in ecc_generate_keypair()
200 mbedtls_ecdsa_free(&ecdsa); /* Free the temporary key */ in ecc_generate_keypair()
211 mbedtls_ecdsa_context ecdsa; in ecc_sign() local
218 memset(&ecdsa, 0, sizeof(ecdsa)); in ecc_sign()
229 mbedtls_ecdsa_init(&ecdsa); in ecc_sign()
232 lmd_res = mbedtls_ecp_group_load(&ecdsa.grp, gid); in ecc_sign()
238 ecdsa.d = *(mbedtls_mpi *)key->d; in ecc_sign()
257 lmd_res = mbedtls_ecdsa_sign(&ecdsa.grp, &r, &s, &ecdsa.d, msg, in ecc_sign()
278 mbedtls_mpi_init(&ecdsa.d); in ecc_sign()
279 mbedtls_ecdsa_free(&ecdsa); in ecc_sign()
289 mbedtls_ecdsa_context ecdsa; in ecc_verify() local
296 memset(&ecdsa, 0, sizeof(ecdsa)); in ecc_verify()
307 mbedtls_ecdsa_init(&ecdsa); in ecc_verify()
310 lmd_res = mbedtls_ecp_group_load(&ecdsa.grp, gid); in ecc_verify()
316 ecdsa.Q.X = *(mbedtls_mpi *)key->x; in ecc_verify()
317 ecdsa.Q.Y = *(mbedtls_mpi *)key->y; in ecc_verify()
318 mbedtls_mpi_read_binary(&ecdsa.Q.Z, one, sizeof(one)); in ecc_verify()
336 lmd_res = mbedtls_ecdsa_verify(&ecdsa.grp, msg, msg_len, &ecdsa.Q, in ecc_verify()
346 mbedtls_mpi_init(&ecdsa.Q.X); in ecc_verify()
347 mbedtls_mpi_init(&ecdsa.Q.Y); in ecc_verify()
348 mbedtls_ecdsa_free(&ecdsa); in ecc_verify()