eccrypt512

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2022 License: ISC Imports: 10 Imported by: 2

Documentation

Overview

ECC 512-bit Asymmetric Encryption Scheme

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CipherMarshal

func CipherMarshal(data []byte) ([]byte, error)

func CipherUnmarshal

func CipherUnmarshal(data []byte) ([]byte, error)

func Decrypt

func Decrypt(priv *PrivateKey, data []byte, mode int) ([]byte, error)

func DecryptAsn1

func DecryptAsn1(pub *PrivateKey, data []byte) ([]byte, error)

func Encrypt

func Encrypt(pub *PublicKey, data []byte, random io.Reader, mode int) ([]byte, error)

func EncryptAsn1

func EncryptAsn1(pub *PublicKey, data []byte, rand io.Reader) ([]byte, error)

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	D *big.Int
}

func (*PrivateKey) DecryptAsn1

func (priv *PrivateKey) DecryptAsn1(data []byte) ([]byte, error)

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypto.PublicKey

type PublicKey

type PublicKey struct {
	elliptic.Curve
	X, Y *big.Int
}

func (*PublicKey) EncryptAsn1

func (pub *PublicKey) EncryptAsn1(data []byte, random io.Reader) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL