Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLargeCipher = errors.New("schmidt-samoa: cipher is larger than Schmidt Samoa public key size")
View Source
var ErrLargeMessage = errors.New("schmidt-samoa: message is larger than Schmidt Samoa public key size")
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
PrivateKey represents a Schmidt-Samoa private key.
func GenerateKey ¶
func GenerateKey(random io.Reader, bits int) (*PrivateKey, error)
GenerateKey generates Schmidt-Samoa key according to the given bit-size.
type PublicKey ¶
PublicKey represents Schmidt-Samoa public key.
func (*PublicKey) Encrypt ¶
Encrypt encrypts a plain text represented as a byte array. It returns an error if plain text value is larger than modulus N of Public key.
func (*PublicKey) HommorphicEncMultiple ¶
HommorphicEncMultiple performs homomorphic operation over two chiphers. Schmidt-Samoa has multiplicative homomorphic property, so resultant cipher contains the product of multiple numbers.
Click to show internal directories.
Click to hide internal directories.