First of all, a comment that you refer to talk about the ECDSA signature format, not a key pair. Secondly, this is a bit misleading:
The output from the ECDSA algorithm is two integers in the interval [1, n-1]. The ECDSA standard ( FIPS 183-3 ) does not specify a standard method for encoding this pair of numbers as an array of bytes.
One way is to encapsulate numbers in ASN.1 SEQUENCE. This is the path specified by ANSI X9.62 and RFC3278 . This is the standard output from Java and (AFAIR) Microsoft CNG / .NET.
Another way is left padding numbers with zeros, so they have the same byte length as n , and then just concatenate them. This is done using PKCS # 11 and most smart card implementations.
If I read the source code correctly, SJCL encodes the ECDSA signature in the second way. You can easily convert this format to the first.
source share