C# Class MpcLib.MpcProtocols.Crypto.DiscreteLogCrypto

A fast implementation of the discrete logarithm cryptosystem. Let p be a prime and x be the plaintext. The cipher c is defined as c = g^x mod p, where g is a generator modulo p. Fast modular exponentiation is performed by caching g^(2^i) in an array of size log(p), where 0 <= i <= logp . The exponentiation is simply done by multiplying the elements of the array that correspond to the ones in the binary representation of x.
ファイルを表示 Open project: mahdiz/mpclib

Public Methods

Method Description
DiscreteLogCrypto ( int g, System.Numerics.BigInteger p ) : System
Encrypt ( System.Numerics.BigInteger x ) : System.Numerics.BigInteger

Method Details

DiscreteLogCrypto() public method

public DiscreteLogCrypto ( int g, System.Numerics.BigInteger p ) : System
g int
p System.Numerics.BigInteger
return System

Encrypt() public method

public Encrypt ( System.Numerics.BigInteger x ) : System.Numerics.BigInteger
x System.Numerics.BigInteger
return System.Numerics.BigInteger