hfal_echo.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* hfal_echo.c */
  2. /*
  3. This file is part of the ARM-Crypto-Lib.
  4. Copyright (C) 2010 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 hfal_echo.c
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2010-02-21
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #include <stdlib.h>
  25. #include <crypto/hashfunction_descriptor.h>
  26. #include <crypto/echo.h>
  27. static const char echo224_str[] = "ECHO-224";
  28. static const char echo256_str[] = "ECHO-256";
  29. static const char echo384_str[] = "ECHO-384";
  30. static const char echo512_str[] = "ECHO-512";
  31. const hfdesc_t echo224_desc = {
  32. HFDESC_TYPE_HASHFUNCTION,
  33. 0,
  34. echo224_str,
  35. sizeof(echo_small_ctx_t),
  36. ECHO224_BLOCKSIZE,
  37. 224,
  38. (hf_init_fpt)echo224_init,
  39. (hf_nextBlock_fpt)echo_small_nextBlock,
  40. (hf_lastBlock_fpt)echo_small_lastBlock,
  41. (hf_ctx2hash_fpt)echo224_ctx2hash,
  42. (hf_free_fpt)NULL,
  43. (hf_mem_fpt)NULL
  44. };
  45. const hfdesc_t echo256_desc = {
  46. HFDESC_TYPE_HASHFUNCTION,
  47. 0,
  48. echo256_str,
  49. sizeof(echo_small_ctx_t),
  50. ECHO256_BLOCKSIZE,
  51. 256,
  52. (hf_init_fpt)echo256_init,
  53. (hf_nextBlock_fpt)echo_small_nextBlock,
  54. (hf_lastBlock_fpt)echo_small_lastBlock,
  55. (hf_ctx2hash_fpt)echo256_ctx2hash,
  56. (hf_free_fpt)NULL,
  57. (hf_mem_fpt)NULL
  58. };
  59. const hfdesc_t echo384_desc = {
  60. HFDESC_TYPE_HASHFUNCTION,
  61. 0,
  62. echo384_str,
  63. sizeof(echo_large_ctx_t),
  64. ECHO384_BLOCKSIZE,
  65. 384,
  66. (hf_init_fpt)echo384_init,
  67. (hf_nextBlock_fpt)echo_large_nextBlock,
  68. (hf_lastBlock_fpt)echo_large_lastBlock,
  69. (hf_ctx2hash_fpt)echo384_ctx2hash,
  70. (hf_free_fpt)NULL,
  71. (hf_mem_fpt)NULL
  72. };
  73. const hfdesc_t echo512_desc = {
  74. HFDESC_TYPE_HASHFUNCTION,
  75. 0,
  76. echo512_str,
  77. sizeof(echo_large_ctx_t),
  78. ECHO512_BLOCKSIZE,
  79. 512,
  80. (hf_init_fpt)echo512_init,
  81. (hf_nextBlock_fpt)echo_large_nextBlock,
  82. (hf_lastBlock_fpt)echo_large_lastBlock,
  83. (hf_ctx2hash_fpt)echo512_ctx2hash,
  84. (hf_free_fpt)NULL,
  85. (hf_mem_fpt)NULL
  86. };