diff options
author | Niels Möller <nisse@lysator.liu.se> | 2014-03-26 22:02:19 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2014-03-26 22:02:19 +0100 |
commit | 38edca975bfda4fd3f57651ae14f567bafb5f9ae (patch) | |
tree | da8a0e56724bb652fe9647ecba04ab937a2cf2f5 /dsa.c | |
parent | 5549b2f48b7f5b53249932012fd4bcb031545ab9 (diff) | |
download | nettle-38edca975bfda4fd3f57651ae14f567bafb5f9ae.tar.gz |
New functions dsa_params_init and dsa_params_clear.
Diffstat (limited to 'dsa.c')
-rw-r--r-- | dsa.c | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -32,20 +32,32 @@ #include "bignum.h" void +dsa_params_init (struct dsa_params *params) +{ + mpz_init(params->p); + mpz_init(params->q); + mpz_init(params->g); +} + +void +dsa_params_clear (struct dsa_params *params) +{ + mpz_clear(params->p); + mpz_clear(params->q); + mpz_clear(params->g); +} + +void dsa_public_key_init(struct dsa_public_key *key) { - mpz_init(key->p); - mpz_init(key->q); - mpz_init(key->g); + dsa_params_init ((struct dsa_params *) key); mpz_init(key->y); } void dsa_public_key_clear(struct dsa_public_key *key) { - mpz_clear(key->p); - mpz_clear(key->q); - mpz_clear(key->g); + dsa_params_clear ((struct dsa_params *) key); mpz_clear(key->y); } |