Documentation
¶
Overview ¶
Package ed448 provides a generator function for the Ed448 Edwards Curve
Ed448 provides a interface to use the Ed448 curve.
Index ¶
- type EdKey
- func (k *EdKey) Decrypt(ciphertext []byte, cipher rome.Cipher, hash hash.Hash, options ...rome.Option) ([]byte, error)
- func (k *EdKey) Private() ([]byte, error)
- func (k *EdKey) PrivateASN1() ([]byte, error)
- func (k *EdKey) PrivateRaw() []byte
- func (k *EdKey) Public() rome.PublicKey
- func (k *EdKey) PublicRaw() []byte
- func (k *EdKey) Sign(digest []byte) ([]byte, error)
- type EdPublicKey
- func (k *EdPublicKey) Bits() int
- func (k *EdPublicKey) DH(h hash.Hash, g rome.PrivateKey, options ...rome.Option) ([]byte, error)
- func (k *EdPublicKey) Encrypt(msg []byte, cipher rome.Cipher, hash hash.Hash, options ...rome.Option) ([]byte, error)
- func (k *EdPublicKey) Fingerprint(h hash.Hash) []byte
- func (k *EdPublicKey) Key() ([]byte, error)
- func (k *EdPublicKey) KeyASN1() ([]byte, error)
- func (k *EdPublicKey) Name() string
- func (k *EdPublicKey) Points() (x *big.Int, y *big.Int)
- func (k *EdPublicKey) Size() int
- func (k *EdPublicKey) Verify(msg []byte, signature []byte) (bool, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EdKey ¶
type EdKey struct {
// contains filtered or unexported fields
}
EdKey is a Edwards Curve private key
func Generate ¶
Generate will create a new Ed25519 edward curve public/private key pair
Example ¶
package main import ( "fmt" "github.com/go-compile/rome/ed448" ) func main() { k, err := ed448.Generate() if err != nil { panic(err) } fmt.Printf("Curve: %s\n", k.Public().Name()) }
Output: Curve: ED448
func ParseEdPrivate ¶
ParseEdPrivate will read a PEM ASN.1 DER encoded key
func ParseEdPrivateASN1 ¶
ParseEdPrivateASN1 will read a ASN.1 DER encoded key
func PrivateFrom ¶
PrivateFrom will take the private key bytes and return a EdKey
func (*EdKey) Decrypt ¶
func (k *EdKey) Decrypt(ciphertext []byte, cipher rome.Cipher, hash hash.Hash, options ...rome.Option) ([]byte, error)
Decrypt is not supported on Edwards Curves
func (*EdKey) PrivateASN1 ¶
PrivateASN1 will return the private key as ASN.1 DER bytes
func (*EdKey) PrivateRaw ¶
PrivateRaw returns the private bytes D
type EdPublicKey ¶
type EdPublicKey []byte
EdPublicKey is a Edward Curve public key
func ParseEdPublic ¶
func ParseEdPublic(public []byte) (*EdPublicKey, error)
ParseEdPublic will read edward curve public key from PEM ASN.1 DER format
func ParseEdPublicASN1 ¶
func ParseEdPublicASN1(der []byte) (*EdPublicKey, error)
ParseEdPublicASN1 will read a edward curve public key from ASN.1 DER format
func PublicFrom ¶
func PublicFrom(p []byte) *EdPublicKey
PublicFrom will take the public key bytes and return a EdPublic key
func (*EdPublicKey) Bits ¶
func (k *EdPublicKey) Bits() int
Bits returns the size of the key in bits
func (*EdPublicKey) DH ¶
func (k *EdPublicKey) DH(h hash.Hash, g rome.PrivateKey, options ...rome.Option) ([]byte, error)
DH is a placeholder function to satisfy rome's Key interface.
func (*EdPublicKey) Encrypt ¶
func (k *EdPublicKey) Encrypt(msg []byte, cipher rome.Cipher, hash hash.Hash, options ...rome.Option) ([]byte, error)
Encrypt is not supported on Edwards Curves
func (*EdPublicKey) Fingerprint ¶
func (k *EdPublicKey) Fingerprint(h hash.Hash) []byte
Fingerprint returns the hashed ASN.1 digest representing this public key. This function will panic if it fails to encode the public key.
func (*EdPublicKey) Key ¶
func (k *EdPublicKey) Key() ([]byte, error)
Key returns the public key in PEM ASN.1 DER format
func (*EdPublicKey) KeyASN1 ¶
func (k *EdPublicKey) KeyASN1() ([]byte, error)
KeyASN1 returns the public key formatted in ASN.1
func (*EdPublicKey) Name ¶
func (k *EdPublicKey) Name() string
Name returns the name of the Edward Curve
func (*EdPublicKey) Points ¶
func (k *EdPublicKey) Points() (x *big.Int, y *big.Int)
Points are not implemented for Edward Curves. Usage will result in a panic.
func (*EdPublicKey) Size ¶
func (k *EdPublicKey) Size() int
Size returns the size of the key in bytes