C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
DiscreteLogCrypto ( int g, System.Numerics.BigInteger p ) : System
Encrypt ( System.Numerics.BigInteger x ) : System.Numerics.BigInteger

Описание методов

DiscreteLogCrypto() публичный Метод

public DiscreteLogCrypto ( int g, System.Numerics.BigInteger p ) : System
g int
p System.Numerics.BigInteger
Результат System

Encrypt() публичный Метод

public Encrypt ( System.Numerics.BigInteger x ) : System.Numerics.BigInteger
x System.Numerics.BigInteger
Результат System.Numerics.BigInteger