hfal_cubehash.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* hfal_cubehash.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_cubehash.c
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2010-02-09
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #include <stdlib.h>
  25. #include <crypto/hashfunction_descriptor.h>
  26. #include <crypto/cubehash.h>
  27. static const char cubehash224_str[] = "CubeHash-224";
  28. static const char cubehash256_str[] = "CubeHash-256";
  29. static const char cubehash384_str[] = "CubeHash-384";
  30. static const char cubehash512_str[] = "CubeHash-512";
  31. const hfdesc_t cubehash224_desc = {
  32. HFDESC_TYPE_HASHFUNCTION,
  33. 0,
  34. cubehash224_str,
  35. sizeof(cubehash_ctx_t),
  36. CUBEHASH224_BLOCKSIZE,
  37. 224,
  38. (hf_init_fpt)cubehash224_init,
  39. (hf_nextBlock_fpt)cubehash_nextBlock,
  40. (hf_lastBlock_fpt)cubehash_lastBlock,
  41. (hf_ctx2hash_fpt)cubehash224_ctx2hash,
  42. (hf_free_fpt)NULL,
  43. (hf_mem_fpt)NULL
  44. };
  45. const hfdesc_t cubehash256_desc = {
  46. HFDESC_TYPE_HASHFUNCTION,
  47. 0,
  48. cubehash256_str,
  49. sizeof(cubehash_ctx_t),
  50. CUBEHASH256_BLOCKSIZE,
  51. 256,
  52. (hf_init_fpt)cubehash256_init,
  53. (hf_nextBlock_fpt)cubehash_nextBlock,
  54. (hf_lastBlock_fpt)cubehash_lastBlock,
  55. (hf_ctx2hash_fpt)cubehash256_ctx2hash,
  56. (hf_free_fpt)NULL,
  57. (hf_mem_fpt)NULL
  58. };
  59. const hfdesc_t cubehash384_desc = {
  60. HFDESC_TYPE_HASHFUNCTION,
  61. 0,
  62. cubehash384_str,
  63. sizeof(cubehash_ctx_t),
  64. CUBEHASH384_BLOCKSIZE,
  65. 384,
  66. (hf_init_fpt)cubehash384_init,
  67. (hf_nextBlock_fpt)cubehash_nextBlock,
  68. (hf_lastBlock_fpt)cubehash_lastBlock,
  69. (hf_ctx2hash_fpt)cubehash384_ctx2hash,
  70. (hf_free_fpt)NULL,
  71. (hf_mem_fpt)NULL
  72. };
  73. const hfdesc_t cubehash512_desc = {
  74. HFDESC_TYPE_HASHFUNCTION,
  75. 0,
  76. cubehash512_str,
  77. sizeof(cubehash_ctx_t),
  78. CUBEHASH512_BLOCKSIZE,
  79. 512,
  80. (hf_init_fpt)cubehash512_init,
  81. (hf_nextBlock_fpt)cubehash_nextBlock,
  82. (hf_lastBlock_fpt)cubehash_lastBlock,
  83. (hf_ctx2hash_fpt)cubehash512_ctx2hash,
  84. (hf_free_fpt)NULL,
  85. (hf_mem_fpt)NULL
  86. };