Skip to content

Register RIPEMD and SHA3 RSA-PSS signature algorithms - #172

Merged
Xor-el merged 1 commit into
masterfrom
feature/pss-mgf1-signature-algorithms
Aug 16, 2026
Merged

Register RIPEMD and SHA3 RSA-PSS signature algorithms#172
Xor-el merged 1 commit into
masterfrom
feature/pss-mgf1-signature-algorithms

Conversation

@Xor-el

@Xor-el Xor-el commented Aug 16, 2026

Copy link
Copy Markdown
Owner

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).

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).
@Xor-el
Xor-el merged commit 3d0d104 into master Aug 16, 2026
15 checks passed
@Xor-el
Xor-el deleted the feature/pss-mgf1-signature-algorithms branch August 16, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant