ReactOS  0.4.13-dev-241-g63286c6
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: GPL-2.0
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  *
24  * This file is part of Mbed TLS (https://tls.mbed.org)
25  */
26 #ifndef MBEDTLS_SHA512_H
27 #define MBEDTLS_SHA512_H
28 
29 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include "config.h"
31 #else
32 #include MBEDTLS_CONFIG_FILE
33 #endif
34 
35 #include <stddef.h>
36 #include <stdint.h>
37 
38 #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039
40 #if !defined(MBEDTLS_SHA512_ALT)
41 // Regular implementation
42 //
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
55 typedef struct
56 {
57  uint64_t total[2];
59  unsigned char buffer[128];
60  int is384;
63 }
65 
72 
79 
87  const mbedtls_sha512_context *src );
88 
101 
113  const unsigned char *input,
114  size_t ilen );
115 
127  unsigned char output[64] );
128 
139  const unsigned char data[128] );
140 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
141 #if defined(MBEDTLS_DEPRECATED_WARNING)
142 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
143 #else
144 #define MBEDTLS_DEPRECATED
145 #endif
146 
158  int is384 );
159 
171  const unsigned char *input,
172  size_t ilen );
173 
184  unsigned char output[64] );
185 
198  const unsigned char data[128] );
199 
200 #undef MBEDTLS_DEPRECATED
201 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #else /* MBEDTLS_SHA512_ALT */
208 #include "sha512_alt.h"
209 #endif /* MBEDTLS_SHA512_ALT */
210 
211 #ifdef __cplusplus
212 extern "C" {
213 #endif
214 
234 int mbedtls_sha512_ret( const unsigned char *input,
235  size_t ilen,
236  unsigned char output[64],
237  int is384 );
238 
239 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
240 #if defined(MBEDTLS_DEPRECATED_WARNING)
241 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
242 #else
243 #define MBEDTLS_DEPRECATED
244 #endif
245 
264 MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input,
265  size_t ilen,
266  unsigned char output[64],
267  int is384 );
268 
269 #undef MBEDTLS_DEPRECATED
270 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
271 
277 
278 #ifdef __cplusplus
279 }
280 #endif
281 
282 #endif /* mbedtls_sha512.h */
#define MBEDTLS_DEPRECATED
Definition: sha512.h:243
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:55
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....