Phase 5: Pure Rust Crypto#
Implement RSA PKCS#1 v1.5 signature verification in the crypto crate per RFC 8017.
Dependencies#
- Requires SHA-2 (for DigestInfo)
- Requires ASN.1 DER parser (for parsing RSA public keys)
Requirements#
- Big integer arithmetic: modular exponentiation (
base^exp mod n) - RSA public key parsing from DER (PKCS#1 RSAPublicKey and PKCS#8 SubjectPublicKeyInfo)
- RSASSA-PKCS1-v1_5 verify: EMSA-PKCS1-v1_5 encoding, signature verification
- Support SHA-256 and SHA-384 digest algorithms
- Key sizes: 2048-bit, 3072-bit, 4096-bit
Acceptance Criteria#
- Big integer type supporting modpow for up to 4096-bit numbers
- RSA public key parsing from DER-encoded PKCS#1 and PKCS#8 formats
- RSASSA-PKCS1-v1_5-VERIFY operation
- Verify real RSA signatures (e.g., from a TLS certificate chain)
- Reject invalid/tampered signatures
-
cargo test -p we-cryptopasses -
cargo clippy -p we-crypto -- -D warningsclean