[PATCH v2] Truncate hash values for ECDSA signature scheme

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Wed Dec 25 12:23:01 CET 2013


On Sun, Dec 22, 2013 at 5:15 PM, Dmitry Eremin-Solenikov
<dbaryshkov at gmail.com> wrote:

> --- a/tests/pubkey.c
> +++ b/tests/pubkey.c
> @@ -980,9 +980,23 @@ check_ecc_sample_key (void)
>      "(data (flags raw)\n"
>      " (value #00112233445566778899AABBCCDDEEFF"
>      /* */    "000102030405060708090A0B0C0D0E0F#))";
> +  static const char hash2_string[] =
> +    "(data (flags raw)\n"
> +    " (value #00112233445566778899AABBCCDDEEFF"
> +    /* */    "000102030405060708090A0B0C0D0E0F"
> +    /* */    "000102030405060708090A0B0C0D0E0F"
> +    /* */    "00112233445566778899AABBCCDDEEFF#))";
> +  /* hash2, but longer than curve length, so it will be truncated */
> +  static const char hash3_string[] =
> +    "(data (flags raw)\n"
> +    " (value #00112233445566778899AABBCCDDEEFF"
> +    /* */    "000102030405060708090A0B0C0D0E0F"
> +    /* */    "000102030405060708090A0B0C0D0E0F"
> +    /* */    "00112233445566778899AABBCCDDEEFF"
> +    /* */    "000102030405060708090A0B0C0D0E0F#))";

I forgot about the test. It needs to be fixed.
s/value/hash sha1/ in both lines. I will post patch in the evening.

-- 
With best wishes
Dmitry



More information about the Gcrypt-devel mailing list