Lines Matching refs:s

38 static void ecc_free_public_key(struct ecc_public_key *s)  in ecc_free_public_key()  argument
40 if (!s) in ecc_free_public_key()
43 crypto_bignum_free(s->x); in ecc_free_public_key()
44 crypto_bignum_free(s->y); in ecc_free_public_key()
185 mbedtls_mpi s; in ecc_sign() local
189 memset(&s, 0, sizeof(s)); in ecc_sign()
195 mbedtls_mpi_init(&s); in ecc_sign()
217 lmd_res = mbedtls_ecdsa_sign(&ecdsa.grp, &r, &s, &ecdsa.d, msg, in ecc_sign()
226 mbedtls_mpi_write_binary(&s, sig + *sig_len - in ecc_sign()
227 mbedtls_mpi_size(&s), in ecc_sign()
228 mbedtls_mpi_size(&s)); in ecc_sign()
236 mbedtls_mpi_free(&s); in ecc_sign()
253 mbedtls_mpi s; in ecc_verify() local
257 memset(&s, 0, sizeof(s)); in ecc_verify()
263 mbedtls_mpi_init(&s); in ecc_verify()
291 mbedtls_mpi_read_binary(&s, sig + sig_len / 2, sig_len / 2); in ecc_verify()
294 &r, &s); in ecc_verify()
301 mbedtls_mpi_free(&s); in ecc_verify()
368 TEE_Result crypto_asym_alloc_ecc_keypair(struct ecc_keypair *s, in crypto_asym_alloc_ecc_keypair() argument
372 memset(s, 0, sizeof(*s)); in crypto_asym_alloc_ecc_keypair()
377 s->ops = &ecc_keypair_ops; in crypto_asym_alloc_ecc_keypair()
383 s->ops = &sm2_dsa_keypair_ops; in crypto_asym_alloc_ecc_keypair()
389 s->ops = &sm2_pke_keypair_ops; in crypto_asym_alloc_ecc_keypair()
395 s->ops = &sm2_kep_keypair_ops; in crypto_asym_alloc_ecc_keypair()
401 s->d = crypto_bignum_allocate(key_size_bits); in crypto_asym_alloc_ecc_keypair()
402 if (!s->d) in crypto_asym_alloc_ecc_keypair()
404 s->x = crypto_bignum_allocate(key_size_bits); in crypto_asym_alloc_ecc_keypair()
405 if (!s->x) in crypto_asym_alloc_ecc_keypair()
407 s->y = crypto_bignum_allocate(key_size_bits); in crypto_asym_alloc_ecc_keypair()
408 if (!s->y) in crypto_asym_alloc_ecc_keypair()
414 crypto_bignum_free(s->d); in crypto_asym_alloc_ecc_keypair()
415 crypto_bignum_free(s->x); in crypto_asym_alloc_ecc_keypair()
439 TEE_Result crypto_asym_alloc_ecc_public_key(struct ecc_public_key *s, in crypto_asym_alloc_ecc_public_key() argument
443 memset(s, 0, sizeof(*s)); in crypto_asym_alloc_ecc_public_key()
448 s->ops = &ecc_public_key_ops; in crypto_asym_alloc_ecc_public_key()
454 s->ops = &sm2_dsa_public_key_ops; in crypto_asym_alloc_ecc_public_key()
460 s->ops = &sm2_pke_public_key_ops; in crypto_asym_alloc_ecc_public_key()
466 s->ops = &sm2_kep_public_key_ops; in crypto_asym_alloc_ecc_public_key()
472 s->x = crypto_bignum_allocate(key_size_bits); in crypto_asym_alloc_ecc_public_key()
473 if (!s->x) in crypto_asym_alloc_ecc_public_key()
475 s->y = crypto_bignum_allocate(key_size_bits); in crypto_asym_alloc_ecc_public_key()
476 if (!s->y) in crypto_asym_alloc_ecc_public_key()
482 crypto_bignum_free(s->x); in crypto_asym_alloc_ecc_public_key()