My bad. I think signatures cannot be shorter than the key, thus in the example the signature will always be 28 bytes regardless of the hash digest.
Instead, one would have to use a different curve definition with a shorter key. Chris On 14 Mrz., 15:44, skubo <[email protected]> wrote: > Hello Everyone, > > I'm fairly new to crypto++, so bare my potentially silly question: > > I need to calculate a signature with an eliptic curve dsa scheme, > using SHA-1 hash. The issue is that space for the signature is > limited, so I need to truncate the SHA-1 digest in order to reduce > resulting signature length (yes, I know that the overall resulting > security of the hash is lower, but that is accepted). I have found > some methods in the SHA implementation for that, however I'm stuck on > how I could use this together with ECDSA templates like in the example > below. > > ECDSA<ECP, SHA1>::PrivateKey key; > key.Load(...); > ECDSA<ECP,SHA1>::Signer signer(key); > > StringSource( message, true, > new SignerFilter( prng, > signer, > new StringSink( signature ) > ) // SignerFilter > ); // StringSource > > // signature is always resulting in 28 bytes length for e.g. secp112r1 > > Can anyone pinpoint me to the right direction? Any examples in how to > calculate this signature with a truncated hash digest, so that the > above signature would result in - say 20 bytes? > > Regards > Chris -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
