[PATCH] Truncate hash values for ECDSA signature scheme
Werner Koch
wk at gnupg.org
Tue Dec 17 14:53:47 CET 2013
On Tue, 17 Dec 2013 12:37, dbaryshkov at gmail.com said:
> if (mpi_is_opaque(input))
> {
> abuf = mpi_get_opaque (input, &abits);
> rc = _gcry_mpi_scan (&hash, GCRYMPI_FMT_USG, abuf, (abits+7)/8, NULL);
> }
> else
> {
> hash = mpi_copy(input)
> abits = mpi_get_nbits(input);
> }
> if (abits > qbits)
> mpi_rshift (hash, hash, abits - qbits);
>
> This would be more correct, isn't it?
Yes.
Shalom-Salam,
Werner
--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
More information about the Gcrypt-devel
mailing list