Skip to content

Commit

Permalink
Merge pull request
Browse files Browse the repository at this point in the history
See merge request #1
  • Loading branch information
dokutoku committed Mar 30, 2021
2 parents 45fac87 + 4ecd521 commit 89555c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions include/sha3iuf-d.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ typedef struct sha3_context_
* 0..7--the next byte after the set one
* (starts from 0; 0--none are buffered)
*/
uint8_t byteIndex;
uint32_t byteIndex;

/*
* 0..24--the next word to integrate input
* (starts from 0)
*/
uint8_t wordIndex;
uint32_t wordIndex;

/*
* the double size of the hash output in
* words (e.g. 16 for Keccak 512)
*/
uint8_t capacityWords;
uint32_t capacityWords;
} sha3_context;

enum SHA3_FLAGS
Expand All @@ -78,7 +78,7 @@ enum SHA3_RETURN
typedef enum SHA3_RETURN sha3_return_t;

/* For Init or Reset call these: */
sha3_return_t sha3_Init(void* priv, uint8_t bitSize);
sha3_return_t sha3_Init(void* priv, uint32_t bitSize);

void sha3_Init256(void* priv);
void sha3_Init384(void* priv);
Expand All @@ -91,9 +91,9 @@ void sha3_Update(void* priv, void const* bufIn, size_t len);
void const* sha3_Finalize(void* priv);

/* Single-call hashing */
sha3_return_t sha3_HashBuffer(uint8_t bitSize, /* 256, 384, 512 */
sha3_return_t sha3_HashBuffer(uint32_t bitSize, /* 256, 384, 512 */
enum SHA3_FLAGS flags, /* SHA3_FLAGS_NONE or SHA3_FLAGS_KECCAK */
const void* in_, uint8_t inBytes, void* out_, uint8_t outBytes); /* up to bitSize/8; truncation OK */
const void* in_, size_t inBytes, void* out_, uint32_t outBytes); /* up to bitSize/8; truncation OK */

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion source/sha3iuf_d/sha3.d
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public const (void)* sha3_Finalize(return scope void* priv)
*/
extern (C)
pure nothrow @trusted @nogc @live
public .sha3_return_t sha3_HashBuffer(uint bitSize, .SHA3_FLAGS flags, scope const void* in_, uint inBytes, return scope void* out_, uint outBytes)
public .sha3_return_t sha3_HashBuffer(uint bitSize, .SHA3_FLAGS flags, scope const void* in_, size_t inBytes, return scope void* out_, uint outBytes)

in
{
Expand Down

0 comments on commit 89555c9

Please sign in to comment.