Re: [PATCH] hogweed-benchmark: fill 32 or 56 bytes rather than just sizeof(int)

2020-01-25 Thread Niels Möller
dbarysh...@gmail.com writes:

> diff --git a/examples/hogweed-benchmark.c b/examples/hogweed-benchmark.c
> index 11393df04c81..69315211a0cc 100644
> --- a/examples/hogweed-benchmark.c
> +++ b/examples/hogweed-benchmark.c
> @@ -771,12 +771,12 @@ bench_curve_init (unsigned size)
>  case 255:
>ctx->mul = curve25519_mul;
>ctx->mul_g = curve25519_mul_g;
> -  knuth_lfib_random (, sizeof(CURVE25519_SIZE), ctx->s);
> +  knuth_lfib_random (, CURVE25519_SIZE, ctx->s);
>break;
>  case 448:
>ctx->mul = curve448_mul;
>ctx->mul_g = curve448_mul_g;
> -  knuth_lfib_random (, sizeof(CURVE448_SIZE), ctx->s);
> +  knuth_lfib_random (, CURVE448_SIZE, ctx->s);
>break;
>  default:
>abort ();

Thanks, fix applied.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs


[PATCH] hogweed-benchmark: fill 32 or 56 bytes rather than just sizeof(int)

2020-01-16 Thread dbaryshkov
From: Dmitry Baryshkov 

Don't call sizeof(CURVExyz_SIZE) to get amount of bytes to fill. Just
use CURVExyz_SIZE itself.

Signed-off-by: Dmitry Baryshkov 
---
 examples/hogweed-benchmark.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/hogweed-benchmark.c b/examples/hogweed-benchmark.c
index 11393df04c81..69315211a0cc 100644
--- a/examples/hogweed-benchmark.c
+++ b/examples/hogweed-benchmark.c
@@ -771,12 +771,12 @@ bench_curve_init (unsigned size)
 case 255:
   ctx->mul = curve25519_mul;
   ctx->mul_g = curve25519_mul_g;
-  knuth_lfib_random (, sizeof(CURVE25519_SIZE), ctx->s);
+  knuth_lfib_random (, CURVE25519_SIZE, ctx->s);
   break;
 case 448:
   ctx->mul = curve448_mul;
   ctx->mul_g = curve448_mul_g;
-  knuth_lfib_random (, sizeof(CURVE448_SIZE), ctx->s);
+  knuth_lfib_random (, CURVE448_SIZE, ctx->s);
   break;
 default:
   abort ();
-- 
2.24.1

___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs