]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Whitespace changes to sha3 prototypes.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 29 Apr 2025 17:48:05 +0000 (19:48 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 29 Apr 2025 17:48:05 +0000 (19:48 +0200)
sha3-224.c
sha3-256.c
sha3-384.c
sha3-512.c
sha3.h
shake128.c
shake256.c

index 0ed26d884ae34f6f57ddc713df406450e7ffde77..08afce69fee7229343f6d7f4f0d49c5c9dc1a263 100644 (file)
@@ -50,9 +50,7 @@ sha3_224_init (struct sha3_224_ctx *ctx)
 }
 
 void
-sha3_224_update (struct sha3_224_ctx *ctx,
-                size_t length,
-                const uint8_t *data)
+sha3_224_update (struct sha3_224_ctx *ctx, size_t length, const uint8_t *data)
 {
   ctx->index = _nettle_sha3_update (&ctx->state,
                                    SHA3_224_BLOCK_SIZE, ctx->block,
@@ -60,8 +58,7 @@ sha3_224_update (struct sha3_224_ctx *ctx,
 }
 
 void
-sha3_224_digest(struct sha3_224_ctx *ctx,
-               uint8_t *digest)
+sha3_224_digest(struct sha3_224_ctx *ctx, uint8_t *digest)
 {
   _sha3_pad_hash (&ctx->state, SHA3_224_BLOCK_SIZE, ctx->block, ctx->index);
   _nettle_write_le64 (SHA3_224_DIGEST_SIZE, digest, ctx->state.a);
index 1d891900a6a163e50051804e6afc521acbc54abb..c347e13bc3689d97e449223f37f66ea68d43c97e 100644 (file)
@@ -50,9 +50,7 @@ sha3_256_init (struct sha3_256_ctx *ctx)
 }
 
 void
-sha3_256_update (struct sha3_256_ctx *ctx,
-                size_t length,
-                const uint8_t *data)
+sha3_256_update (struct sha3_256_ctx *ctx, size_t length, const uint8_t *data)
 {
   ctx->index = _nettle_sha3_update (&ctx->state,
                                    SHA3_256_BLOCK_SIZE, ctx->block,
@@ -60,8 +58,7 @@ sha3_256_update (struct sha3_256_ctx *ctx,
 }
 
 void
-sha3_256_digest(struct sha3_256_ctx *ctx,
-               uint8_t *digest)
+sha3_256_digest(struct sha3_256_ctx *ctx, uint8_t *digest)
 {
   _sha3_pad_hash (&ctx->state, SHA3_256_BLOCK_SIZE, ctx->block, ctx->index);
   _nettle_write_le64 (SHA3_256_DIGEST_SIZE, digest, ctx->state.a);
index 0f58892f43d98d3afc03a64485f7b60bfbbdd64d..ea8dd038ee0633ee2fcd65877285e52ac2514a85 100644 (file)
@@ -50,9 +50,7 @@ sha3_384_init (struct sha3_384_ctx *ctx)
 }
 
 void
-sha3_384_update (struct sha3_384_ctx *ctx,
-                size_t length,
-                const uint8_t *data)
+sha3_384_update (struct sha3_384_ctx *ctx, size_t length, const uint8_t *data)
 {
   ctx->index = _nettle_sha3_update (&ctx->state,
                                    SHA3_384_BLOCK_SIZE, ctx->block,
@@ -60,8 +58,7 @@ sha3_384_update (struct sha3_384_ctx *ctx,
 }
 
 void
-sha3_384_digest(struct sha3_384_ctx *ctx,
-               uint8_t *digest)
+sha3_384_digest(struct sha3_384_ctx *ctx, uint8_t *digest)
 {
   _sha3_pad_hash (&ctx->state, SHA3_384_BLOCK_SIZE, ctx->block, ctx->index);
   _nettle_write_le64 (SHA3_384_DIGEST_SIZE, digest, ctx->state.a);
index 2f0a62b39c02f43f0c4d42048b92a9eb4e980633..9ae014dca1489fdbe00982b6a1370585baf9bc77 100644 (file)
@@ -50,9 +50,7 @@ sha3_512_init (struct sha3_512_ctx *ctx)
 }
 
 void
-sha3_512_update (struct sha3_512_ctx *ctx,
-                size_t length,
-                const uint8_t *data)
+sha3_512_update (struct sha3_512_ctx *ctx, size_t length, const uint8_t *data)
 {
   ctx->index = _nettle_sha3_update (&ctx->state,
                                    SHA3_512_BLOCK_SIZE, ctx->block,
@@ -60,8 +58,7 @@ sha3_512_update (struct sha3_512_ctx *ctx,
 }
 
 void
-sha3_512_digest(struct sha3_512_ctx *ctx,
-               uint8_t *digest)
+sha3_512_digest(struct sha3_512_ctx *ctx, uint8_t *digest)
 {
   _sha3_pad_hash (&ctx->state, SHA3_512_BLOCK_SIZE, ctx->block, ctx->index);
   _nettle_write_le64 (SHA3_512_DIGEST_SIZE, digest, ctx->state.a);
diff --git a/sha3.h b/sha3.h
index 5cd9ee1a018f99680248924700d7799eba1bdd25..c499f395b6ce4bc28abf953dfac981c265598b00 100644 (file)
--- a/sha3.h
+++ b/sha3.h
@@ -109,19 +109,13 @@ void
 sha3_128_init (struct sha3_128_ctx *ctx);
 
 void
-sha3_128_update (struct sha3_128_ctx *ctx,
-                size_t length,
-                const uint8_t *data);
+sha3_128_update (struct sha3_128_ctx *ctx, size_t length, const uint8_t *data);
 
 void
-sha3_128_shake (struct sha3_128_ctx *ctx,
-               size_t length,
-               uint8_t *digest);
+sha3_128_shake (struct sha3_128_ctx *ctx, size_t length, uint8_t *digest);
 
 void
-sha3_128_shake_output (struct sha3_128_ctx *ctx,
-                      size_t length,
-                      uint8_t *digest);
+sha3_128_shake_output (struct sha3_128_ctx *ctx, size_t length, uint8_t *digest);
 
 struct sha3_224_ctx
 {
@@ -134,13 +128,10 @@ void
 sha3_224_init (struct sha3_224_ctx *ctx);
 
 void
-sha3_224_update (struct sha3_224_ctx *ctx,
-                size_t length,
-                const uint8_t *data);
+sha3_224_update (struct sha3_224_ctx *ctx, size_t length, const uint8_t *data);
 
 void
-sha3_224_digest(struct sha3_224_ctx *ctx,
-               uint8_t *digest);
+sha3_224_digest(struct sha3_224_ctx *ctx, uint8_t *digest);
 
 struct sha3_256_ctx
 {
@@ -153,27 +144,20 @@ void
 sha3_256_init (struct sha3_256_ctx *ctx);
 
 void
-sha3_256_update (struct sha3_256_ctx *ctx,
-                size_t length,
-                const uint8_t *data);
+sha3_256_update (struct sha3_256_ctx *ctx, size_t length, const uint8_t *data);
 
 void
-sha3_256_digest(struct sha3_256_ctx *ctx,
-               uint8_t *digest);
+sha3_256_digest(struct sha3_256_ctx *ctx, uint8_t *digest);
 
 /* Alternative digest function implementing shake256, with arbitrary
    digest size */
 void
-sha3_256_shake(struct sha3_256_ctx *ctx,
-              size_t length,
-              uint8_t *digest);
+sha3_256_shake(struct sha3_256_ctx *ctx, size_t length, uint8_t *digest);
 
 /* Unlike sha3_256_shake, this function can be called multiple times
    to retrieve output from shake256 in an incremental manner */
 void
-sha3_256_shake_output(struct sha3_256_ctx *ctx,
-                     size_t length,
-                     uint8_t *digest);
+sha3_256_shake_output(struct sha3_256_ctx *ctx, size_t length, uint8_t *digest);
 
 struct sha3_384_ctx
 {
@@ -186,13 +170,10 @@ void
 sha3_384_init (struct sha3_384_ctx *ctx);
 
 void
-sha3_384_update (struct sha3_384_ctx *ctx,
-                size_t length,
-                const uint8_t *data);
+sha3_384_update (struct sha3_384_ctx *ctx, size_t length, const uint8_t *data);
 
 void
-sha3_384_digest(struct sha3_384_ctx *ctx,
-               uint8_t *digest);
+sha3_384_digest(struct sha3_384_ctx *ctx, uint8_t *digest);
 
 struct sha3_512_ctx
 {
@@ -205,13 +186,10 @@ void
 sha3_512_init (struct sha3_512_ctx *ctx);
 
 void
-sha3_512_update (struct sha3_512_ctx *ctx,
-                size_t length,
-                const uint8_t *data);
+sha3_512_update (struct sha3_512_ctx *ctx, size_t length, const uint8_t *data);
 
 void
-sha3_512_digest(struct sha3_512_ctx *ctx,
-               uint8_t *digest);
+sha3_512_digest(struct sha3_512_ctx *ctx, uint8_t *digest);
 
 #ifdef __cplusplus
 }
index f0eb7e243a869f740c27bc576b319828a598c145..f0c68e7d88dcbe31d57316074fc011d58aecb4ac 100644 (file)
@@ -48,9 +48,7 @@ sha3_128_init (struct sha3_128_ctx *ctx)
 }
 
 void
-sha3_128_update (struct sha3_128_ctx *ctx,
-                size_t length,
-                const uint8_t *data)
+sha3_128_update (struct sha3_128_ctx *ctx, size_t length, const uint8_t *data)
 {
   ctx->index = _nettle_sha3_update (&ctx->state,
                                    SHA3_128_BLOCK_SIZE, ctx->block,
@@ -58,16 +56,14 @@ sha3_128_update (struct sha3_128_ctx *ctx,
 }
 
 void
-sha3_128_shake (struct sha3_128_ctx *ctx,
-               size_t length, uint8_t *dst)
+sha3_128_shake (struct sha3_128_ctx *ctx, size_t length, uint8_t *dst)
 {
   _nettle_sha3_shake (&ctx->state, sizeof (ctx->block), ctx->block, ctx->index, length, dst);
   sha3_128_init (ctx);
 }
 
 void
-sha3_128_shake_output (struct sha3_128_ctx *ctx,
-                      size_t length, uint8_t *digest)
+sha3_128_shake_output (struct sha3_128_ctx *ctx, size_t length, uint8_t *digest)
 {
   ctx->index =
     _nettle_sha3_shake_output (&ctx->state,
index 721c6ae0fd2079aff0a6df6ff3857b6ad203c2e5..de72cf96d2355bf8534ce2c9aaeacb94f6ef1382 100644 (file)
 #include "sha3-internal.h"
 
 void
-sha3_256_shake (struct sha3_256_ctx *ctx,
-               size_t length, uint8_t *dst)
+sha3_256_shake (struct sha3_256_ctx *ctx, size_t length, uint8_t *dst)
 {
   _nettle_sha3_shake (&ctx->state, sizeof (ctx->block), ctx->block, ctx->index, length, dst);
   sha3_256_init (ctx);
 }
 
 void
-sha3_256_shake_output (struct sha3_256_ctx *ctx,
-                      size_t length, uint8_t *digest)
+sha3_256_shake_output (struct sha3_256_ctx *ctx, size_t length, uint8_t *digest)
 {
   ctx->index =
     _nettle_sha3_shake_output (&ctx->state,