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

Function encrypt

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

RSA encryption: c = m^e mod n

(pub_key: &PublicKey, message: u64)

Source from the content-addressed store, hash-verified

63
64// RSA encryption: c = m^e mod n
65fn encrypt(pub_key: &PublicKey, message: u64) -> u64 {
66 mod_exp(message, pub_key.e, pub_key.n)
67}
68
69// RSA decryption: m = c^d mod n
70fn decrypt(priv_key: &PrivateKey, ciphertext: u64) -> u64 {

Callers 1

mainFunction · 0.85

Calls 1

mod_expFunction · 0.85

Tested by

no test coverage detected