hfal_skein1024.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* hfal_skein1024.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_skein1024.c
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2009-03-13
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #include <stdlib.h>
  25. #include <crypto/hashfunction_descriptor.h>
  26. #include <crypto/skein.h>
  27. static const char skein1024_128_str[] = "Skein-1024-128";
  28. static const char skein1024_160_str[] = "Skein-1024-160";
  29. static const char skein1024_224_str[] = "Skein-1024-224";
  30. static const char skein1024_256_str[] = "Skein-1024-256";
  31. static const char skein1024_384_str[] = "Skein-1024-384";
  32. static const char skein1024_512_str[] = "Skein-1024-512";
  33. static const char skein1024_1024_str[] = "Skein-1024-1024";
  34. void skein1024_128_init(skein1024_ctx_t* ctx){
  35. skein1024_init(ctx, 128);
  36. }
  37. void skein1024_160_init(skein1024_ctx_t* ctx){
  38. skein1024_init(ctx, 160);
  39. }
  40. void skein1024_224_init(skein1024_ctx_t* ctx){
  41. skein1024_init(ctx, 224);
  42. }
  43. void skein1024_256_init(skein1024_ctx_t* ctx){
  44. skein1024_init(ctx, 256);
  45. }
  46. void skein1024_384_init(skein1024_ctx_t* ctx){
  47. skein1024_init(ctx, 384);
  48. }
  49. void skein1024_512_init(skein1024_ctx_t* ctx){
  50. skein1024_init(ctx, 512);
  51. }
  52. void skein1024_1024_init(skein1024_ctx_t* ctx){
  53. skein1024_init(ctx, 1024);
  54. }
  55. const hfdesc_t skein1024_128_desc = {
  56. HFDESC_TYPE_HASHFUNCTION,
  57. 0,
  58. skein1024_128_str,
  59. sizeof(skein1024_ctx_t),
  60. SKEIN1024_BLOCKSIZE,
  61. 128,
  62. (hf_init_fpt)skein1024_128_init,
  63. (hf_nextBlock_fpt)skein1024_nextBlock,
  64. (hf_lastBlock_fpt)skein1024_lastBlock,
  65. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  66. (hf_free_fpt)NULL,
  67. (hf_mem_fpt)NULL
  68. };
  69. const hfdesc_t skein1024_160_desc = {
  70. HFDESC_TYPE_HASHFUNCTION,
  71. 0,
  72. skein1024_160_str,
  73. sizeof(skein1024_ctx_t),
  74. SKEIN1024_BLOCKSIZE,
  75. 160,
  76. (hf_init_fpt)skein1024_160_init,
  77. (hf_nextBlock_fpt)skein1024_nextBlock,
  78. (hf_lastBlock_fpt)skein1024_lastBlock,
  79. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  80. (hf_free_fpt)NULL,
  81. (hf_mem_fpt)NULL
  82. };
  83. const hfdesc_t skein1024_224_desc = {
  84. HFDESC_TYPE_HASHFUNCTION,
  85. 0,
  86. skein1024_224_str,
  87. sizeof(skein1024_ctx_t),
  88. SKEIN1024_BLOCKSIZE,
  89. 224,
  90. (hf_init_fpt)skein1024_224_init,
  91. (hf_nextBlock_fpt)skein1024_nextBlock,
  92. (hf_lastBlock_fpt)skein1024_lastBlock,
  93. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  94. (hf_free_fpt)NULL,
  95. (hf_mem_fpt)NULL
  96. };
  97. const hfdesc_t skein1024_256_desc = {
  98. HFDESC_TYPE_HASHFUNCTION,
  99. 0,
  100. skein1024_256_str,
  101. sizeof(skein1024_ctx_t),
  102. SKEIN1024_BLOCKSIZE,
  103. 256,
  104. (hf_init_fpt)skein1024_256_init,
  105. (hf_nextBlock_fpt)skein1024_nextBlock,
  106. (hf_lastBlock_fpt)skein1024_lastBlock,
  107. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  108. (hf_free_fpt)NULL,
  109. (hf_mem_fpt)NULL
  110. };
  111. const hfdesc_t skein1024_384_desc = {
  112. HFDESC_TYPE_HASHFUNCTION,
  113. 0,
  114. skein1024_384_str,
  115. sizeof(skein1024_ctx_t),
  116. SKEIN1024_BLOCKSIZE,
  117. 384,
  118. (hf_init_fpt)skein1024_384_init,
  119. (hf_nextBlock_fpt)skein1024_nextBlock,
  120. (hf_lastBlock_fpt)skein1024_lastBlock,
  121. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  122. (hf_free_fpt)NULL,
  123. (hf_mem_fpt)NULL
  124. };
  125. const hfdesc_t skein1024_512_desc = {
  126. HFDESC_TYPE_HASHFUNCTION,
  127. 0,
  128. skein1024_512_str,
  129. sizeof(skein1024_ctx_t),
  130. SKEIN1024_BLOCKSIZE,
  131. 512,
  132. (hf_init_fpt)skein1024_512_init,
  133. (hf_nextBlock_fpt)skein1024_nextBlock,
  134. (hf_lastBlock_fpt)skein1024_lastBlock,
  135. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  136. (hf_free_fpt)NULL,
  137. (hf_mem_fpt)NULL
  138. };
  139. const hfdesc_t skein1024_1024_desc = {
  140. HFDESC_TYPE_HASHFUNCTION,
  141. 0,
  142. skein1024_1024_str,
  143. sizeof(skein1024_ctx_t),
  144. SKEIN1024_BLOCKSIZE,
  145. 1024,
  146. (hf_init_fpt)skein1024_1024_init,
  147. (hf_nextBlock_fpt)skein1024_nextBlock,
  148. (hf_lastBlock_fpt)skein1024_lastBlock,
  149. (hf_ctx2hash_fpt)skein1024_ctx2hash,
  150. (hf_free_fpt)NULL,
  151. (hf_mem_fpt)NULL
  152. };