aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_crypto_ecdhe.c
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
committerng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
commitd41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch)
tree9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/util/test_crypto_ecdhe.c
parenta0fce305c565c0937d917a92712f15e9c5736260 (diff)
downloadgnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz
gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip
uncrustify as demanded.
Diffstat (limited to 'src/util/test_crypto_ecdhe.c')
-rw-r--r--src/util/test_crypto_ecdhe.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/util/test_crypto_ecdhe.c b/src/util/test_crypto_ecdhe.c
index 71fe9b570..d833abc1d 100644
--- a/src/util/test_crypto_ecdhe.c
+++ b/src/util/test_crypto_ecdhe.c
@@ -11,13 +11,13 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19 19
20*/ 20 */
21/** 21/**
22 * @file util/test_crypto_ecdhe.c 22 * @file util/test_crypto_ecdhe.c
23 * @brief testcase for ECC ECDHE public key crypto 23 * @brief testcase for ECC ECDHE public key crypto
@@ -29,7 +29,7 @@
29 29
30 30
31int 31int
32main (int argc, char *argv[]) 32main(int argc, char *argv[])
33{ 33{
34 struct GNUNET_CRYPTO_EcdhePrivateKey *priv1; 34 struct GNUNET_CRYPTO_EcdhePrivateKey *priv1;
35 struct GNUNET_CRYPTO_EcdhePrivateKey *priv2; 35 struct GNUNET_CRYPTO_EcdhePrivateKey *priv2;
@@ -38,33 +38,33 @@ main (int argc, char *argv[])
38 struct GNUNET_HashCode ecdh1; 38 struct GNUNET_HashCode ecdh1;
39 struct GNUNET_HashCode ecdh2; 39 struct GNUNET_HashCode ecdh2;
40 40
41 if (! gcry_check_version ("1.6.0")) 41 if (!gcry_check_version("1.6.0"))
42 { 42 {
43 fprintf (stderr, 43 fprintf(stderr,
44 _ 44 _
45 ("libgcrypt has not the expected version (version %s is required).\n"), 45 ("libgcrypt has not the expected version (version %s is required).\n"),
46 "1.6.0"); 46 "1.6.0");
47 return 0; 47 return 0;
48 } 48 }
49 if (getenv ("GNUNET_GCRYPT_DEBUG")) 49 if (getenv("GNUNET_GCRYPT_DEBUG"))
50 gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u , 0); 50 gcry_control(GCRYCTL_SET_DEBUG_FLAGS, 1u, 0);
51 GNUNET_log_setup ("test-crypto-ecdhe", "WARNING", NULL); 51 GNUNET_log_setup("test-crypto-ecdhe", "WARNING", NULL);
52 52
53 for (unsigned int i=0;i<100;i++) 53 for (unsigned int i = 0; i < 100; i++)
54 { 54 {
55 fprintf (stderr, 55 fprintf(stderr,
56 "."); 56 ".");
57 priv1 = GNUNET_CRYPTO_ecdhe_key_create (); 57 priv1 = GNUNET_CRYPTO_ecdhe_key_create();
58 priv2 = GNUNET_CRYPTO_ecdhe_key_create (); 58 priv2 = GNUNET_CRYPTO_ecdhe_key_create();
59 GNUNET_CRYPTO_ecdhe_key_get_public (priv1, &pub1); 59 GNUNET_CRYPTO_ecdhe_key_get_public(priv1, &pub1);
60 GNUNET_CRYPTO_ecdhe_key_get_public (priv2, &pub2); 60 GNUNET_CRYPTO_ecdhe_key_get_public(priv2, &pub2);
61 GNUNET_CRYPTO_ecc_ecdh (priv1, &pub2, &ecdh1); 61 GNUNET_CRYPTO_ecc_ecdh(priv1, &pub2, &ecdh1);
62 GNUNET_CRYPTO_ecc_ecdh (priv2, &pub1, &ecdh2); 62 GNUNET_CRYPTO_ecc_ecdh(priv2, &pub1, &ecdh2);
63 GNUNET_assert (0 == memcmp (&ecdh1, &ecdh2, 63 GNUNET_assert(0 == memcmp(&ecdh1, &ecdh2,
64 sizeof (struct GNUNET_HashCode))); 64 sizeof(struct GNUNET_HashCode)));
65 GNUNET_free (priv1); 65 GNUNET_free(priv1);
66 GNUNET_free (priv2); 66 GNUNET_free(priv2);
67 } 67 }
68 return 0; 68 return 0;
69} 69}
70 70