Documentation ¶
Overview ¶
Author: xingchang@fusion.org
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMessageTooLong = errors.New("[ERROR]: message is too long.")
Functions ¶
func GenerateKeyPair ¶
func GenerateKeyPair(length int) (*PublicKey, *PrivateKey)
Types ¶
type PrivateKey ¶
type PrivateKey struct { Length string PublicKey L *big.Int // (p-1)*(q-1) U *big.Int // L^-1 mod N }
func (*PrivateKey) ZkFactProve ¶
func (privateKey *PrivateKey) ZkFactProve() *ZkFactProof
type PublicKey ¶
type PublicKey struct { Length string N *big.Int // n = p*q, where p and q are prime G *big.Int // in practical, G = N + 1 N2 *big.Int // N2 = N * N }
func (*PublicKey) Encrypt ¶
func (publicKey *PublicKey) Encrypt(mBigInt *big.Int) (*big.Int, error) {
func (*PublicKey) ZkFactVerify ¶
func (publicKey *PublicKey) ZkFactVerify(zkFactProof *ZkFactProof) bool
Click to show internal directories.
Click to hide internal directories.