| 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 |
|
| 22 |
#include "hash-common.h" |
| 23 |
|
| 24 |
|
| 25 |
/* SHA1_USE_S390X_CRYPTO indicates whether to enable zSeries code. */ |
| 26 |
#undef SHA1_USE_S390X_CRYPTO |
| 27 |
#if defined(HAVE_GCC_INLINE_ASM_S390X) |
| 28 |
# define SHA1_USE_S390X_CRYPTO 1 |
| 29 |
#endif /* SHA1_USE_S390X_CRYPTO */ |
| 30 |
|
| 31 |
|
| 32 |
/* We need this here for direct use by random-csprng.c. */ |
| 33 |
typedef struct |
| 34 |
{ |
| 35 |
gcry_md_block_ctx_t bctx; |
| 36 |
u32 h0,h1,h2,h3,h4; |
| 37 |
#ifdef SHA1_USE_S390X_CRYPTO |
| 38 |
u32 final_len_msb, final_len_lsb; /* needs to be right after h4. */ |
| 39 |
int use_s390x_crypto; |
| 40 |
#endif |
| 41 |
} SHA1_CONTEXT; |
| 42 |
|
| 43 |
|
| 44 |
void _gcry_sha1_mixblock_init (SHA1_CONTEXT *hd); |
| 45 |
unsigned int _gcry_sha1_mixblock (SHA1_CONTEXT *hd, void *blockof64byte); |
| 46 |
|
| 47 |
#endif /*GCRY_SHA1_H*/ |