Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(priv *PrivateKey, ciphertext []byte, opts crypto.DecrypterOpts) ([]byte, error)
func PrivateKeyTo ¶ added in v1.0.3022
func PrivateKeyTo(priv *PrivateKey) []byte
Marshal private key
Types ¶
type PrivateKey ¶
PrivateKey represents an Rabin private key.
func GenerateKey ¶
func GenerateKey(rand io.Reader) (*PrivateKey, error)
GenerateKey generates a random Rabin private key of the given bit size.
func GenerateKeyWithBitLength ¶
func GenerateKeyWithBitLength(rand io.Reader, bitLength int) (*PrivateKey, error)
GenerateKey generates a random Rabin private key of the given bit size. bitLength = 64
func (*PrivateKey) Decrypt ¶
func (priv *PrivateKey) Decrypt(_ io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error)
crypto.Decrypter
func (*PrivateKey) Equal ¶
func (priv *PrivateKey) Equal(x crypto.PrivateKey) bool
Equal reports whether priv and x have the same value.
func (*PrivateKey) Public ¶
func (priv *PrivateKey) Public() crypto.PublicKey
Public returns the public key corresponding to priv.
Click to show internal directories.
Click to hide internal directories.