From f1875ee5c1712f5aad290f32e56c4bf9c75f32ef Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 15 Apr 2023 18:14:21 +0000 Subject: Strip and reformat comments. Remove various comments that are unhelpful or obvious. Reformat remaining comments per style(9). --- src/lib/libcrypto/sha/sha3_internal.h | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/lib/libcrypto/sha/sha3_internal.h') diff --git a/src/lib/libcrypto/sha/sha3_internal.h b/src/lib/libcrypto/sha/sha3_internal.h index 1b4c6675ad..3227e6120f 100644 --- a/src/lib/libcrypto/sha/sha3_internal.h +++ b/src/lib/libcrypto/sha/sha3_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sha3_internal.h,v 1.3 2023/04/15 18:07:44 jsing Exp $ */ +/* $OpenBSD: sha3_internal.h,v 1.4 2023/04/15 18:14:21 jsing Exp $ */ /* * The MIT License (MIT) * @@ -23,9 +23,6 @@ * SOFTWARE. */ -// sha3.h -// 19-Nov-11 Markku-Juhani O. Saarinen - #ifndef SHA3_H #define SHA3_H @@ -40,27 +37,23 @@ #define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) #endif -// state context typedef struct { - union { // state: - uint8_t b[200]; // 8-bit bytes - uint64_t q[25]; // 64-bit words + union { + uint8_t b[200]; /* State as 8 bit bytes. */ + uint64_t q[25]; /* State as 64 bit words. */ } st; - int pt, rsiz, mdlen; // these don't overflow + int pt, rsiz, mdlen; } sha3_ctx_t; -// Compression function. void sha3_keccakf(uint64_t st[25]); -// OpenSSL - like interfece -int sha3_init(sha3_ctx_t *c, int mdlen); // mdlen = hash output in bytes +int sha3_init(sha3_ctx_t *c, int mdlen); int sha3_update(sha3_ctx_t *c, const void *data, size_t len); -int sha3_final(void *md, sha3_ctx_t *c); // digest goes to md +int sha3_final(void *md, sha3_ctx_t *c); -// compute a sha3 hash (md) of given byte length from "in" void *sha3(const void *in, size_t inlen, void *md, int mdlen); -// SHAKE128 and SHAKE256 extensible-output functions +/* SHAKE128 and SHAKE256 extensible-output functions. */ #define shake128_init(c) sha3_init(c, 16) #define shake256_init(c) sha3_init(c, 32) #define shake_update sha3_update @@ -69,4 +62,3 @@ void shake_xof(sha3_ctx_t *c); void shake_out(sha3_ctx_t *c, void *out, size_t len); #endif - -- cgit v1.2.3-55-g6feb