Add HKDF Nonce derivation helpers in CryptoExtras #475
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.56) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.56 · 150 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.300
Sensitive Paths
sensitive_paths
0.056
Real PR Conversation Timeline
1 comments
"Review active on #475"
general
weight: 0.35
Lukasa
Summary
Resolves #307.
Deriving nonces from HKDF key derivation is common in cryptographic protocols (such as RFC 8188 for WebPush and HTTP Encrypted Content-Encoding). Currently, callers must derive a
SymmetricKeyand invokewithUnsafeBytesto construct anAES.GCM.NonceorChaChaPoly.Nonce.This PR introduces type-safe HKDF Nonce derivation helpers in
CryptoExtras(and re-exported by_CryptoExtras) on bothHKDFandSharedSecret.Changes
HKDF.deriveAESGCMNonce(inputKeyMaterial:salt:info:)andHKDF.deriveChaChaPolyNonce(inputKeyMaterial:salt:info:)inSources/CryptoExtras/Key Derivation/HKDF+Nonce.swift.SharedSecret.hkdfDerivedAESGCMNonce(using:salt:sharedInfo:)andSharedSecret.hkdfDerivedChaChaPolyNonce(using:salt:sharedInfo:).Tests/CryptoExtrasTests/HKDFNonceTests.swiftvalidating exact 12-byte size, deterministic output, encryption/decryption roundtrip, and ECDH shared secret derivation.Sources/CryptoExtras/Key Derivation/HKDF+Nonce.swifttoSources/CryptoExtras/CMakeLists.txt.Checklist
swift format)