Mbed TLS v3.6.7
Toggle main menu visibility
Loading...
Searching...
No Matches
sha3.h
Go to the documentation of this file.
1
10
/*
11
* Copyright The Mbed TLS Contributors
12
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
13
*/
14
15
#ifndef MBEDTLS_SHA3_H
16
#define MBEDTLS_SHA3_H
17
#include "
mbedtls/private_access.h
"
18
19
#include "
mbedtls/build_info.h
"
20
21
#include <stddef.h>
22
#include <stdint.h>
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
29
#define MBEDTLS_ERR_SHA3_BAD_INPUT_DATA -0x0076
30
36
37
typedef
enum
{
38
MBEDTLS_SHA3_NONE
= 0,
39
MBEDTLS_SHA3_224
,
40
MBEDTLS_SHA3_256
,
41
MBEDTLS_SHA3_384
,
42
MBEDTLS_SHA3_512
,
43
}
mbedtls_sha3_id
;
44
50
typedef
struct
{
51
uint64_t
MBEDTLS_PRIVATE
(state[25]);
52
uint32_t
MBEDTLS_PRIVATE
(index);
53
uint16_t
MBEDTLS_PRIVATE
(olen);
54
uint16_t
MBEDTLS_PRIVATE
(max_block_size);
55
}
56
mbedtls_sha3_context
;
57
63
void
mbedtls_sha3_init
(
mbedtls_sha3_context
*ctx);
64
72
void
mbedtls_sha3_free
(
mbedtls_sha3_context
*ctx);
73
80
void
mbedtls_sha3_clone
(
mbedtls_sha3_context
*dst,
81
const
mbedtls_sha3_context
*src);
82
93
int
mbedtls_sha3_starts
(
mbedtls_sha3_context
*ctx,
mbedtls_sha3_id
id
);
94
108
int
mbedtls_sha3_update
(
mbedtls_sha3_context
*ctx,
109
const
uint8_t *input,
110
size_t
ilen);
111
127
int
mbedtls_sha3_finish
(
mbedtls_sha3_context
*ctx,
128
uint8_t *output,
size_t
olen);
129
153
int
mbedtls_sha3
(
mbedtls_sha3_id
id
,
const
uint8_t *input,
154
size_t
ilen,
155
uint8_t *output,
156
size_t
olen);
157
158
#if defined(MBEDTLS_SELF_TEST)
165
int
mbedtls_sha3_self_test
(
int
verbose);
166
#endif
/* MBEDTLS_SELF_TEST */
167
168
#ifdef __cplusplus
169
}
170
#endif
171
172
#endif
/* mbedtls_sha3.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_sha3_free
void mbedtls_sha3_free(mbedtls_sha3_context *ctx)
This function clears a SHA-3 context.
mbedtls_sha3_clone
void mbedtls_sha3_clone(mbedtls_sha3_context *dst, const mbedtls_sha3_context *src)
This function clones the state of a SHA-3 context.
mbedtls_sha3_id
mbedtls_sha3_id
Definition
sha3.h:37
MBEDTLS_SHA3_512
@ MBEDTLS_SHA3_512
Definition
sha3.h:42
MBEDTLS_SHA3_NONE
@ MBEDTLS_SHA3_NONE
Definition
sha3.h:38
MBEDTLS_SHA3_224
@ MBEDTLS_SHA3_224
Definition
sha3.h:39
MBEDTLS_SHA3_256
@ MBEDTLS_SHA3_256
Definition
sha3.h:40
MBEDTLS_SHA3_384
@ MBEDTLS_SHA3_384
Definition
sha3.h:41
mbedtls_sha3_finish
int mbedtls_sha3_finish(mbedtls_sha3_context *ctx, uint8_t *output, size_t olen)
This function finishes the SHA-3 operation, and writes the result to the output buffer.
mbedtls_sha3
int mbedtls_sha3(mbedtls_sha3_id id, const uint8_t *input, size_t ilen, uint8_t *output, size_t olen)
This function calculates the SHA-3 checksum of a buffer.
mbedtls_sha3_init
void mbedtls_sha3_init(mbedtls_sha3_context *ctx)
This function initializes a SHA-3 context.
mbedtls_sha3_self_test
int mbedtls_sha3_self_test(int verbose)
Checkup routine for the algorithms implemented by this module: SHA3-224, SHA3-256,...
mbedtls_sha3_starts
int mbedtls_sha3_starts(mbedtls_sha3_context *ctx, mbedtls_sha3_id id)
This function starts a SHA-3 checksum calculation.
mbedtls_sha3_update
int mbedtls_sha3_update(mbedtls_sha3_context *ctx, const uint8_t *input, size_t ilen)
This function feeds an input buffer into an ongoing SHA-3 checksum calculation.
mbedtls_sha3_context
The SHA-3 context structure.
Definition
sha3.h:50
include
mbedtls
sha3.h
Generated on
for Mbed TLS v3.6.7 by
1.17.0