X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=sha1%2Fsha1.h;h=0da9ee75852c75d2fec5179c87ebccbef2f02b36;hb=eb0cafe05ab4cdf60878dbd81e4ff3712d5150f2;hp=6675d20a19182997addf152717d2f5dd44b19974;hpb=d32eba56ce10ea6b9eff123b50d9842673b38f2b;p=avr-crypto-lib.git diff --git a/sha1/sha1.h b/sha1/sha1.h index 6675d20..0da9ee7 100644 --- a/sha1/sha1.h +++ b/sha1/sha1.h @@ -65,7 +65,9 @@ typedef struct { * \brief hash value type * A variable of this type may hold a SHA-1 hash value */ +/* typedef uint8_t sha1_hash_t[SHA1_HASH_BITS/8]; +*/ /** \fn sha1_init(sha1_ctx_t *state) * \brief initializes a SHA-1 context @@ -75,16 +77,16 @@ typedef uint8_t sha1_hash_t[SHA1_HASH_BITS/8]; */ void sha1_init(sha1_ctx_t *state); -/** \fn sha1_nextBlock(sha1_ctx_t *state, const void* block) +/** \fn sha1_nextBlock(sha1_ctx_t *state, const void *block) * \brief process one input block * This function processes one input block and updates the hash context * accordingly * \param state pointer to the state variable to update * \param block pointer to the message block to process */ -void sha1_nextBlock (sha1_ctx_t *state, const void* block); +void sha1_nextBlock (sha1_ctx_t *state, const void *block); -/** \fn sha1_lastBlock(sha1_ctx_t *state, const void* block, uint16_t length_b) +/** \fn sha1_lastBlock(sha1_ctx_t *state, const void *block, uint16_t length_b) * \brief processes the given block and finalizes the context * This function processes the last block in a SHA-1 hashing process. * The block should have a maximum length of a single input block. @@ -92,7 +94,7 @@ void sha1_nextBlock (sha1_ctx_t *state, const void* block); * \param block pointer to themessage block to process * \param length_b length of the message block in bits */ -void sha1_lastBlock (sha1_ctx_t *state, const void* block, uint16_t length_b); +void sha1_lastBlock (sha1_ctx_t *state, const void *block, uint16_t length_b); /** \fn sha1_ctx2hash(sha1_hash_t *dest, sha1_ctx_t *state) * \brief convert a state variable into an actual hash value @@ -100,9 +102,9 @@ void sha1_lastBlock (sha1_ctx_t *state, const void* block, uint16_t length_b); * \param dest pointer to the hash value destination * \param state pointer to the hash context */ -void sha1_ctx2hash (sha1_hash_t *dest, sha1_ctx_t *state); +void sha1_ctx2hash (void *dest, sha1_ctx_t *state); -/** \fn sha1(sha1_hash_t *dest, const void* msg, uint32_t length_b) +/** \fn sha1(sha1_hash_t *dest, const void *msg, uint32_t length_b) * \brief hashing a message which in located entirely in RAM * This function automatically hashes a message which is entirely in RAM with * the SHA-1 hashing algorithm. @@ -110,7 +112,7 @@ void sha1_ctx2hash (sha1_hash_t *dest, sha1_ctx_t *state); * \param msg pointer to the message which should be hashed * \param length_b length of the message in bits */ -void sha1(sha1_hash_t *dest, const void* msg, uint32_t length_b); +void sha1(void *dest, const void *msg, uint32_t length_b);