Skip to content

docs: add XML documentation for modern asymmetric signers and X-DH agreement (Batch 11)#682

Open
KonradSop wants to merge 1 commit into
bcgit:masterfrom
KonradSop:feature/modern-signers-agreement-docs
Open

docs: add XML documentation for modern asymmetric signers and X-DH agreement (Batch 11)#682
KonradSop wants to merge 1 commit into
bcgit:masterfrom
KonradSop:feature/modern-signers-agreement-docs

Conversation

@KonradSop
Copy link
Copy Markdown
Contributor

Adds XML documentation to the nine streaming primitives that pair with the modern asymmetric parameter classes covered by PRs #673 (Batch 5), #677 (Batch 7), #678 (Batch 8), #679 (Batch 9) and the open Batch 10 generators PR. With this batch the ISigner / IRawAgreement surface for ML-DSA, SLH-DSA, EdDSA and X-DH now carries the same depth of documentation as the parameters and key-pair generators.

  • MLDsaSigner — class summary citing FIPS 204; Init documents the ParametersWithContext (≤255 bytes) and ParametersWithRandom envelope unwrapping plus the parameter-set / key-set match check; GenerateSignature, VerifySignature, Reset documented with their full exception contracts.
  • SlhDsaSigner — same shape as ML-DSA, citing FIPS 205; class summary explains the buffered context-prefixed message pattern.
  • Ed25519Signer / Ed25519ctxSigner / Ed25519phSigner — class summaries citing RFC 8032 §5.1; Ed25519ctxSigner and Ed25519phSigner constructors document the cloned context parameter and the ArgumentNullException raised on a null context; the pure-Ed25519 signer explicitly notes that no context is permitted.
  • Ed448Signer / Ed448phSigner — same shape as the Ed25519 ctx/ph signers, citing RFC 8032; class summaries note the SHAKE256 pre-hash for the ph variant.
  • X25519Agreement / X448Agreement — class summaries citing RFC 7748; Init documents the cast contract; CalculateAgreement documents the InvalidOperationException raised when the agreement produces an all-zero secret (degenerate peer key).

Key Accomplishments

  • Closes the modern-asymmetric documentation surface: with KeyGenerationParameters (Batch 9), key-pair generators (Batch 10) and now the signer / agreement primitives documented, every user-facing class in the ML-DSA / SLH-DSA / EdDSA / X-DH stack has consistent XML coverage.
  • Accurate exception contracts: <exception> tags only added where the method body actually throws — InvalidCastException on Init casts, InvalidOperationException on direction mismatches and pre-hash finalisation failures, ArgumentOutOfRangeException when the context exceeds 255 bytes for the PQC signers, ArgumentException on parameter-set mismatch.
  • Fixed two pre-existing CS1573 warnings: added the missing <param name="parameters"> tags on MLDsaSigner and SlhDsaSigner constructors that already documented deterministic.
  • Consistent style: Class summaries follow the same FIPS / RFC reference pattern used in Batches 5/7/8/9/10. Internal members and pre-existing implementation comments left untouched.
  • No overlap with open PRs: scope is disjoint from feature/modern-curves-docs (docs: add XML documentation for modern-curve parameters (Batch 7) #677), feature/slh-dsa-docs (docs: add XML documentation for SLH-DSA parameters (Batch 8) #678), feature/ml-pqc-gaps-docs (docs: add XML documentation for ML-KEM and ML-DSA parameter gaps (Batch 9) #679) and feature/keypair-generators-docs (Batch 10).

Verification

  • Build Status: dotnet build crypto/src/BouncyCastle.Crypto.csproj -c Release — succeeded on net6.0, netstandard2.0, net461 with no new warnings. The two CS1573 warnings introduced by the first pass were resolved before push.
  • Scope: Documentation-only; no behavioural or signature changes.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have kept the patch limited to only change the parts related to the patch
  • This change requires a documentation update

See also Contributing Guidelines.

…reement

Document the seven ISigner implementations and two IRawAgreement
implementations that pair with the modern asymmetric parameter classes
covered by Batches 5/7/8/9/10: MLDsaSigner, SlhDsaSigner, Ed25519Signer,
Ed25519ctxSigner, Ed25519phSigner, Ed448Signer, Ed448phSigner,
X25519Agreement and X448Agreement.

Adds class-level summaries citing the relevant FIPS / RFC and per-method
<summary>, <param>, <returns>, and <exception> tags for the streaming
Init / Update / GenerateSignature / VerifySignature / Reset surface
(ISigner) and Init / CalculateAgreement surface (IRawAgreement). No
behavioural changes.
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