groestl_large.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* groestl_large.h */
  2. /*
  3. This file is part of the ARM-Crypto-Lib.
  4. Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de)
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. /*
  17. * \file groestl_large.h
  18. * \author Daniel Otte
  19. * \email daniel.otte@rub.de
  20. * \date 2009-05-19
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #ifndef GROESTL_LARGE_H_
  25. #define GROESTL_LARGE_H_
  26. #include <stdint.h>
  27. #define GROESTL_LARGE_BLOCKSIZE 1024
  28. #define GROESTL_LARGE_BLOCKSIZE_B ((GROESTL_LARGE_BLOCKSIZE+7)/8)
  29. #define GROESTL384_BLOCKSIZE GROESTL_LARGE_BLOCKSIZE
  30. #define GROESTL384_BLOCKSIZE_B GROESTL_LARGE_BLOCKSIZE_B
  31. #define GROESTL512_BLOCKSIZE GROESTL_LARGE_BLOCKSIZE
  32. #define GROESTL512_BLOCKSIZE_B GROESTL_LARGE_BLOCKSIZE_B
  33. typedef struct {
  34. uint8_t h[8*16];
  35. uint32_t counter;
  36. } groestl_large_ctx_t;
  37. typedef groestl_large_ctx_t groestl384_ctx_t;
  38. typedef groestl_large_ctx_t groestl512_ctx_t;
  39. void groestl384_init(groestl384_ctx_t* ctx);
  40. void groestl512_init(groestl512_ctx_t* ctx);
  41. void groestl_large_nextBlock(groestl_large_ctx_t* ctx, const void* block);
  42. void groestl_large_lastBlock(groestl_large_ctx_t* ctx, const void* block, uint16_t length_b);
  43. void groestl384_nextBlock(groestl384_ctx_t* ctx, const void* block);
  44. void groestl384_lastBlock(groestl384_ctx_t* ctx, const void* block, uint16_t length_b);
  45. void groestl512_nextBlock(groestl512_ctx_t* ctx, const void* block);
  46. void groestl512_lastBlock(groestl512_ctx_t* ctx, const void* block, uint16_t length_b);
  47. void groestl384_ctx2hash(void* dest, const groestl384_ctx_t* ctx);
  48. void groestl512_ctx2hash(void* dest, const groestl512_ctx_t* ctx);
  49. void groestl384(void* dest, const void* msg, uint32_t length_b);
  50. void groestl512(void* dest, const void* msg, uint32_t length_b);
  51. #endif /* GROESTL_GROESTL_H_ */