summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2015-09-13 13:54:33 +0000
committerjsing <>2015-09-13 13:54:33 +0000
commit4ff01204436485f0dc0dcc8045dc99eb58c0f765 (patch)
tree24c0aa94e4b4ebc3679e613f3607bc21f7bf598e
parentf9283b7125226e020af908825ee7ea347e976ad2 (diff)
downloadopenbsd-4ff01204436485f0dc0dcc8045dc99eb58c0f765.tar.gz
openbsd-4ff01204436485f0dc0dcc8045dc99eb58c0f765.tar.bz2
openbsd-4ff01204436485f0dc0dcc8045dc99eb58c0f765.zip
Wrap long lines.
-rw-r--r--src/regress/lib/libcrypto/ecdh/ecdhtest.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/src/regress/lib/libcrypto/ecdh/ecdhtest.c b/src/regress/lib/libcrypto/ecdh/ecdhtest.c
index eac7dab426..eb7c9e3fa4 100644
--- a/src/regress/lib/libcrypto/ecdh/ecdhtest.c
+++ b/src/regress/lib/libcrypto/ecdh/ecdhtest.c
@@ -132,7 +132,8 @@ test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out)
132 if (!EC_KEY_generate_key(a)) 132 if (!EC_KEY_generate_key(a))
133 goto err; 133 goto err;
134 134
135 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) { 135 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) ==
136 NID_X9_62_prime_field) {
136 if (!EC_POINT_get_affine_coordinates_GFp(group, 137 if (!EC_POINT_get_affine_coordinates_GFp(group,
137 EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err; 138 EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err;
138 } 139 }
@@ -148,7 +149,8 @@ test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out)
148 if (!EC_KEY_generate_key(b)) 149 if (!EC_KEY_generate_key(b))
149 goto err; 150 goto err;
150 151
151 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) { 152 if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) ==
153 NID_X9_62_prime_field) {
152 if (!EC_POINT_get_affine_coordinates_GFp(group, 154 if (!EC_POINT_get_affine_coordinates_GFp(group,
153 EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err; 155 EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err;
154 } 156 }
@@ -164,14 +166,16 @@ test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out)
164 166
165 alen = KDF1_SHA1_len; 167 alen = KDF1_SHA1_len;
166 abuf = malloc(alen); 168 abuf = malloc(alen);
167 aout = ECDH_compute_key(abuf, alen, EC_KEY_get0_public_key(b), a, KDF1_SHA1); 169 aout = ECDH_compute_key(abuf, alen, EC_KEY_get0_public_key(b),
170 a, KDF1_SHA1);
168 171
169 BIO_printf(out, "."); 172 BIO_printf(out, ".");
170 (void)BIO_flush(out); 173 (void)BIO_flush(out);
171 174
172 blen = KDF1_SHA1_len; 175 blen = KDF1_SHA1_len;
173 bbuf = malloc(blen); 176 bbuf = malloc(blen);
174 bout = ECDH_compute_key(bbuf, blen, EC_KEY_get0_public_key(a), b, KDF1_SHA1); 177 bout = ECDH_compute_key(bbuf, blen, EC_KEY_get0_public_key(a),
178 b, KDF1_SHA1);
175 179
176 BIO_printf(out, "."); 180 BIO_printf(out, ".");
177 (void)BIO_flush(out); 181 (void)BIO_flush(out);
@@ -414,11 +418,13 @@ main(int argc, char *argv[])
414 goto err; 418 goto err;
415 419
416 /* NIST PRIME CURVES TESTS */ 420 /* NIST PRIME CURVES TESTS */
417 if (!test_ecdh_curve(NID_X9_62_prime192v1, "NIST Prime-Curve P-192", ctx, out)) 421 if (!test_ecdh_curve(NID_X9_62_prime192v1, "NIST Prime-Curve P-192",
422 ctx, out))
418 goto err; 423 goto err;
419 if (!test_ecdh_curve(NID_secp224r1, "NIST Prime-Curve P-224", ctx, out)) 424 if (!test_ecdh_curve(NID_secp224r1, "NIST Prime-Curve P-224", ctx, out))
420 goto err; 425 goto err;
421 if (!test_ecdh_curve(NID_X9_62_prime256v1, "NIST Prime-Curve P-256", ctx, out)) 426 if (!test_ecdh_curve(NID_X9_62_prime256v1, "NIST Prime-Curve P-256",
427 ctx, out))
422 goto err; 428 goto err;
423 if (!test_ecdh_curve(NID_secp384r1, "NIST Prime-Curve P-384", ctx, out)) 429 if (!test_ecdh_curve(NID_secp384r1, "NIST Prime-Curve P-384", ctx, out))
424 goto err; 430 goto err;
@@ -426,25 +432,35 @@ main(int argc, char *argv[])
426 goto err; 432 goto err;
427#ifndef OPENSSL_NO_EC2M 433#ifndef OPENSSL_NO_EC2M
428 /* NIST BINARY CURVES TESTS */ 434 /* NIST BINARY CURVES TESTS */
429 if (!test_ecdh_curve(NID_sect163k1, "NIST Binary-Curve K-163", ctx, out)) 435 if (!test_ecdh_curve(NID_sect163k1, "NIST Binary-Curve K-163",
436 ctx, out))
430 goto err; 437 goto err;
431 if (!test_ecdh_curve(NID_sect163r2, "NIST Binary-Curve B-163", ctx, out)) 438 if (!test_ecdh_curve(NID_sect163r2, "NIST Binary-Curve B-163",
439 ctx, out))
432 goto err; 440 goto err;
433 if (!test_ecdh_curve(NID_sect233k1, "NIST Binary-Curve K-233", ctx, out)) 441 if (!test_ecdh_curve(NID_sect233k1, "NIST Binary-Curve K-233",
442 ctx, out))
434 goto err; 443 goto err;
435 if (!test_ecdh_curve(NID_sect233r1, "NIST Binary-Curve B-233", ctx, out)) 444 if (!test_ecdh_curve(NID_sect233r1, "NIST Binary-Curve B-233",
445 ctx, out))
436 goto err; 446 goto err;
437 if (!test_ecdh_curve(NID_sect283k1, "NIST Binary-Curve K-283", ctx, out)) 447 if (!test_ecdh_curve(NID_sect283k1, "NIST Binary-Curve K-283",
448 ctx, out))
438 goto err; 449 goto err;
439 if (!test_ecdh_curve(NID_sect283r1, "NIST Binary-Curve B-283", ctx, out)) 450 if (!test_ecdh_curve(NID_sect283r1, "NIST Binary-Curve B-283",
451 ctx, out))
440 goto err; 452 goto err;
441 if (!test_ecdh_curve(NID_sect409k1, "NIST Binary-Curve K-409", ctx, out)) 453 if (!test_ecdh_curve(NID_sect409k1, "NIST Binary-Curve K-409",
454 ctx, out))
442 goto err; 455 goto err;
443 if (!test_ecdh_curve(NID_sect409r1, "NIST Binary-Curve B-409", ctx, out)) 456 if (!test_ecdh_curve(NID_sect409r1, "NIST Binary-Curve B-409",
457 ctx, out))
444 goto err; 458 goto err;
445 if (!test_ecdh_curve(NID_sect571k1, "NIST Binary-Curve K-571", ctx, out)) 459 if (!test_ecdh_curve(NID_sect571k1, "NIST Binary-Curve K-571",
460 ctx, out))
446 goto err; 461 goto err;
447 if (!test_ecdh_curve(NID_sect571r1, "NIST Binary-Curve B-571", ctx, out)) 462 if (!test_ecdh_curve(NID_sect571r1, "NIST Binary-Curve B-571",
463 ctx, out))
448 goto err; 464 goto err;
449#endif 465#endif
450 if (!test_ecdh_kat(out, "Brainpool Prime-Curve brainpoolP256r1", 256)) 466 if (!test_ecdh_kat(out, "Brainpool Prime-Curve brainpoolP256r1", 256))