MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / main

Function main

tests/binary/rsa/src/main.rs:75–88  ·  view source on GitHub ↗

Main test function

()

Source from the content-addressed store, hash-verified

73
74// Main test function
75fn main() {
76 let (public_key, private_key) = generate_keys();
77
78 // Test message
79 let message: u64 = 42;
80 assert!(message < public_key.n);
81
82 let encrypted = encrypt(&public_key, message);
83 let decrypted = decrypt(&private_key, encrypted);
84
85 // Check correctness
86 assert!(decrypted == message);
87 assert!(encrypted != message); // Make sure encryption changes the message
88}

Callers

nothing calls this directly

Calls 3

generate_keysFunction · 0.85
encryptFunction · 0.85
decryptFunction · 0.85

Tested by

no test coverage detected