Register RIPEMD and SHA3 RSA-PSS signature algorithms - #172
Merged
Conversation
Add the RIPEMD128/160/256 and SHA3-224/256/384/512 "...withRSAandMGF1" signature algorithms, with PSS parameters carrying the matching digest AlgorithmIdentifier and a salt length equal to the digest output size (16/20/32 for RIPEMD, 28/32/48/64 for SHA3). The registrations are added across every place that resolves signature algorithms: - TSignerUtilities: algorithm-name and OID maps (enables GetSigner) - TX509SignatureUtilities: algorithm map, explicit PSS params, and SHA3 digest-name resolution in GetDigestName - TDefaultSignatureAlgorithmFinder: RIPEMD variants (SHA3 already present) - TX509Utilities and TPkcs10CertificationRequest: algorithm map and, where applicable, explicit PSS params Also refactor TPssSigner.MaskGeneratorFunction1: full digest blocks are now finalized straight into the mask buffer (only the trailing partial block uses a temporary), the block counter is packed big-endian via TBinaryPrimitives.WriteUInt32BigEndian, and the redundant ItoOSP helper is removed. This is a behaviour-preserving cleanup; the PSS known-answer vectors are unchanged. Tests: TTestPss gains a sign/verify round-trip over all seven new algorithms, and TX509CertGenTest generates and verifies a self-signed certificate for each (a fresh 2048-bit key is used since the shared test key is too small for SHA3-512 PSS).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add the RIPEMD128/160/256 and SHA3-224/256/384/512 "...withRSAandMGF1" signature algorithms, with PSS parameters carrying the matching digest AlgorithmIdentifier and a salt length equal to the digest output size (16/20/32 for RIPEMD, 28/32/48/64 for SHA3). The registrations are added across every place that resolves signature algorithms:
Also refactor TPssSigner.MaskGeneratorFunction1: full digest blocks are now finalized straight into the mask buffer (only the trailing partial block uses a temporary), the block counter is packed big-endian via TBinaryPrimitives.WriteUInt32BigEndian, and the redundant ItoOSP helper is removed. This is a behaviour-preserving cleanup; the PSS known-answer vectors are unchanged.
Tests: TTestPss gains a sign/verify round-trip over all seven new algorithms, and TX509CertGenTest generates and verifies a self-signed certificate for each (a fresh 2048-bit key is used since the shared test key is too small for SHA3-512 PSS).