ReactOS  0.4.14-dev-77-gd9e7c48
sha1.h
Go to the documentation of this file.
1 
10 /*
11  * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
12  * SPDX-License-Identifier: GPL-2.0
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  *
28  * This file is part of Mbed TLS (https://tls.mbed.org)
29  */
30 #ifndef MBEDTLS_SHA1_H
31 #define MBEDTLS_SHA1_H
32 
33 #if !defined(MBEDTLS_CONFIG_FILE)
34 #include "config.h"
35 #else
36 #include MBEDTLS_CONFIG_FILE
37 #endif
38 
39 #include <stddef.h>
40 #include <stdint.h>
41 
42 #define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035
44 #if !defined(MBEDTLS_SHA1_ALT)
45 // Regular implementation
46 //
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
60 typedef struct
61 {
62  uint32_t total[2];
64  unsigned char buffer[64];
65 }
67 
79 
91 
104  const mbedtls_sha1_context *src );
105 
119 
136  const unsigned char *input,
137  size_t ilen );
138 
154  unsigned char output[20] );
155 
170  const unsigned char data[64] );
171 
172 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
173 #if defined(MBEDTLS_DEPRECATED_WARNING)
174 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
175 #else
176 #define MBEDTLS_DEPRECATED
177 #endif
178 
191 
207  const unsigned char *input,
208  size_t ilen );
209 
224  unsigned char output[20] );
225 
240  const unsigned char data[64] );
241 
242 #undef MBEDTLS_DEPRECATED
243 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #else /* MBEDTLS_SHA1_ALT */
250 #include "sha1_alt.h"
251 #endif /* MBEDTLS_SHA1_ALT */
252 
253 #ifdef __cplusplus
254 extern "C" {
255 #endif
256 
277 int mbedtls_sha1_ret( const unsigned char *input,
278  size_t ilen,
279  unsigned char output[20] );
280 
281 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
282 #if defined(MBEDTLS_DEPRECATED_WARNING)
283 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
284 #else
285 #define MBEDTLS_DEPRECATED
286 #endif
287 
301 MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input,
302  size_t ilen,
303  unsigned char output[20] );
304 
305 #undef MBEDTLS_DEPRECATED
306 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
307 
319 
320 #ifdef __cplusplus
321 }
322 #endif
323 
324 #endif /* mbedtls_sha1.h */
MBEDTLS_DEPRECATED void mbedtls_sha1_starts(mbedtls_sha1_context *ctx)
SHA-1 context setup.
MBEDTLS_DEPRECATED void mbedtls_sha1_update(mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
SHA-1 process buffer.
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
void mbedtls_sha1_init(mbedtls_sha1_context *ctx)
This function initializes a SHA-1 context.
MBEDTLS_DEPRECATED void mbedtls_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
SHA-1 process data block (internal use only)
GLuint buffer
Definition: glext.h:5915
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
SHA-1 process data block (internal use only)
#define verbose
Definition: rosglue.h:36
int mbedtls_sha1_self_test(int verbose)
The SHA-1 checkup routine.
void mbedtls_sha1_free(mbedtls_sha1_context *ctx)
This function clears a SHA-1 context.
int mbedtls_sha1_finish_ret(mbedtls_sha1_context *ctx, unsigned char output[20])
This function finishes the SHA-1 operation, and writes the result to the output buffer.
int mbedtls_sha1_update_ret(mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-1 checksum calculation.
MBEDTLS_DEPRECATED void mbedtls_sha1_finish(mbedtls_sha1_context *ctx, unsigned char output[20])
SHA-1 final digest.
int mbedtls_sha1_ret(const unsigned char *input, size_t ilen, unsigned char output[20])
This function calculates the SHA-1 checksum of a buffer.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void mbedtls_sha1_clone(mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
This function clones the state of a SHA-1 context.
static int state
Definition: maze.c:121
GLenum src
Definition: glext.h:6340
GLenum GLenum GLenum input
Definition: glext.h:9031
GLenum GLenum dst
Definition: glext.h:6340
The SHA-1 context structure.
Definition: sha1.h:60
UINT32 uint32_t
Definition: types.h:75
MBEDTLS_DEPRECATED void mbedtls_sha1(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = SHA-1( input buffer )
int mbedtls_sha1_starts_ret(mbedtls_sha1_context *ctx)
This function starts a SHA-1 checksum calculation.
#define MBEDTLS_DEPRECATED
Definition: sha1.h:285