summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2003-01-27 23:17:20 +0100
committerNiels Möller <nisse@lysator.liu.se>2003-01-27 23:17:20 +0100
commit8ec793c9bf6f870a27e55723372b270ba67fbf67 (patch)
treea9508e405ccf45f241de5c46b7920e7f5b4e4ae7 /testsuite
parent42721f776e9b6a62ace78a424aea8d01e0643598 (diff)
downloadnettle-8ec793c9bf6f870a27e55723372b270ba67fbf67.tar.gz
RSA renaming. Updated all callers.
* rsa-sign.c (rsa_private_key_init, rsa_private_key_clear) (rsa_private_key_prepare): Renamed functions. * rsa.c (rsa_public_key_init, rsa_public_key_clear) (rsa_public_key_prepare): Renamed functions. Rev: src/nettle/ChangeLog:1.167 Rev: src/nettle/examples/rsa-keygen.c:1.8 Rev: src/nettle/examples/rsa-sign.c:1.4 Rev: src/nettle/examples/rsa-verify.c:1.3 Rev: src/nettle/rsa-compat.c:1.7 Rev: src/nettle/sexp2rsa.c:1.10 Rev: src/nettle/testsuite/rsa-keygen-test.c:1.5 Rev: src/nettle/testsuite/rsa-test.c:1.6 Rev: src/nettle/testsuite/rsa2sexp-test.c:1.5 Rev: src/nettle/testsuite/sexp2rsa-test.c:1.6
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/rsa-keygen-test.c8
-rw-r--r--testsuite/rsa-test.c16
-rw-r--r--testsuite/rsa2sexp-test.c11
-rw-r--r--testsuite/sexp2rsa-test.c7
4 files changed, 26 insertions, 16 deletions
diff --git a/testsuite/rsa-keygen-test.c b/testsuite/rsa-keygen-test.c
index 438a6298..51df44b2 100644
--- a/testsuite/rsa-keygen-test.c
+++ b/testsuite/rsa-keygen-test.c
@@ -28,8 +28,8 @@ test_main(void)
mpz_init(expected);
- rsa_init_private_key(&key);
- rsa_init_public_key(&pub);
+ rsa_private_key_init(&key);
+ rsa_public_key_init(&pub);
/* Generate a 1024 bit key with random e */
knuth_lfib_init(&lfib, 13);
@@ -79,8 +79,8 @@ test_main(void)
test_rsa_sha1(&pub, &key, expected);
- rsa_clear_private_key(&key);
- rsa_clear_public_key(&pub);
+ rsa_private_key_clear(&key);
+ rsa_public_key_clear(&pub);
mpz_clear(expected);
SUCCESS();
diff --git a/testsuite/rsa-test.c b/testsuite/rsa-test.c
index a43c43d8..0744720d 100644
--- a/testsuite/rsa-test.c
+++ b/testsuite/rsa-test.c
@@ -12,8 +12,8 @@ test_main(void)
mpz_init(expected);
- rsa_init_private_key(&key);
- rsa_init_public_key(&pub);
+ rsa_private_key_init(&key);
+ rsa_public_key_init(&pub);
/* 1000-bit key, generated by
*
@@ -59,7 +59,7 @@ test_main(void)
"e545fbb4cf", 16);
mpz_set_str(pub.e, "0db2ad57", 16);
- if (!rsa_prepare_public_key(&pub))
+ if (!rsa_public_key_prepare(&pub))
FAIL();
/* d is not used */
@@ -98,7 +98,7 @@ test_main(void)
"e2df9607cee95fa8" "daec7a389a7d9afc" "8dd21fef9d83805a"
"40d46f49676a2f6b" "2926f70c572c00", 16);
- if (!rsa_prepare_private_key(&key))
+ if (!rsa_private_key_prepare(&key))
FAIL();
if (pub.size != key.size)
@@ -171,7 +171,7 @@ test_main(void)
mpz_set_str(pub.e, "3f1a012d", 16);
- if (!rsa_prepare_public_key(&pub))
+ if (!rsa_public_key_prepare(&pub))
FAIL();
#if 0
@@ -208,7 +208,7 @@ test_main(void)
"05e1831619db2f10" "bb9b6a8fd5c95df2" "eb78f303ea0c0cc8"
"06", 16);
- if (!rsa_prepare_private_key(&key))
+ if (!rsa_private_key_prepare(&key))
FAIL();
if (pub.size != key.size)
@@ -234,8 +234,8 @@ test_main(void)
test_rsa_sha1(&pub, &key, expected);
- rsa_clear_private_key(&key);
- rsa_clear_public_key(&pub);
+ rsa_private_key_clear(&key);
+ rsa_public_key_clear(&pub);
mpz_clear(expected);
SUCCESS();
diff --git a/testsuite/rsa2sexp-test.c b/testsuite/rsa2sexp-test.c
index 2220fa0b..3c0d8342 100644
--- a/testsuite/rsa2sexp-test.c
+++ b/testsuite/rsa2sexp-test.c
@@ -11,8 +11,8 @@ test_main(void)
struct nettle_buffer buffer;
- rsa_init_public_key(&pub);
- rsa_init_private_key(&priv);
+ rsa_public_key_init(&pub);
+ rsa_private_key_init(&priv);
mpz_set_str(pub.n,
"085c3408989acae4faec3cbbad91c90d34c1d259cd74121a"
@@ -20,6 +20,8 @@ test_main(void)
"cc8b5e9661189b86a7b22239907c25", 16);
mpz_set_str(pub.e, "36ad4b1d", 16);
+ ASSERT(rsa_public_key_prepare(&pub));
+
mpz_set_str(priv.d,
"06ee6d4ff3c239e408150daf8117abfa36a40ad4455d9059"
"a86d52f33a2de07418a0a699594588c64810248c9412d554"
@@ -45,6 +47,8 @@ test_main(void)
"f8a458ea73a018dc6fa56863e3bc6de405f364f77dee6f09"
"62679ea1a8282e", 16);
+ ASSERT(rsa_private_key_prepare(&priv));
+
nettle_buffer_init(&buffer);
ASSERT(rsa_keypair_to_sexp(&buffer, &pub, &priv));
@@ -96,6 +100,9 @@ test_main(void)
"77113a6cdafe79dd7d5f2ecc8b5e9661"
"189b86a7b22239907c252928313a6534"
"3a36ad4b1d292929"));
+
+ rsa_public_key_clear(&pub);
+ rsa_private_key_clear(&priv);
SUCCESS();
diff --git a/testsuite/sexp2rsa-test.c b/testsuite/sexp2rsa-test.c
index 8185c5a8..2e2c53b2 100644
--- a/testsuite/sexp2rsa-test.c
+++ b/testsuite/sexp2rsa-test.c
@@ -7,8 +7,8 @@ test_main(void)
struct rsa_public_key pub;
struct rsa_private_key priv;
- rsa_init_public_key(&pub);
- rsa_init_private_key(&priv);
+ rsa_public_key_init(&pub);
+ rsa_private_key_init(&priv);
ASSERT(rsa_keypair_from_sexp
(&pub, &priv, 0,
@@ -38,6 +38,9 @@ test_main(void)
"9ea1a8282e292929")));
test_rsa_key(&pub, &priv);
+
+ rsa_public_key_clear(&pub);
+ rsa_private_key_clear(&priv);
SUCCESS();