chore(crypto): CRP-2436 Refactoring of ECDSA/Ed25519 related utility crates #8455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CRP-2436 relates to removing the basic_sig crates for ECDSA/Ed25519 in preference for the utility crates in
packageswhich were created later, and which thebasic_sigcrates these days depend on for their functionality.This PR does not remove these crates. What it does is various refactorings such that there is next to no remaining logic within the basic_sig crates themselves, with changes such as
der_utilsonly so that they could export the PKIX algorithm identifier. These functions in turn were used only by standalone-sig-verifier. I just moved the OID definitions to that crate.packagesder_encoding_from_xy_coordinatesontoic_secp256r1::PublicKey::deserialize_from_xy- however it turned out COSE does not need to support coordinates with leading zeros omitted, so I removed support for variable length encodings.signature_from_derwas used in two places: some COSE tests, and in the standalone validator. In the COSE test cases we just need to verify on the spot a DER encoded signature, so I addedverify_signature_with_der_encoded_sig- for whatever reason there was already signature generation with DER encoding, just not verification....With this, the basic_sig ECDSA/Ed25519 crates are effectively pure wrappers of the equivalent
packagescrate plus some error mapping ontoCryptoError, and newtypes for signature and key encodings.