ReactOS  0.4.15-dev-1171-gab82533
sha512.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
8  * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9  *
10  * This file is provided under the Apache License 2.0, or the
11  * GNU General Public License v2.0 or later.
12  *
13  * **********
14  * Apache License 2.0:
15  *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may
17  * not use this file except in compliance with the License.
18  * You may obtain a copy of the License at
19  *
20  * http://www.apache.org/licenses/LICENSE-2.0
21  *
22  * Unless required by applicable law or agreed to in writing, software
23  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25  * See the License for the specific language governing permissions and
26  * limitations under the License.
27  *
28  * **********
29  *
30  * **********
31  * GNU General Public License v2.0 or later:
32  *
33  * This program is free software; you can redistribute it and/or modify
34  * it under the terms of the GNU General Public License as published by
35  * the Free Software Foundation; either version 2 of the License, or
36  * (at your option) any later version.
37  *
38  * This program is distributed in the hope that it will be useful,
39  * but WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41  * GNU General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License along
44  * with this program; if not, write to the Free Software Foundation, Inc.,
45  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
46  *
47  * **********
48  *
49  * This file is part of Mbed TLS (https://tls.mbed.org)
50  */
51 #ifndef MBEDTLS_SHA512_H
52 #define MBEDTLS_SHA512_H
53 
54 #if !defined(MBEDTLS_CONFIG_FILE)
55 #include "config.h"
56 #else
57 #include MBEDTLS_CONFIG_FILE
58 #endif
59 
60 #include <stddef.h>
61 #include <stdint.h>
62 
63 #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039
65 #if !defined(MBEDTLS_SHA512_ALT)
66 // Regular implementation
67 //
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
80 typedef struct
81 {
82  uint64_t total[2];
84  unsigned char buffer[128];
85  int is384;
88 }
90 
97 
104 
112  const mbedtls_sha512_context *src );
113 
126 
138  const unsigned char *input,
139  size_t ilen );
140 
152  unsigned char output[64] );
153 
164  const unsigned char data[128] );
165 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
166 #if defined(MBEDTLS_DEPRECATED_WARNING)
167 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
168 #else
169 #define MBEDTLS_DEPRECATED
170 #endif
171 
183  int is384 );
184 
196  const unsigned char *input,
197  size_t ilen );
198 
209  unsigned char output[64] );
210 
223  const unsigned char data[128] );
224 
225 #undef MBEDTLS_DEPRECATED
226 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
227 
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #else /* MBEDTLS_SHA512_ALT */
233 #include "sha512_alt.h"
234 #endif /* MBEDTLS_SHA512_ALT */
235 
236 #ifdef __cplusplus
237 extern "C" {
238 #endif
239 
259 int mbedtls_sha512_ret( const unsigned char *input,
260  size_t ilen,
261  unsigned char output[64],
262  int is384 );
263 
264 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
265 #if defined(MBEDTLS_DEPRECATED_WARNING)
266 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
267 #else
268 #define MBEDTLS_DEPRECATED
269 #endif
270 
289 MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input,
290  size_t ilen,
291  unsigned char output[64],
292  int is384 );
293 
294 #undef MBEDTLS_DEPRECATED
295 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
296 
302 
303 #ifdef __cplusplus
304 }
305 #endif
306 
307 #endif /* mbedtls_sha512.h */
#define MBEDTLS_DEPRECATED
Definition: sha512.h:268
void mbedtls_sha512_clone(mbedtls_sha512_context *dst, const mbedtls_sha512_context *src)
This function clones the state of a SHA-512 context.
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
void mbedtls_sha512_init(mbedtls_sha512_context *ctx)
This function initializes a SHA-512 context.
int mbedtls_sha512_finish_ret(mbedtls_sha512_context *ctx, unsigned char output[64])
This function finishes the SHA-512 operation, and writes the result to the output buffer....
MBEDTLS_DEPRECATED void mbedtls_sha512_update(mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-512 checksum calculation.
GLuint buffer
Definition: glext.h:5915
MBEDTLS_DEPRECATED void mbedtls_sha512(const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
This function calculates the SHA-512 or SHA-384 checksum of a buffer.
#define verbose
Definition: rosglue.h:36
The SHA-512 context structure.
Definition: sha512.h:80
int mbedtls_sha512_starts_ret(mbedtls_sha512_context *ctx, int is384)
This function starts a SHA-384 or SHA-512 checksum calculation.
int mbedtls_sha512_self_test(int verbose)
The SHA-384 or SHA-512 checkup routine.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
MBEDTLS_DEPRECATED void mbedtls_sha512_finish(mbedtls_sha512_context *ctx, unsigned char output[64])
This function finishes the SHA-512 operation, and writes the result to the output buffer.
static int state
Definition: maze.c:121
GLenum src
Definition: glext.h:6340
int mbedtls_internal_sha512_process(mbedtls_sha512_context *ctx, const unsigned char data[128])
This function processes a single data block within the ongoing SHA-512 computation.
UINT64 uint64_t
Definition: types.h:77
GLenum GLenum GLenum input
Definition: glext.h:9031
GLenum GLenum dst
Definition: glext.h:6340
void mbedtls_sha512_free(mbedtls_sha512_context *ctx)
This function clears a SHA-512 context.
int mbedtls_sha512_ret(const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
This function calculates the SHA-512 or SHA-384 checksum of a buffer.
MBEDTLS_DEPRECATED void mbedtls_sha512_starts(mbedtls_sha512_context *ctx, int is384)
This function starts a SHA-384 or SHA-512 checksum calculation.
int mbedtls_sha512_update_ret(mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-512 checksum calculation.
MBEDTLS_DEPRECATED void mbedtls_sha512_process(mbedtls_sha512_context *ctx, const unsigned char data[128])
This function processes a single data block within the ongoing SHA-512 computation....