hfal_blake_large.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* hfal_blake_large.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_blake_large.c
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2009-05-08
  21. * \license GPLv3 or later
  22. *
  23. */
  24. #include <stdlib.h>
  25. #include <crypto/hashfunction_descriptor.h>
  26. #include <crypto/blake_large.h>
  27. static const char blake384_str[] = "Blake-384";
  28. static const char blake512_str[] = "Blake-512";
  29. const hfdesc_t blake384_desc = {
  30. HFDESC_TYPE_HASHFUNCTION,
  31. 0,
  32. blake384_str,
  33. sizeof(blake384_ctx_t),
  34. BLAKE384_BLOCKSIZE,
  35. 384,
  36. (hf_init_fpt)blake384_init,
  37. (hf_nextBlock_fpt)blake_large_nextBlock,
  38. (hf_lastBlock_fpt)blake_large_lastBlock,
  39. (hf_ctx2hash_fpt)blake384_ctx2hash,
  40. (hf_free_fpt)NULL,
  41. (hf_mem_fpt)blake384
  42. };
  43. const hfdesc_t blake512_desc = {
  44. HFDESC_TYPE_HASHFUNCTION,
  45. 0,
  46. blake512_str,
  47. sizeof(blake512_ctx_t),
  48. BLAKE512_BLOCKSIZE,
  49. 512,
  50. (hf_init_fpt)blake512_init,
  51. (hf_nextBlock_fpt)blake_large_nextBlock,
  52. (hf_lastBlock_fpt)blake_large_lastBlock,
  53. (hf_ctx2hash_fpt)blake512_ctx2hash,
  54. (hf_free_fpt)NULL,
  55. (hf_mem_fpt)blake512
  56. };