MCPcopy Create free account
hub / github.com/RustCrypto/RSA / modulus

Function modulus

tests/key_size.rs:12–15  ·  view source on GitHub ↗

Public-key construction checks the modulus size and parity, not its factorization.

(bits: u32)

Source from the content-addressed store, hash-verified

10
11// Public-key construction checks the modulus size and parity, not its factorization.
12fn modulus(bits: u32) -> BoxedUint {
13 let one = BoxedUint::one_with_precision(bits);
14 (&one << (bits - 1)) | one
15}
16
17#[test]
18#[allow(deprecated)]

Calls

no outgoing calls

Tested by 1