nrfxlib API 2.7.99
Loading...
Searching...
No Matches
ocrypto_sha3.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
18#ifndef OCRYPTO_SHA3_H
19#define OCRYPTO_SHA3_H
20
21#include <stddef.h>
22#include <stdint.h>
23
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29
33#define ocrypto_sha3_224_BYTES (28)
34
38#define ocrypto_sha3_256_BYTES (32)
39
43#define ocrypto_sha3_384_BYTES (48)
44
48#define ocrypto_sha3_512_BYTES (64)
49
50
52typedef struct {
53 uint64_t s[25];
54 uint8_t data[8];
55 uint8_t length;
56 uint8_t index;
57} ocrypto_sha3_ctx;
75 ocrypto_sha3_ctx *ctx);
76
92 ocrypto_sha3_ctx *ctx,
93 const uint8_t *in, size_t in_len);
94
110 ocrypto_sha3_ctx *ctx,
111 const uint8_t *in, size_t in_len);
112
128 ocrypto_sha3_ctx *ctx,
129 const uint8_t *in, size_t in_len);
130
146 ocrypto_sha3_ctx *ctx,
147 const uint8_t *in, size_t in_len);
148
166 ocrypto_sha3_ctx *ctx,
167 uint8_t r[ocrypto_sha3_224_BYTES]);
168
186 ocrypto_sha3_ctx *ctx,
187 uint8_t r[ocrypto_sha3_256_BYTES]);
188
206 ocrypto_sha3_ctx *ctx,
207 uint8_t r[ocrypto_sha3_384_BYTES]);
208
226 ocrypto_sha3_ctx *ctx,
227 uint8_t r[ocrypto_sha3_512_BYTES]);
240 uint8_t r[ocrypto_sha3_224_BYTES],
241 const uint8_t *in, size_t in_len);
242
253 uint8_t r[ocrypto_sha3_256_BYTES],
254 const uint8_t *in, size_t in_len);
255
266 uint8_t r[ocrypto_sha3_384_BYTES],
267 const uint8_t *in, size_t in_len);
268
279 uint8_t r[ocrypto_sha3_512_BYTES],
280 const uint8_t *in, size_t in_len);
281
282#ifdef __cplusplus
283}
284#endif
285
286#endif
void ocrypto_sha3_256(uint8_t r[(32)], const uint8_t *in, size_t in_len)
void ocrypto_sha3_384(uint8_t r[(48)], const uint8_t *in, size_t in_len)
#define ocrypto_sha3_256_BYTES
Definition: ocrypto_sha3.h:38
void ocrypto_sha3_224(uint8_t r[(28)], const uint8_t *in, size_t in_len)
void ocrypto_sha3_256_update(ocrypto_sha3_ctx *ctx, const uint8_t *in, size_t in_len)
#define ocrypto_sha3_224_BYTES
Definition: ocrypto_sha3.h:33
void ocrypto_sha3_256_final(ocrypto_sha3_ctx *ctx, uint8_t r[(32)])
void ocrypto_sha3_224_final(ocrypto_sha3_ctx *ctx, uint8_t r[(28)])
void ocrypto_sha3_224_update(ocrypto_sha3_ctx *ctx, const uint8_t *in, size_t in_len)
void ocrypto_sha3_512_final(ocrypto_sha3_ctx *ctx, uint8_t r[(64)])
void ocrypto_sha3_384_final(ocrypto_sha3_ctx *ctx, uint8_t r[(48)])
#define ocrypto_sha3_512_BYTES
Definition: ocrypto_sha3.h:48
#define ocrypto_sha3_384_BYTES
Definition: ocrypto_sha3.h:43
void ocrypto_sha3_512(uint8_t r[(64)], const uint8_t *in, size_t in_len)
void ocrypto_sha3_init(ocrypto_sha3_ctx *ctx)
void ocrypto_sha3_512_update(ocrypto_sha3_ctx *ctx, const uint8_t *in, size_t in_len)
void ocrypto_sha3_384_update(ocrypto_sha3_ctx *ctx, const uint8_t *in, size_t in_len)