diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2024-03-06 11:32:23 +0100 |
---|---|---|
committer | t3serakt <t3ss@posteo.de> | 2024-04-10 20:14:48 +0200 |
commit | 441941665b702d1d4db420f2050f19360b7ec1b4 (patch) | |
tree | e3c84ad34ade8fbd6e7c3f57617a7ba27c6646d0 | |
parent | 05ebeafbc122e11e13471365659d8bea8dd31e83 (diff) | |
download | gnunet-441941665b702d1d4db420f2050f19360b7ec1b4.tar.gz gnunet-441941665b702d1d4db420f2050f19360b7ec1b4.zip |
- uncrustify code
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 88 | ||||
-rw-r--r-- | src/lib/util/crypto_elligator.c | 2 | ||||
-rw-r--r-- | src/service/transport/gnunet-communicator-udp.c | 4 |
3 files changed, 47 insertions, 47 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index a19e1e519..168f934e1 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -973,7 +973,7 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, | |||
973 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding | 973 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding |
974 | */ | 974 | */ |
975 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ | 975 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ |
976 | GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result) | 976 | GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result) |
977 | 977 | ||
978 | 978 | ||
979 | /** | 979 | /** |
@@ -2215,15 +2215,15 @@ GNUNET_CRYPTO_eddsa_sign_ ( | |||
2215 | * @param[out] sig where to write the signature | 2215 | * @param[out] sig where to write the signature |
2216 | */ | 2216 | */ |
2217 | #define GNUNET_CRYPTO_eddsa_sign(priv,ps,sig) do { \ | 2217 | #define GNUNET_CRYPTO_eddsa_sign(priv,ps,sig) do { \ |
2218 | /* check size is set correctly */ \ | 2218 | /* check size is set correctly */ \ |
2219 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*ps)); \ | 2219 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*ps)); \ |
2220 | /* check 'ps' begins with the purpose */ \ | 2220 | /* check 'ps' begins with the purpose */ \ |
2221 | GNUNET_static_assert (((void*) (ps)) == \ | 2221 | GNUNET_static_assert (((void*) (ps)) == \ |
2222 | ((void*) &(ps)->purpose)); \ | 2222 | ((void*) &(ps)->purpose)); \ |
2223 | GNUNET_assert (GNUNET_OK == \ | 2223 | GNUNET_assert (GNUNET_OK == \ |
2224 | GNUNET_CRYPTO_eddsa_sign_ (priv, \ | 2224 | GNUNET_CRYPTO_eddsa_sign_ (priv, \ |
2225 | &(ps)->purpose, \ | 2225 | &(ps)->purpose, \ |
2226 | sig)); \ | 2226 | sig)); \ |
2227 | } while (0) | 2227 | } while (0) |
2228 | 2228 | ||
2229 | 2229 | ||
@@ -2277,15 +2277,15 @@ GNUNET_CRYPTO_eddsa_sign_raw ( | |||
2277 | * @param[out] sig where to write the signature | 2277 | * @param[out] sig where to write the signature |
2278 | */ | 2278 | */ |
2279 | #define GNUNET_CRYPTO_ecdsa_sign(priv,ps,sig) do { \ | 2279 | #define GNUNET_CRYPTO_ecdsa_sign(priv,ps,sig) do { \ |
2280 | /* check size is set correctly */ \ | 2280 | /* check size is set correctly */ \ |
2281 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ | 2281 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ |
2282 | /* check 'ps' begins with the purpose */ \ | 2282 | /* check 'ps' begins with the purpose */ \ |
2283 | GNUNET_static_assert (((void*) (ps)) == \ | 2283 | GNUNET_static_assert (((void*) (ps)) == \ |
2284 | ((void*) &(ps)->purpose)); \ | 2284 | ((void*) &(ps)->purpose)); \ |
2285 | GNUNET_assert (GNUNET_OK == \ | 2285 | GNUNET_assert (GNUNET_OK == \ |
2286 | GNUNET_CRYPTO_ecdsa_sign_ (priv, \ | 2286 | GNUNET_CRYPTO_ecdsa_sign_ (priv, \ |
2287 | &(ps)->purpose, \ | 2287 | &(ps)->purpose, \ |
2288 | sig)); \ | 2288 | sig)); \ |
2289 | } while (0) | 2289 | } while (0) |
2290 | 2290 | ||
2291 | /** | 2291 | /** |
@@ -2324,15 +2324,15 @@ GNUNET_CRYPTO_edx25519_sign_ ( | |||
2324 | * @param[out] sig where to write the signature | 2324 | * @param[out] sig where to write the signature |
2325 | */ | 2325 | */ |
2326 | #define GNUNET_CRYPTO_edx25519_sign(priv,ps,sig) do { \ | 2326 | #define GNUNET_CRYPTO_edx25519_sign(priv,ps,sig) do { \ |
2327 | /* check size is set correctly */ \ | 2327 | /* check size is set correctly */ \ |
2328 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ | 2328 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ |
2329 | /* check 'ps' begins with the purpose */ \ | 2329 | /* check 'ps' begins with the purpose */ \ |
2330 | GNUNET_static_assert (((void*) (ps)) == \ | 2330 | GNUNET_static_assert (((void*) (ps)) == \ |
2331 | ((void*) &(ps)->purpose)); \ | 2331 | ((void*) &(ps)->purpose)); \ |
2332 | GNUNET_assert (GNUNET_OK == \ | 2332 | GNUNET_assert (GNUNET_OK == \ |
2333 | GNUNET_CRYPTO_edx25519_sign_ (priv, \ | 2333 | GNUNET_CRYPTO_edx25519_sign_ (priv, \ |
2334 | &(ps)->purpose, \ | 2334 | &(ps)->purpose, \ |
2335 | sig)); \ | 2335 | sig)); \ |
2336 | } while (0) | 2336 | } while (0) |
2337 | 2337 | ||
2338 | 2338 | ||
@@ -2726,13 +2726,13 @@ GNUNET_CRYPTO_ecdhe_elligator_initialize (void); | |||
2726 | * @param pk private key for generating valid public key | 2726 | * @param pk private key for generating valid public key |
2727 | */ | 2727 | */ |
2728 | int | 2728 | int |
2729 | GNUNET_CRYPTO_ecdhe_elligator_generate_public_key (unsigned char | 2729 | GNUNET_CRYPTO_ecdhe_elligator_generate_public_key (unsigned char |
2730 | pub[ | 2730 | pub[ |
2731 | crypto_scalarmult_SCALARBYTES | 2731 | crypto_scalarmult_SCALARBYTES |
2732 | ], | 2732 | ], |
2733 | struct | 2733 | struct |
2734 | GNUNET_CRYPTO_EcdhePrivateKey | 2734 | GNUNET_CRYPTO_EcdhePrivateKey |
2735 | *pk); | 2735 | *pk); |
2736 | 2736 | ||
2737 | 2737 | ||
2738 | /** | 2738 | /** |
@@ -4267,15 +4267,15 @@ GNUNET_CRYPTO_sign_raw_ ( | |||
4267 | * @param[out] sig where to write the signature | 4267 | * @param[out] sig where to write the signature |
4268 | */ | 4268 | */ |
4269 | #define GNUNET_CRYPTO_sign(priv,ps,sig) do { \ | 4269 | #define GNUNET_CRYPTO_sign(priv,ps,sig) do { \ |
4270 | /* check size is set correctly */ \ | 4270 | /* check size is set correctly */ \ |
4271 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ | 4271 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ |
4272 | /* check 'ps' begins with the purpose */ \ | 4272 | /* check 'ps' begins with the purpose */ \ |
4273 | GNUNET_static_assert (((void*) (ps)) == \ | 4273 | GNUNET_static_assert (((void*) (ps)) == \ |
4274 | ((void*) &(ps)->purpose)); \ | 4274 | ((void*) &(ps)->purpose)); \ |
4275 | GNUNET_assert (GNUNET_OK == \ | 4275 | GNUNET_assert (GNUNET_OK == \ |
4276 | GNUNET_CRYPTO_sign_ (priv, \ | 4276 | GNUNET_CRYPTO_sign_ (priv, \ |
4277 | &(ps)->purpose, \ | 4277 | &(ps)->purpose, \ |
4278 | sig)); \ | 4278 | sig)); \ |
4279 | } while (0) | 4279 | } while (0) |
4280 | 4280 | ||
4281 | 4281 | ||
diff --git a/src/lib/util/crypto_elligator.c b/src/lib/util/crypto_elligator.c index 5ceebedbe..b46d30d6f 100644 --- a/src/lib/util/crypto_elligator.c +++ b/src/lib/util/crypto_elligator.c | |||
@@ -651,4 +651,4 @@ GNUNET_CRYPTO_eddsa_elligator_kem_decaps (const struct | |||
651 | struct GNUNET_CRYPTO_EcdhePublicKey pub; | 651 | struct GNUNET_CRYPTO_EcdhePublicKey pub; |
652 | GNUNET_CRYPTO_ecdhe_elligator_decoding (&pub, NULL, r); | 652 | GNUNET_CRYPTO_ecdhe_elligator_decoding (&pub, NULL, r); |
653 | return GNUNET_CRYPTO_eddsa_ecdh (priv, &pub, key_material); | 653 | return GNUNET_CRYPTO_eddsa_ecdh (priv, &pub, key_material); |
654 | } \ No newline at end of file | 654 | } |
diff --git a/src/service/transport/gnunet-communicator-udp.c b/src/service/transport/gnunet-communicator-udp.c index 48319461e..9c24ea2a3 100644 --- a/src/service/transport/gnunet-communicator-udp.c +++ b/src/service/transport/gnunet-communicator-udp.c | |||
@@ -67,7 +67,7 @@ | |||
67 | * How often do we scan for changes to our network interfaces? | 67 | * How often do we scan for changes to our network interfaces? |
68 | */ | 68 | */ |
69 | #define INTERFACE_SCAN_FREQUENCY \ | 69 | #define INTERFACE_SCAN_FREQUENCY \ |
70 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) | 70 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * How long do we believe our addresses to remain up (before | 73 | * How long do we believe our addresses to remain up (before |
@@ -76,7 +76,7 @@ | |||
76 | #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS | 76 | #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS |
77 | 77 | ||
78 | #define WORKING_QUEUE_INTERVALL \ | 78 | #define WORKING_QUEUE_INTERVALL \ |
79 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) | 79 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * AES key size. | 82 | * AES key size. |