diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-11-25 21:25:08 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-11-25 21:25:08 +0100 |
commit | 4daca969f538c54cfeb9b17fe517dfbed652b3c8 (patch) | |
tree | 2cfa46ec94785e731bb17f2b75c8ab3083773d7e | |
parent | ade5dd2baceb451592f785cfb9108dab8683bdd6 (diff) | |
download | nettle-4daca969f538c54cfeb9b17fe517dfbed652b3c8.tar.gz |
Rename, _dsa_sign --> dsa_sign, _dsa_verify --> dsa_verify.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | dsa-sha1-sign.c | 8 | ||||
-rw-r--r-- | dsa-sha1-verify.c | 4 | ||||
-rw-r--r-- | dsa-sha256-sign.c | 8 | ||||
-rw-r--r-- | dsa-sha256-verify.c | 4 | ||||
-rw-r--r-- | dsa-sign.c | 12 | ||||
-rw-r--r-- | dsa-verify.c | 8 | ||||
-rw-r--r-- | dsa.h | 34 |
8 files changed, 45 insertions, 38 deletions
@@ -1,3 +1,8 @@ +2013-11-25 Niels Möller <nisse@lysator.liu.se> + + * dsa-verify.c (dsa_verify): Renamed, from _dsa_verify. + * dsa-sign.c (dsa_sign): Renamed, from _dsa_sign. + 2013-11-24 Niels Möller <nisse@lysator.liu.se> * testsuite/dsa-keygen-test.c (test_main): Test generating a diff --git a/dsa-sha1-sign.c b/dsa-sha1-sign.c index 1e79cefb..db820576 100644 --- a/dsa-sha1-sign.c +++ b/dsa-sha1-sign.c @@ -36,8 +36,8 @@ dsa_sha1_sign_digest(const struct dsa_public_key *pub, const uint8_t *digest, struct dsa_signature *signature) { - return _dsa_sign(pub, key, random_ctx, random, - SHA1_DIGEST_SIZE, digest, signature); + return dsa_sign(pub, key, random_ctx, random, + SHA1_DIGEST_SIZE, digest, signature); } @@ -51,6 +51,6 @@ dsa_sha1_sign(const struct dsa_public_key *pub, uint8_t digest[SHA1_DIGEST_SIZE]; sha1_digest(hash, sizeof(digest), digest); - return _dsa_sign(pub, key, random_ctx, random, - sizeof(digest), digest, signature); + return dsa_sign(pub, key, random_ctx, random, + sizeof(digest), digest, signature); } diff --git a/dsa-sha1-verify.c b/dsa-sha1-verify.c index 883df93d..76de5820 100644 --- a/dsa-sha1-verify.c +++ b/dsa-sha1-verify.c @@ -36,7 +36,7 @@ dsa_sha1_verify_digest(const struct dsa_public_key *key, const uint8_t *digest, const struct dsa_signature *signature) { - return _dsa_verify(key, SHA1_DIGEST_SIZE, digest, signature); + return dsa_verify(key, SHA1_DIGEST_SIZE, digest, signature); } int @@ -47,5 +47,5 @@ dsa_sha1_verify(const struct dsa_public_key *key, uint8_t digest[SHA1_DIGEST_SIZE]; sha1_digest(hash, sizeof(digest), digest); - return _dsa_verify(key, sizeof(digest), digest, signature); + return dsa_verify(key, sizeof(digest), digest, signature); } diff --git a/dsa-sha256-sign.c b/dsa-sha256-sign.c index 57745067..68f66d01 100644 --- a/dsa-sha256-sign.c +++ b/dsa-sha256-sign.c @@ -36,8 +36,8 @@ dsa_sha256_sign_digest(const struct dsa_public_key *pub, const uint8_t *digest, struct dsa_signature *signature) { - return _dsa_sign(pub, key, random_ctx, random, - SHA256_DIGEST_SIZE, digest, signature); + return dsa_sign(pub, key, random_ctx, random, + SHA256_DIGEST_SIZE, digest, signature); } int @@ -50,6 +50,6 @@ dsa_sha256_sign(const struct dsa_public_key *pub, uint8_t digest[SHA256_DIGEST_SIZE]; sha256_digest(hash, sizeof(digest), digest); - return _dsa_sign(pub, key, random_ctx, random, - sizeof(digest), digest, signature); + return dsa_sign(pub, key, random_ctx, random, + sizeof(digest), digest, signature); } diff --git a/dsa-sha256-verify.c b/dsa-sha256-verify.c index 975a4a51..d7d7aff6 100644 --- a/dsa-sha256-verify.c +++ b/dsa-sha256-verify.c @@ -36,7 +36,7 @@ dsa_sha256_verify_digest(const struct dsa_public_key *key, const uint8_t *digest, const struct dsa_signature *signature) { - return _dsa_verify(key, SHA256_DIGEST_SIZE, digest, signature); + return dsa_verify(key, SHA256_DIGEST_SIZE, digest, signature); } int @@ -47,5 +47,5 @@ dsa_sha256_verify(const struct dsa_public_key *key, uint8_t digest[SHA256_DIGEST_SIZE]; sha256_digest(hash, sizeof(digest), digest); - return _dsa_verify(key, sizeof(digest), digest, signature); + return dsa_verify(key, sizeof(digest), digest, signature); } @@ -36,12 +36,12 @@ int -_dsa_sign(const struct dsa_public_key *pub, - const struct dsa_private_key *key, - void *random_ctx, nettle_random_func *random, - size_t digest_size, - const uint8_t *digest, - struct dsa_signature *signature) +dsa_sign(const struct dsa_public_key *pub, + const struct dsa_private_key *key, + void *random_ctx, nettle_random_func *random, + size_t digest_size, + const uint8_t *digest, + struct dsa_signature *signature) { mpz_t k; mpz_t h; diff --git a/dsa-verify.c b/dsa-verify.c index 89232e8f..b6d5a7ae 100644 --- a/dsa-verify.c +++ b/dsa-verify.c @@ -34,10 +34,10 @@ #include "bignum.h" int -_dsa_verify(const struct dsa_public_key *key, - size_t digest_size, - const uint8_t *digest, - const struct dsa_signature *signature) +dsa_verify(const struct dsa_public_key *key, + size_t digest_size, + const uint8_t *digest, + const struct dsa_signature *signature) { mpz_t w; mpz_t tmp; @@ -48,6 +48,8 @@ extern "C" { #define dsa_sha1_verify nettle_dsa_sha1_verify #define dsa_sha256_sign nettle_dsa_sha256_sign #define dsa_sha256_verify nettle_dsa_sha256_verify +#define dsa_sign nettle_dsa_sign +#define dsa_verify nettle_dsa_verify #define dsa_sha1_sign_digest nettle_dsa_sha1_sign_digest #define dsa_sha1_verify_digest nettle_dsa_sha1_verify_digest #define dsa_sha256_sign_digest nettle_dsa_sha256_sign_digest @@ -63,8 +65,6 @@ extern "C" { #define dsa_openssl_private_key_from_der_iterator nettle_dsa_openssl_private_key_from_der_iterator #define dsa_openssl_private_key_from_der nettle_openssl_provate_key_from_der #define _dsa_hash _nettle_dsa_hash -#define _dsa_sign _nettle_dsa_sign -#define _dsa_verify _nettle_dsa_verify #define DSA_SHA1_MIN_P_BITS 512 #define DSA_SHA1_Q_OCTETS 20 @@ -173,6 +173,22 @@ dsa_sha256_verify(const struct dsa_public_key *key, const struct dsa_signature *signature); int +dsa_sign(const struct dsa_public_key *pub, + const struct dsa_private_key *key, + void *random_ctx, nettle_random_func *random, + size_t digest_size, + const uint8_t *digest, + struct dsa_signature *signature); + +int +dsa_verify(const struct dsa_public_key *key, + size_t digest_size, + const uint8_t *digest, + const struct dsa_signature *signature); + +/* Maybe obsolete these functions? One can just as well call dsa_sign + and dsa_verify directly, all that matters is the digest size. */ +int dsa_sha1_sign_digest(const struct dsa_public_key *pub, const struct dsa_private_key *key, void *random_ctx, nettle_random_func *random, @@ -277,20 +293,6 @@ void _dsa_hash (mpz_t h, unsigned bit_size, size_t length, const uint8_t *digest); -int -_dsa_sign(const struct dsa_public_key *pub, - const struct dsa_private_key *key, - void *random_ctx, nettle_random_func *random, - size_t digest_size, - const uint8_t *digest, - struct dsa_signature *signature); - -int -_dsa_verify(const struct dsa_public_key *key, - size_t digest_size, - const uint8_t *digest, - const struct dsa_signature *signature); - #ifdef __cplusplus } #endif |