nrfxlib API 3.3.99
Loading...
Searching...
No Matches
ocrypto_sha3.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2025 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
30#ifndef OCRYPTO_SHA3_H
31#define OCRYPTO_SHA3_H
32
33#include <stddef.h>
34#include <stdint.h>
35
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41
45#define ocrypto_sha3_224_BYTES (28)
46
50#define ocrypto_sha3_256_BYTES (32)
51
55#define ocrypto_sha3_384_BYTES (48)
56
60#define ocrypto_sha3_512_BYTES (64)
61
62
64typedef struct {
65 uint64_t s[25];
66 uint8_t data[8];
67 uint8_t length;
68 uint8_t index;
69} ocrypto_sha3_ctx;
89 ocrypto_sha3_ctx *ctx);
90
106 ocrypto_sha3_ctx *ctx,
107 const uint8_t *in, size_t in_len);
108
124 ocrypto_sha3_ctx *ctx,
125 const uint8_t *in, size_t in_len);
126
142 ocrypto_sha3_ctx *ctx,
143 const uint8_t *in, size_t in_len);
144
160 ocrypto_sha3_ctx *ctx,
161 const uint8_t *in, size_t in_len);
162
180 ocrypto_sha3_ctx *ctx,
181 uint8_t r[ocrypto_sha3_224_BYTES]);
182
200 ocrypto_sha3_ctx *ctx,
201 uint8_t r[ocrypto_sha3_256_BYTES]);
202
220 ocrypto_sha3_ctx *ctx,
221 uint8_t r[ocrypto_sha3_384_BYTES]);
222
240 ocrypto_sha3_ctx *ctx,
241 uint8_t r[ocrypto_sha3_512_BYTES]);
254 uint8_t r[ocrypto_sha3_224_BYTES],
255 const uint8_t *in, size_t in_len);
256
267 uint8_t r[ocrypto_sha3_256_BYTES],
268 const uint8_t *in, size_t in_len);
269
280 uint8_t r[ocrypto_sha3_384_BYTES],
281 const uint8_t *in, size_t in_len);
282
293 uint8_t r[ocrypto_sha3_512_BYTES],
294 const uint8_t *in, size_t in_len);
295
296#ifdef __cplusplus
297}
298#endif
299
300#endif
301
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:50
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:45
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:60
#define ocrypto_sha3_384_BYTES
Definition ocrypto_sha3.h:55
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)