ReactOS 0.4.16-dev-197-g92996da
sha1.h
Go to the documentation of this file.
1
13/*
14 * Copyright The Mbed TLS Contributors
15 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
16 *
17 * This file is provided under the Apache License 2.0, or the
18 * GNU General Public License v2.0 or later.
19 *
20 * **********
21 * Apache License 2.0:
22 *
23 * Licensed under the Apache License, Version 2.0 (the "License"); you may
24 * not use this file except in compliance with the License.
25 * You may obtain a copy of the License at
26 *
27 * http://www.apache.org/licenses/LICENSE-2.0
28 *
29 * Unless required by applicable law or agreed to in writing, software
30 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
31 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
34 *
35 * **********
36 *
37 * **********
38 * GNU General Public License v2.0 or later:
39 *
40 * This program is free software; you can redistribute it and/or modify
41 * it under the terms of the GNU General Public License as published by
42 * the Free Software Foundation; either version 2 of the License, or
43 * (at your option) any later version.
44 *
45 * This program is distributed in the hope that it will be useful,
46 * but WITHOUT ANY WARRANTY; without even the implied warranty of
47 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 * GNU General Public License for more details.
49 *
50 * You should have received a copy of the GNU General Public License along
51 * with this program; if not, write to the Free Software Foundation, Inc.,
52 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
53 *
54 * **********
55 */
56#ifndef MBEDTLS_SHA1_H
57#define MBEDTLS_SHA1_H
58
59#if !defined(MBEDTLS_CONFIG_FILE)
60#include "config.h"
61#else
62#include MBEDTLS_CONFIG_FILE
63#endif
64
65#include <stddef.h>
66#include <stdint.h>
67
68/* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */
69#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035
70#define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073
72#ifdef __cplusplus
73extern "C" {
74#endif
75
76#if !defined(MBEDTLS_SHA1_ALT)
77// Regular implementation
78//
79
89{
92 unsigned char buffer[64];
93}
95
96#else /* MBEDTLS_SHA1_ALT */
97#include "sha1_alt.h"
98#endif /* MBEDTLS_SHA1_ALT */
99
112
127
140 const mbedtls_sha1_context *src );
141
156
175 const unsigned char *input,
176 size_t ilen );
177
195 unsigned char output[20] );
196
213 const unsigned char data[64] );
214
215#if !defined(MBEDTLS_DEPRECATED_REMOVED)
216#if defined(MBEDTLS_DEPRECATED_WARNING)
217#define MBEDTLS_DEPRECATED __attribute__((deprecated))
218#else
219#define MBEDTLS_DEPRECATED
220#endif
234
253 const unsigned char *input,
254 size_t ilen );
255
272 unsigned char output[20] );
273
289 const unsigned char data[64] );
290
291#undef MBEDTLS_DEPRECATED
292#endif /* !MBEDTLS_DEPRECATED_REMOVED */
293
317int mbedtls_sha1_ret( const unsigned char *input,
318 size_t ilen,
319 unsigned char output[20] );
320
321#if !defined(MBEDTLS_DEPRECATED_REMOVED)
322#if defined(MBEDTLS_DEPRECATED_WARNING)
323#define MBEDTLS_DEPRECATED __attribute__((deprecated))
324#else
325#define MBEDTLS_DEPRECATED
326#endif
349MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input,
350 size_t ilen,
351 unsigned char output[20] );
352
353#undef MBEDTLS_DEPRECATED
354#endif /* !MBEDTLS_DEPRECATED_REMOVED */
355
356#if defined(MBEDTLS_SELF_TEST)
357
369int mbedtls_sha1_self_test( int verbose );
370
371#endif /* MBEDTLS_SELF_TEST */
372
373#ifdef __cplusplus
374}
375#endif
376
377#endif /* mbedtls_sha1.h */
UINT32 uint32_t
Definition: types.h:75
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLenum GLenum input
Definition: glext.h:9031
MBEDTLS_DEPRECATED void mbedtls_sha1_finish(mbedtls_sha1_context *ctx, unsigned char output[20])
This function finishes the SHA-1 operation, and writes the result to the output buffer.
void mbedtls_sha1_free(mbedtls_sha1_context *ctx)
This function clears a SHA-1 context.
void mbedtls_sha1_clone(mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
This function clones the state of a SHA-1 context.
MBEDTLS_DEPRECATED void mbedtls_sha1_starts(mbedtls_sha1_context *ctx)
This function starts a SHA-1 checksum calculation.
MBEDTLS_DEPRECATED void mbedtls_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
SHA-1 process data block (internal use only).
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.
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.
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
SHA-1 process data block (internal use only).
int mbedtls_sha1_starts_ret(mbedtls_sha1_context *ctx)
This function starts a SHA-1 checksum calculation.
MBEDTLS_DEPRECATED void mbedtls_sha1_update(mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-1 checksum calculation.
#define MBEDTLS_DEPRECATED
Definition: sha1.h:325
MBEDTLS_DEPRECATED void mbedtls_sha1(const unsigned char *input, size_t ilen, unsigned char output[20])
This function calculates the SHA-1 checksum of a buffer.
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.
void mbedtls_sha1_init(mbedtls_sha1_context *ctx)
This function initializes a SHA-1 context.
#define verbose
Definition: rosglue.h:36
The SHA-1 context structure.
Definition: sha1.h:89
uint32_t total[2]
Definition: sha1.h:90
uint32_t state[5]
Definition: sha1.h:91