Please note that while ToByteArrayUnsigned accounts for the possible
leading zero, it will not give the full 32 bytes in the case where the
field element has a small value relative to the field characteristic. So
please do use X9IntegerConverter or you will get incorrect (short)
output randomly for ~%1 of points.
Better yet, just use ECPoint.GetEncoded() if that is applicable.
Regards,
Pete Dettman
On 27/10/2013 7:35 AM, Mankowski, Chris wrote:
Ahh yes, that’s perfect. Thank you.
From: Atanas Krachev <[email protected] <mailto:[email protected]>>
Date: Saturday, October 26, 2013 at 3:17 PM
To: Chris Lamont Mankowski <[email protected]
<mailto:[email protected]>>
Cc: "[email protected]
<mailto:[email protected]>"
<[email protected]
<mailto:[email protected]>>
Subject: Re: [dev-crypto-csharp] Re: Bug: X and Y in
ECPublicKeyParameters is sometimes 33 bits instead of 32
Hi Chris,
Wouldn't the ToByteArrayUnsigned() method of the BigInteger class be
helpful in your case?
Cheers,
Atanas Krachev
------------------------------------------------------------------------
Notice: This e-mail message and any attachment to this e-mail message
may contain information that is confidential, proprietary, privileged,
legally privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please accept this as notice
that any disclosure, copying, distribution or use of the information
contained in this transmission is strictly prohibited. NFP reserves
the right, to the extent and under circumstances permitted by
applicable law, to retain, monitor and intercept e-mail messages to
and from its systems.
Any views or opinions expressed in this e-mail are those of the sender
and do not necessarily express those of NFP. Although this
transmission and any attachment are believed to be free of any virus
or other defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by NFP,
its subsidiaries and affiliates, as applicable, for any loss or damage
arising in any way from its use.
If you have received this e-mail in error, please immediately contact
the sender by return e-mail or by telephone at 212-301-4000 and
destroy the material in its entirety, whether electronic or hard copy
format.