Commit b645d892 authored by Niels Möller's avatar Niels Möller

Tweaked argument order for _eddsa_verify.

parent 4418b01d
2014-10-18 Niels Möller <nisse@lysator.liu.se>
* eddsa-verify.c (_eddsa_verify): Change argument order, putting A
before ctx.
* eddsa.h: Updated prototype.
* testsuite/eddsa-verify-test.c (test_eddsa): Updated
_eddsa_verify calls.
2014-10-14 Niels Möller <nisse@lysator.liu.se>
* eddsa-verify.c (equal_h): New function.
......
......@@ -76,8 +76,8 @@ int
_eddsa_verify (const struct ecc_curve *ecc,
const struct nettle_hash *H,
const uint8_t *pub,
void *ctx,
const mp_limb_t *A,
void *ctx,
size_t length,
const uint8_t *msg,
const uint8_t *signature,
......
......@@ -96,8 +96,8 @@ int
_eddsa_verify (const struct ecc_curve *ecc,
const struct nettle_hash *H,
const uint8_t *pub,
void *ctx,
const mp_limb_t *A,
void *ctx,
size_t length,
const uint8_t *msg,
const uint8_t *signature,
......
......@@ -51,7 +51,7 @@ test_eddsa (const struct ecc_curve *ecc,
die ("Invalid eddsa public key.\n");
memcpy (csignature, signature, 2*nbytes);
if (!_eddsa_verify (ecc, H, pub, ctx, A,
if (!_eddsa_verify (ecc, H, pub, A, ctx,
msg->length, msg->data, csignature, scratch))
{
fprintf (stderr, "eddsa_verify failed with valid signature.\n");
......@@ -68,7 +68,7 @@ test_eddsa (const struct ecc_curve *ecc,
memcpy (csignature, signature, 2*nbytes);
csignature[nbytes/3] ^= 0x40;
if (_eddsa_verify (ecc, H, pub, ctx, A,
if (_eddsa_verify (ecc, H, pub, A, ctx,
msg->length, msg->data, csignature, scratch))
{
fprintf (stderr,
......@@ -79,7 +79,7 @@ test_eddsa (const struct ecc_curve *ecc,
memcpy (csignature, signature, 2*nbytes);
csignature[5*nbytes/3] ^= 0x8;
if (_eddsa_verify (ecc, H, pub, ctx, A,
if (_eddsa_verify (ecc, H, pub, A, ctx,
msg->length, msg->data, csignature, scratch))
{
fprintf (stderr,
......@@ -90,7 +90,7 @@ test_eddsa (const struct ecc_curve *ecc,
memcpy (csignature, signature, 2*nbytes);
if (msg->length == 0)
{
if (_eddsa_verify (ecc, H, pub, ctx, A,
if (_eddsa_verify (ecc, H, pub, A, ctx,
3, "foo", csignature, scratch))
{
fprintf (stderr,
......@@ -100,7 +100,7 @@ test_eddsa (const struct ecc_curve *ecc,
}
else
{
if (_eddsa_verify (ecc, H, pub, ctx, A,
if (_eddsa_verify (ecc, H, pub, A, ctx,
msg->length - 1, msg->data,
csignature, scratch))
{
......@@ -110,7 +110,7 @@ test_eddsa (const struct ecc_curve *ecc,
}
memcpy (csignature, signature, 2*nbytes);
cmsg[2*msg->length / 3] ^= 0x20;
if (_eddsa_verify (ecc, H, pub, ctx, A,
if (_eddsa_verify (ecc, H, pub, A, ctx,
msg->length, cmsg, csignature, scratch))
{
fprintf (stderr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment