Mbed TLS v3.6.7
Toggle main menu visibility
Loading...
Searching...
No Matches
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
#ifndef MBEDTLS_SHA1_H
18
#define MBEDTLS_SHA1_H
19
#include "
mbedtls/private_access.h
"
20
21
#include "
mbedtls/build_info.h
"
22
23
#include <stddef.h>
24
#include <stdint.h>
25
27
#define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073
28
29
#ifdef __cplusplus
30
extern
"C"
{
31
#endif
32
33
#if !defined(MBEDTLS_SHA1_ALT)
34
// Regular implementation
35
//
36
45
typedef
struct
mbedtls_sha1_context
{
46
uint32_t
MBEDTLS_PRIVATE
(total)[2];
47
uint32_t
MBEDTLS_PRIVATE
(state)[5];
48
unsigned
char
MBEDTLS_PRIVATE
(buffer)[64];
49
}
50
mbedtls_sha1_context
;
51
52
#else
/* MBEDTLS_SHA1_ALT */
53
#include "
sha1_alt.h
"
54
#endif
/* MBEDTLS_SHA1_ALT */
55
67
void
mbedtls_sha1_init
(
mbedtls_sha1_context
*ctx);
68
82
void
mbedtls_sha1_free
(
mbedtls_sha1_context
*ctx);
83
95
void
mbedtls_sha1_clone
(
mbedtls_sha1_context
*dst,
96
const
mbedtls_sha1_context
*src);
97
111
int
mbedtls_sha1_starts
(
mbedtls_sha1_context
*ctx);
112
130
int
mbedtls_sha1_update
(
mbedtls_sha1_context
*ctx,
131
const
unsigned
char
*input,
132
size_t
ilen);
133
150
int
mbedtls_sha1_finish
(
mbedtls_sha1_context
*ctx,
151
unsigned
char
output[20]);
152
168
int
mbedtls_internal_sha1_process
(
mbedtls_sha1_context
*ctx,
169
const
unsigned
char
data[64]);
170
194
int
mbedtls_sha1
(
const
unsigned
char
*input,
195
size_t
ilen,
196
unsigned
char
output[20]);
197
198
#if defined(MBEDTLS_SELF_TEST)
199
211
int
mbedtls_sha1_self_test
(
int
verbose);
212
213
#endif
/* MBEDTLS_SELF_TEST */
214
215
#ifdef __cplusplus
216
}
217
#endif
218
219
#endif
/* mbedtls_sha1.h */
build_info.h
Build-time configuration info.
private_access.h
Macro wrapper for struct's members.
MBEDTLS_PRIVATE
#define MBEDTLS_PRIVATE(member)
Definition
private_access.h:15
mbedtls_sha1_free
void mbedtls_sha1_free(mbedtls_sha1_context *ctx)
This function clears a SHA-1 context.
mbedtls_sha1_clone
void mbedtls_sha1_clone(mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
This function clones the state of a SHA-1 context.
mbedtls_sha1_self_test
int mbedtls_sha1_self_test(int verbose)
The SHA-1 checkup routine.
mbedtls_internal_sha1_process
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
SHA-1 process data block (internal use only).
mbedtls_sha1_update
int 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.
mbedtls_sha1
int mbedtls_sha1(const unsigned char *input, size_t ilen, unsigned char output[20])
This function calculates the SHA-1 checksum of a buffer.
mbedtls_sha1_finish
int 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.
mbedtls_sha1_starts
int mbedtls_sha1_starts(mbedtls_sha1_context *ctx)
This function starts a SHA-1 checksum calculation.
mbedtls_sha1_init
void mbedtls_sha1_init(mbedtls_sha1_context *ctx)
This function initializes a SHA-1 context.
sha1_alt.h
mbedtls_sha1_context
The SHA-1 context structure.
Definition
sha1.h:45
include
mbedtls
sha1.h
Generated on
for Mbed TLS v3.6.7 by
1.17.0