hfal_jh.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* hfal_jh.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_jh.c
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2010-12-16
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #include <stdlib.h>
  25. #include <crypto/hashfunction_descriptor.h>
  26. #include <crypto/jh_simple.h>
  27. static const char jh224_str[] = "JH-224";
  28. static const char jh256_str[] = "JH-256";
  29. static const char jh384_str[] = "JH-384";
  30. static const char jh512_str[] = "JH-512";
  31. const hfdesc_t jh224_desc = {
  32. HFDESC_TYPE_HASHFUNCTION,
  33. 0,
  34. jh224_str,
  35. sizeof(jh_ctx_t),
  36. JH224_BLOCKSIZE,
  37. 224,
  38. (hf_init_fpt)jh224_init,
  39. (hf_nextBlock_fpt)jh_nextBlock,
  40. (hf_lastBlock_fpt)jh_lastBlock,
  41. (hf_ctx2hash_fpt)jh224_ctx2hash,
  42. (hf_free_fpt)NULL,
  43. (hf_mem_fpt)NULL
  44. };
  45. const hfdesc_t jh256_desc = {
  46. HFDESC_TYPE_HASHFUNCTION,
  47. 0,
  48. jh256_str,
  49. sizeof(jh_ctx_t),
  50. JH256_BLOCKSIZE,
  51. 256,
  52. (hf_init_fpt)jh256_init,
  53. (hf_nextBlock_fpt)jh_nextBlock,
  54. (hf_lastBlock_fpt)jh_lastBlock,
  55. (hf_ctx2hash_fpt)jh256_ctx2hash,
  56. (hf_free_fpt)NULL,
  57. (hf_mem_fpt)NULL
  58. };
  59. const hfdesc_t jh384_desc = {
  60. HFDESC_TYPE_HASHFUNCTION,
  61. 0,
  62. jh384_str,
  63. sizeof(jh_ctx_t),
  64. JH384_BLOCKSIZE,
  65. 384,
  66. (hf_init_fpt)jh384_init,
  67. (hf_nextBlock_fpt)jh_nextBlock,
  68. (hf_lastBlock_fpt)jh_lastBlock,
  69. (hf_ctx2hash_fpt)jh384_ctx2hash,
  70. (hf_free_fpt)NULL,
  71. (hf_mem_fpt)NULL
  72. };
  73. const hfdesc_t jh512_desc = {
  74. HFDESC_TYPE_HASHFUNCTION,
  75. 0,
  76. jh512_str,
  77. sizeof(jh_ctx_t),
  78. JH512_BLOCKSIZE,
  79. 512,
  80. (hf_init_fpt)jh512_init,
  81. (hf_nextBlock_fpt)jh_nextBlock,
  82. (hf_lastBlock_fpt)jh_lastBlock,
  83. (hf_ctx2hash_fpt)jh512_ctx2hash,
  84. (hf_free_fpt)NULL,
  85. (hf_mem_fpt)NULL
  86. };