hfal_shabal.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* hfal_shabal.c */
  2. /*
  3. This file is part of the ARM-Crypto-Lib.
  4. Copyright (C) 2008 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_shabal.c
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2009-04-20
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #include <stdlib.h>
  25. #include <crypto/hashfunction_descriptor.h>
  26. #include <crypto/shabal.h>
  27. static const char shabal192_str[] = "Shabal-192";
  28. static const char shabal224_str[] = "Shabal-224";
  29. static const char shabal256_str[] = "Shabal-256";
  30. static const char shabal384_str[] = "Shabal-384";
  31. static const char shabal512_str[] = "Shabal-512";
  32. const hfdesc_t shabal192_desc = {
  33. HFDESC_TYPE_HASHFUNCTION,
  34. 0,
  35. shabal192_str,
  36. sizeof(shabal_ctx_t),
  37. SHABAL_BLOCKSIZE,
  38. 192,
  39. (hf_init_fpt)shabal192_init,
  40. (hf_nextBlock_fpt)shabal_nextBlock,
  41. (hf_lastBlock_fpt)shabal_lastBlock,
  42. (hf_ctx2hash_fpt)shabal192_ctx2hash,
  43. (hf_free_fpt)NULL,
  44. (hf_mem_fpt)shabal192
  45. };
  46. const hfdesc_t shabal224_desc = {
  47. HFDESC_TYPE_HASHFUNCTION,
  48. 0,
  49. shabal224_str,
  50. sizeof(shabal_ctx_t),
  51. SHABAL_BLOCKSIZE,
  52. 224,
  53. (hf_init_fpt)shabal224_init,
  54. (hf_nextBlock_fpt)shabal_nextBlock,
  55. (hf_lastBlock_fpt)shabal_lastBlock,
  56. (hf_ctx2hash_fpt)shabal224_ctx2hash,
  57. (hf_free_fpt)NULL,
  58. (hf_mem_fpt)shabal224
  59. };
  60. const hfdesc_t shabal256_desc = {
  61. HFDESC_TYPE_HASHFUNCTION,
  62. 0,
  63. shabal256_str,
  64. sizeof(shabal_ctx_t),
  65. SHABAL_BLOCKSIZE,
  66. 256,
  67. (hf_init_fpt)shabal256_init,
  68. (hf_nextBlock_fpt)shabal_nextBlock,
  69. (hf_lastBlock_fpt)shabal_lastBlock,
  70. (hf_ctx2hash_fpt)shabal256_ctx2hash,
  71. (hf_free_fpt)NULL,
  72. (hf_mem_fpt)shabal256
  73. };
  74. const hfdesc_t shabal384_desc = {
  75. HFDESC_TYPE_HASHFUNCTION,
  76. 0,
  77. shabal384_str,
  78. sizeof(shabal_ctx_t),
  79. SHABAL_BLOCKSIZE,
  80. 384,
  81. (hf_init_fpt)shabal384_init,
  82. (hf_nextBlock_fpt)shabal_nextBlock,
  83. (hf_lastBlock_fpt)shabal_lastBlock,
  84. (hf_ctx2hash_fpt)shabal384_ctx2hash,
  85. (hf_free_fpt)NULL,
  86. (hf_mem_fpt)shabal384
  87. };
  88. const hfdesc_t shabal512_desc = {
  89. HFDESC_TYPE_HASHFUNCTION,
  90. 0,
  91. shabal512_str,
  92. sizeof(shabal_ctx_t),
  93. SHABAL_BLOCKSIZE,
  94. 512,
  95. (hf_init_fpt)shabal512_init,
  96. (hf_nextBlock_fpt)shabal_nextBlock,
  97. (hf_lastBlock_fpt)shabal_lastBlock,
  98. (hf_ctx2hash_fpt)shabal512_ctx2hash,
  99. (hf_free_fpt)NULL,
  100. (hf_mem_fpt)shabal512
  101. };