ReactOS  0.4.15-dev-489-g75a0787
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: Apache-2.0 OR GPL-2.0-or-later
13  *
14  * This file is provided under the Apache License 2.0, or the
15  * GNU General Public License v2.0 or later.
16  *
17  * **********
18  * Apache License 2.0:
19  *
20  * Licensed under the Apache License, Version 2.0 (the "License"); you may
21  * not use this file except in compliance with the License.
22  * You may obtain a copy of the License at
23  *
24  * http://www.apache.org/licenses/LICENSE-2.0
25  *
26  * Unless required by applicable law or agreed to in writing, software
27  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  * See the License for the specific language governing permissions and
30  * limitations under the License.
31  *
32  * **********
33  *
34  * **********
35  * GNU General Public License v2.0 or later:
36  *
37  * This program is free software; you can redistribute it and/or modify
38  * it under the terms of the GNU General Public License as published by
39  * the Free Software Foundation; either version 2 of the License, or
40  * (at your option) any later version.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License along
48  * with this program; if not, write to the Free Software Foundation, Inc.,
49  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
50  *
51  * **********
52  *
53  * This file is part of Mbed TLS (https://tls.mbed.org)
54  */
55 #ifndef MBEDTLS_SHA1_H
56 #define MBEDTLS_SHA1_H
57 
58 #if !defined(MBEDTLS_CONFIG_FILE)
59 #include "config.h"
60 #else
61 #include MBEDTLS_CONFIG_FILE
62 #endif
63 
64 #include <stddef.h>
65 #include <stdint.h>
66 
67 #define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035
69 #if !defined(MBEDTLS_SHA1_ALT)
70 // Regular implementation
71 //
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
85 typedef struct
86 {
87  uint32_t total[2];
89  unsigned char buffer[64];
90 }
92 
104 
116 
129  const mbedtls_sha1_context *src );
130 
144 
161  const unsigned char *input,
162  size_t ilen );
163 
179  unsigned char output[20] );
180 
195  const unsigned char data[64] );
196 
197 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
198 #if defined(MBEDTLS_DEPRECATED_WARNING)
199 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
200 #else
201 #define MBEDTLS_DEPRECATED
202 #endif
203 
216 
232  const unsigned char *input,
233  size_t ilen );
234 
249  unsigned char output[20] );
250 
265  const unsigned char data[64] );
266 
267 #undef MBEDTLS_DEPRECATED
268 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
269 
270 #ifdef __cplusplus
271 }
272 #endif
273 
274 #else /* MBEDTLS_SHA1_ALT */
275 #include "sha1_alt.h"
276 #endif /* MBEDTLS_SHA1_ALT */
277 
278 #ifdef __cplusplus
279 extern "C" {
280 #endif
281 
302 int mbedtls_sha1_ret( const unsigned char *input,
303  size_t ilen,
304  unsigned char output[20] );
305 
306 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
307 #if defined(MBEDTLS_DEPRECATED_WARNING)
308 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
309 #else
310 #define MBEDTLS_DEPRECATED
311 #endif
312 
326 MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input,
327  size_t ilen,
328  unsigned char output[20] );
329 
330 #undef MBEDTLS_DEPRECATED
331 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
332 
344 
345 #ifdef __cplusplus
346 }
347 #endif
348 
349 #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:85
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:310