X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=dsa%2Fdsa.h;h=c882f82f24175e232209533ef1a5002108c6652b;hp=6a894f6c8e0d487b164c6d7efb208efa1e971b5b;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=c9c11514d91b8c19f77d65ac051b998bd99048b0 diff --git a/dsa/dsa.h b/dsa/dsa.h index 6a894f6..c882f82 100644 --- a/dsa/dsa.h +++ b/dsa/dsa.h @@ -1,7 +1,7 @@ /* dsa.h */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) + Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ typedef struct{ typedef bigint_t dsa_pubkey_t; typedef bigint_t dsa_privkey_t; + typedef struct{ bigint_t r; bigint_t s; @@ -43,17 +44,19 @@ typedef struct{ dsa_domainparameters_t domain; } dsa_ctx_t; +typedef uint8_t(*rand_func_ptr_t)(void); + #define DSA_SIGNATURE_OK 1 #define DSA_SIGNATURE_FAIL 0 -uint8_t dsa_sign_bigint(dsa_signature_t* s, const bigint_t* m, - const dsa_ctx_t* ctx, const bigint_t* k); -uint8_t dsa_sign_message(dsa_signature_t* s, const void* m, uint16_t m_len_b, - const hfdesc_t* hash_desc, const dsa_ctx_t* ctx, - const uint8_t(*rand_in)(void)); -uint8_t dsa_verify_bigint(const dsa_signature_t* s, const bigint_t* m, - const dsa_ctx_t* ctx); -uint8_t dsa_verify_message(const dsa_signature_t* s, const void* m, uint16_t m_len_b, - const hfdesc_t* hash_desc, const dsa_ctx_t* ctx); +uint8_t dsa_sign_bigint(dsa_signature_t *s, const bigint_t *m, + const dsa_ctx_t *ctx, const bigint_t *k); +uint8_t dsa_sign_message(dsa_signature_t *s, const void *m, uint16_t m_len_b, + const hfdesc_t *hash_desc, const dsa_ctx_t *ctx, + const rand_func_ptr_t rand_in); +uint8_t dsa_verify_bigint(const dsa_signature_t *s, const bigint_t *m, + const dsa_ctx_t *ctx); +uint8_t dsa_verify_message(const dsa_signature_t *s, const void *m, uint16_t m_len_b, + const hfdesc_t *hash_desc, const dsa_ctx_t *ctx); #endif /* DSA_H_ */