apple / swift-crypto

Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.
https://apple.github.io/swift-crypto
Apache License 2.0
1.47k stars 166 forks source link

Umbrella: Update Wycheproof test vectors to v1 #165

Closed Sajjon closed 1 year ago

Sajjon commented 1 year ago

This issue is an umbrella issue where we can keep track of my efforts upgrading all Wycheproof test vectors from v0 to v1.

Sajjon commented 1 year ago

@Lukasa aha! swift-crypto contains four Wycheproof test vectors which are not at all used:

So I propose we delete them, it is a bit misleading to have them there. And then I can add new tests ECDSA using IEEE P1316 encoding, using ECDSASignature.init:rawRepresentation initialiser for which Wycheproof v1 vendors:

So I propose the four unused vectors gets deleted, and I add a new unit tests, and update ECDSASignatureTests to be shared for current tests and for the P1316 format tests, by accepting a function pointer to an ECDSASignature initializer, using init:derRepresentation for current tests, and using init:rawRepresentation init for the P1316 test vectors, what do you think about that @Lukasa ?

EDIT: done: https://github.com/apple/swift-crypto/pull/167

Lukasa commented 1 year ago

Hey @Sajjon, are there any further vectors you'd like to add as part of this ticket?

Sajjon commented 1 year ago

@Lukasa I think I'm done for now, I will close this issue.