summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/sha/sha3_internal.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/lib/libcrypto/sha/sha3_internal.h b/src/lib/libcrypto/sha/sha3_internal.h
index 889f12c8e9..05a02c8e2c 100644
--- a/src/lib/libcrypto/sha/sha3_internal.h
+++ b/src/lib/libcrypto/sha/sha3_internal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sha3_internal.h,v 1.8 2023/04/15 18:32:55 jsing Exp $ */ 1/* $OpenBSD: sha3_internal.h,v 1.9 2023/04/15 19:22:34 jsing Exp $ */
2/* 2/*
3 * The MIT License (MIT) 3 * The MIT License (MIT)
4 * 4 *
@@ -29,6 +29,32 @@
29#ifndef HEADER_SHA3_INTERNAL_H 29#ifndef HEADER_SHA3_INTERNAL_H
30#define HEADER_SHA3_INTERNAL_H 30#define HEADER_SHA3_INTERNAL_H
31 31
32#define KECCAK_BIT_WIDTH 1600
33#define KECCAK_BYTE_WIDTH (KECCAK_BIT_WIDTH / 8)
34
35#define SHA3_224_BIT_LENGTH 224
36#define SHA3_224_BITRATE (2 * SHA3_224_BIT_LENGTH)
37#define SHA3_224_CAPACITY (KECCAK_BIT_WIDTH - SHA3_224_BITRATE)
38#define SHA3_224_BLOCK_SIZE (SHA3_224_CAPACITY / 8)
39#define SHA3_224_DIGEST_LENGTH (SHA3_224_BIT_LENGTH / 8)
40
41#define SHA3_256_BIT_LENGTH 256
42#define SHA3_256_BITRATE (2 * SHA3_256_BIT_LENGTH)
43#define SHA3_256_CAPACITY (KECCAK_BIT_WIDTH - SHA3_256_BITRATE)
44#define SHA3_256_BLOCK_SIZE (SHA3_256_CAPACITY / 8)
45#define SHA3_256_DIGEST_LENGTH (SHA3_256_BIT_LENGTH / 8)
46
47#define SHA3_384_BIT_LENGTH 384
48#define SHA3_384_BITRATE (2 * SHA3_384_BIT_LENGTH)
49#define SHA3_384_CAPACITY (KECCAK_BIT_WIDTH - SHA3_384_BITRATE)
50#define SHA3_384_BLOCK_SIZE (SHA3_384_CAPACITY / 8)
51#define SHA3_384_DIGEST_LENGTH (SHA3_384_BIT_LENGTH / 8)
52
53#define SHA3_512_BIT_LENGTH 512
54#define SHA3_512_BITRATE (2 * SHA3_512_BIT_LENGTH)
55#define SHA3_512_CAPACITY (KECCAK_BIT_WIDTH - SHA3_512_BITRATE)
56#define SHA3_512_BLOCK_SIZE (SHA3_512_CAPACITY / 8)
57
32typedef struct { 58typedef struct {
33 union { 59 union {
34 uint8_t b[200]; /* State as 8 bit bytes. */ 60 uint8_t b[200]; /* State as 8 bit bytes. */