MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / generate_keypair

Function generate_keypair

sodiumbox/src/lib.rs:33–37  ·  view source on GitHub ↗

Generate a new X25519 keypair for use with sealed box operations Returns a tuple of (PublicKey, StaticSecret)

()

Source from the content-addressed store, hash-verified

31///
32/// Returns a tuple of (PublicKey, StaticSecret)
33pub fn generate_keypair() -> (PublicKey, StaticSecret) {
34 let secret = StaticSecret::random_from_rng(OsRng);
35 let public = PublicKey::from(&secret);
36 (public, secret)
37}
38
39/// Derives a nonce from the ephemeral public key and recipient's public key.
40///

Callers 2

test_seal_and_openFunction · 0.85
get_sealing_keyMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_seal_and_openFunction · 0.68