3 #include "knuth-lfib.h"
6 progress(void *ctx UNUSED, int c)
14 struct dsa_public_key pub;
15 struct dsa_private_key key;
16 struct dsa_params *params;
18 struct knuth_lfib_ctx lfib;
20 dsa_private_key_init(&key);
21 dsa_public_key_init(&pub);
23 knuth_lfib_init(&lfib, 13);
25 params = (struct dsa_params *) &pub;
26 ASSERT (dsa_compat_generate_keypair(&pub, &key,
28 (nettle_random_func *) knuth_lfib_random,
29 NULL, verbose ? progress : NULL,
32 test_dsa_key(params, pub.y, key.x, 160);
33 test_dsa160(&pub, &key, NULL);
35 ASSERT (dsa_compat_generate_keypair(&pub, &key,
37 (nettle_random_func *) knuth_lfib_random,
38 NULL, verbose ? progress : NULL,
41 test_dsa_key(params, pub.y, key.x, 256);
42 test_dsa256(&pub, &key, NULL);
44 ASSERT (dsa_compat_generate_keypair(&pub, &key,
46 (nettle_random_func *) knuth_lfib_random,
47 NULL, verbose ? progress : NULL,
50 test_dsa_key(params, pub.y, key.x, 224);
51 test_dsa256(&pub, &key, NULL);
53 /* Test with large q */
54 if (!dsa_generate_params (params,
56 (nettle_random_func *) knuth_lfib_random,
57 NULL, verbose ? progress : NULL,
61 dsa_generate_keypair (params, pub.y, key.x,
63 (nettle_random_func *) knuth_lfib_random);
64 test_dsa_key(params, pub.y, key.x, 768);
65 test_dsa256(&pub, &key, NULL);
67 dsa_public_key_clear(&pub);
68 dsa_private_key_clear(&key);