sha1.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* sha1.h - SHA-1 context definition
  2. * Copyright (C) 1998, 2001, 2002, 2003, 2008 Free Software Foundation, Inc.
  3. *
  4. * This file is part of Libgcrypt.
  5. *
  6. * Libgcrypt is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as
  8. * published by the Free Software Foundation; either version 2.1 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * Libgcrypt is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this program; if not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GCRY_SHA1_H
  20. #define GCRY_SHA1_H
  21. #include "hash-common.h"
  22. /* SHA1_USE_S390X_CRYPTO indicates whether to enable zSeries code. */
  23. #undef SHA1_USE_S390X_CRYPTO
  24. #if defined(HAVE_GCC_INLINE_ASM_S390X)
  25. # define SHA1_USE_S390X_CRYPTO 1
  26. #endif /* SHA1_USE_S390X_CRYPTO */
  27. /* We need this here for direct use by random-csprng.c. */
  28. typedef struct
  29. {
  30. gcry_md_block_ctx_t bctx;
  31. u32 h0,h1,h2,h3,h4;
  32. #ifdef SHA1_USE_S390X_CRYPTO
  33. u32 final_len_msb, final_len_lsb; /* needs to be right after h4. */
  34. int use_s390x_crypto;
  35. #endif
  36. } SHA1_CONTEXT;
  37. void _gcry_sha1_mixblock_init (SHA1_CONTEXT *hd);
  38. unsigned int _gcry_sha1_mixblock (SHA1_CONTEXT *hd, void *blockof64byte);
  39. #endif /*GCRY_SHA1_H*/