summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2021-11-19 22:01:26 +0100
committerNiels Möller <nisse@lysator.liu.se>2021-11-19 22:01:26 +0100
commitd2e4e5311a84f2ca6144378aaa8d3b8a6d76dd5e (patch)
tree212b9b265cda09bedd49d8d8f6f28d8a8a14a6f7 /testsuite
parentdd5662399b985f6f0b127840b2173c73c2855e15 (diff)
downloadnettle-d2e4e5311a84f2ca6144378aaa8d3b8a6d76dd5e.tar.gz
Delete function mpz_limbs_read_n.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ecdsa-sign-test.c9
-rw-r--r--testsuite/gostdsa-sign-test.c11
2 files changed, 15 insertions, 5 deletions
diff --git a/testsuite/ecdsa-sign-test.c b/testsuite/ecdsa-sign-test.c
index ba031fbf..c79493ae 100644
--- a/testsuite/ecdsa-sign-test.c
+++ b/testsuite/ecdsa-sign-test.c
@@ -17,15 +17,18 @@ test_ecdsa (const struct ecc_curve *ecc,
mpz_t k;
mp_limb_t *rp = xalloc_limbs (ecc->p.size);
mp_limb_t *sp = xalloc_limbs (ecc->p.size);
+ mp_limb_t *zp = xalloc_limbs (ecc->p.size);
+ mp_limb_t *kp = xalloc_limbs (ecc->p.size);
mp_limb_t *scratch = xalloc_limbs (ecc_ecdsa_sign_itch (ecc));
dsa_signature_init (&ref);
mpz_init_set_str (z, sz, 16);
mpz_init_set_str (k, sk, 16);
+ mpz_limbs_copy (zp, z, ecc->p.size);
+ mpz_limbs_copy (kp, k, ecc->p.size);
- ecc_ecdsa_sign (ecc, mpz_limbs_read_n (z, ecc->p.size),
- mpz_limbs_read_n (k, ecc->p.size),
+ ecc_ecdsa_sign (ecc, zp, kp,
h->length, h->data, rp, sp, scratch);
mpz_set_str (ref.r, r, 16);
@@ -49,6 +52,8 @@ test_ecdsa (const struct ecc_curve *ecc,
free (rp);
free (sp);
+ free (zp);
+ free (kp);
free (scratch);
dsa_signature_clear (&ref);
diff --git a/testsuite/gostdsa-sign-test.c b/testsuite/gostdsa-sign-test.c
index dc1154b4..119dccea 100644
--- a/testsuite/gostdsa-sign-test.c
+++ b/testsuite/gostdsa-sign-test.c
@@ -18,16 +18,19 @@ test_gostdsa (const struct ecc_curve *ecc,
mpz_t k;
mp_limb_t *rp = xalloc_limbs (ecc->p.size);
mp_limb_t *sp = xalloc_limbs (ecc->p.size);
+ mp_limb_t *zp = xalloc_limbs (ecc->p.size);
+ mp_limb_t *kp = xalloc_limbs (ecc->p.size);
mp_limb_t *scratch = xalloc_limbs (ecc_gostdsa_sign_itch (ecc));
dsa_signature_init (&ref);
mpz_init_set_str (z, sz, 16);
mpz_init_set_str (k, sk, 16);
+ mpz_limbs_copy (zp, z, ecc->p.size);
+ mpz_limbs_copy (kp, k, ecc->p.size);
- ecc_gostdsa_sign (ecc, mpz_limbs_read_n (z, ecc->p.size),
- mpz_limbs_read_n (k, ecc->p.size),
- h->length, h->data, rp, sp, scratch);
+ ecc_gostdsa_sign (ecc, zp, kp,
+ h->length, h->data, rp, sp, scratch);
mpz_set_str (ref.r, r, 16);
mpz_set_str (ref.s, s, 16);
@@ -50,6 +53,8 @@ test_gostdsa (const struct ecc_curve *ecc,
free (rp);
free (sp);
+ free (zp);
+ free (kp);
free (scratch);
dsa_signature_clear (&ref);