mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
13 lines
217 B
Plaintext
13 lines
217 B
Plaintext
module std::crypto::dh;
|
|
import std::math::bigint;
|
|
|
|
fn BigInt generate_secret(BigInt p, BigInt x, BigInt y)
|
|
{
|
|
return y.mod_pow(x, p);
|
|
}
|
|
|
|
fn BigInt public_key(BigInt p, BigInt g, BigInt x)
|
|
{
|
|
return g.mod_pow(x, p);
|
|
}
|