]> git.codecow.com Git - Monocypher.git/commitdiff
Cosmetic. compact grouping of vtables
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 2 May 2020 20:18:15 +0000 (22:18 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sat, 2 May 2020 20:18:15 +0000 (22:18 +0200)
src/monocypher.c
src/optional/monocypher-ed25519.c

index 9ae1dbf9c0a229414a6aff41f4139a2f840c4d32..c588f22e215c86c78aaa5e36c7242f36a9658692 100644 (file)
@@ -680,21 +680,15 @@ void crypto_blake2b(u8 hash[64], const u8 *message, size_t message_size)
     crypto_blake2b_general(hash, 64, 0, 0, message, message_size);
 }
 
-static void blake2b_vtable_init(void *ctx)
-{
+static void blake2b_vtable_init(void *ctx) {
     crypto_blake2b_init(&((crypto_sign_ctx*)ctx)->hash);
 }
-
-static void blake2b_vtable_update(void *ctx, const u8 *m, size_t s)
-{
+static void blake2b_vtable_update(void *ctx, const u8 *m, size_t s) {
     crypto_blake2b_update(&((crypto_sign_ctx*)ctx)->hash, m, s);
 }
-
-static void blake2b_vtable_final(void *ctx, u8 *h)
-{
+static void blake2b_vtable_final(void *ctx, u8 *h) {
     crypto_blake2b_final(&((crypto_sign_ctx*)ctx)->hash, h);
 }
-
 const crypto_sign_vtable crypto_blake2b_vtable = {
     crypto_blake2b,
     blake2b_vtable_init,
index 92846efe0ebea5204d658087e1934389e1b68ddf..f173fd8927352efabba378730b3d01f3b6126b46 100644 (file)
@@ -279,21 +279,15 @@ void crypto_sha512(u8 hash[64], const u8 *message, size_t message_size)
     crypto_sha512_final (&ctx, hash);
 }
 
-static void sha512_vtable_init(void *ctx)
-{
+static void sha512_vtable_init(void *ctx) {
     crypto_sha512_init(&((crypto_sign_ed25519_ctx*)ctx)->hash);
 }
-
-static void sha512_vtable_update(void *ctx, const u8 *m, size_t s)
-{
+static void sha512_vtable_update(void *ctx, const u8 *m, size_t s) {
     crypto_sha512_update(&((crypto_sign_ed25519_ctx*)ctx)->hash, m, s);
 }
-
-static void sha512_vtable_final(void *ctx, u8 *h)
-{
+static void sha512_vtable_final(void *ctx, u8 *h) {
     crypto_sha512_final(&((crypto_sign_ed25519_ctx*)ctx)->hash, h);
 }
-
 const crypto_sign_vtable crypto_sha512_vtable = {
     crypto_sha512,
     sha512_vtable_init,