X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=keccak%2Fkeccak.h;h=62ec41ebf318caaa42757429dcb6bef18543f9f2;hp=ff176574ff702cda0d002ae03d0564e442262c28;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=2f9c4bbbec068d68709b5a3080bb958255872438 diff --git a/keccak/keccak.h b/keccak/keccak.h index ff17657..62ec41e 100644 --- a/keccak/keccak.h +++ b/keccak/keccak.h @@ -1,7 +1,7 @@ /* keccak.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 @@ -23,34 +23,34 @@ #include #define KECCAK224_BLOCKSIZE 1152 -#define KECCAK224_BLOCKSIZE_B (KECCAK224_BLOCKSIZE/8) +#define KECCAK224_BLOCKSIZE_B (KECCAK224_BLOCKSIZE / 8) #define KECCAK256_BLOCKSIZE 1088 -#define KECCAK256_BLOCKSIZE_B (KECCAK256_BLOCKSIZE/8) +#define KECCAK256_BLOCKSIZE_B (KECCAK256_BLOCKSIZE / 8) #define KECCAK384_BLOCKSIZE 832 -#define KECCAK384_BLOCKSIZE_B (KECCAK384_BLOCKSIZE/8) +#define KECCAK384_BLOCKSIZE_B (KECCAK384_BLOCKSIZE / 8) #define KECCAK512_BLOCKSIZE 576 -#define KECCAK512_BLOCKSIZE_B (KECCAK512_BLOCKSIZE/8) +#define KECCAK512_BLOCKSIZE_B (KECCAK512_BLOCKSIZE / 8) typedef struct{ - uint64_t a[5][5]; - uint16_t r, c; - uint8_t d, bs; + uint8_t a[200]; + uint16_t r; + uint8_t bs; } keccak_ctx_t; -void keccak_init(uint16_t r, uint16_t c, uint8_t d, keccak_ctx_t* ctx); -void keccak224_init(keccak_ctx_t* ctx); -void keccak256_init(keccak_ctx_t* ctx); -void keccak384_init(keccak_ctx_t* ctx); -void keccak512_init(keccak_ctx_t* ctx); +void keccak_init(uint16_t r, keccak_ctx_t *ctx); +void keccak224_init(keccak_ctx_t *ctx); +void keccak256_init(keccak_ctx_t *ctx); +void keccak384_init(keccak_ctx_t *ctx); +void keccak512_init(keccak_ctx_t *ctx); -void keccak_nextBlock(keccak_ctx_t* ctx, const void* block); -void keccak_lastBlock(keccak_ctx_t* ctx, const void* block, uint16_t length_b); +void keccak_nextBlock(keccak_ctx_t *ctx, const void *block); +void keccak_lastBlock(keccak_ctx_t *ctx, const void *block, uint16_t length_b); -void keccak_ctx2hash(void* dest, uint16_t length_b, keccak_ctx_t* ctx); -void keccak224_ctx2hash(void* dest, keccak_ctx_t* ctx); -void keccak256_ctx2hash(void* dest, keccak_ctx_t* ctx); -void keccak384_ctx2hash(void* dest, keccak_ctx_t* ctx); -void keccak512_ctx2hash(void* dest, keccak_ctx_t* ctx); +void keccak_ctx2hash(void *dest, uint16_t length_b, keccak_ctx_t *ctx); +void keccak224_ctx2hash(void *dest, keccak_ctx_t *ctx); +void keccak256_ctx2hash(void *dest, keccak_ctx_t *ctx); +void keccak384_ctx2hash(void *dest, keccak_ctx_t *ctx); +void keccak512_ctx2hash(void *dest, keccak_ctx_t *ctx); #endif /* KECCAK_H_ */