X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=dsa%2Fdsa.h;h=c882f82f24175e232209533ef1a5002108c6652b;hp=0eabffe30950d066d7b6700dbc043fed9996528f;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=d1181933dc28db92d787cf5604e2fc96ab0d8f9f diff --git a/dsa/dsa.h b/dsa/dsa.h index 0eabffe..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; @@ -48,14 +49,14 @@ 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, +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); +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_ */