csidh

package
v0.0.0-...-a7142b7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: BSD-2-Clause, BSD-3-Clause Imports: 3 Imported by: 3

Documentation

Overview

Package csidh implements cSIDH key exchange, isogeny-based scheme resulting from the group action. Implementation uses only prime field of a size 512-bits and uses Ed some performance improvements by using twisted Edwards curves in the isogeny image curve computations. This work has been described by M. Meyer and S. Reith in the ia.cr/2018/782. Original cSIDH paper can be found in the ia.cr/2018/383.

It is experimental implementation, not meant to be secure. Have fun!

Index

Constants

View Source
const (

	// PrivateKeySize is a size of cSIDH/512 private key in bytes.
	PrivateKeySize = 37
	// PublicKeySize is a size of cSIDH/512 public key in bytes.
	PublicKeySize = 64
	// SharedSecretSize is a size of cSIDH/512 shared secret in bytes.
	SharedSecretSize = 64
)

Variables

This section is empty.

Functions

func DeriveSecret

func DeriveSecret(out *[64]byte, pub *PublicKey, prv *PrivateKey, rng io.Reader) bool

DeriveSecret computes a cSIDH shared secret. If successful, returns true and fills 'out' with shared secret. Function returns false in case 'pub' is invalid. More precisely, shared secret is a Montgomery coefficient A of a secret curve y^2 = x^3 + Ax^2 + x, computed by applying action of a prv.e on a curve represented by pub.a.

func GeneratePrivateKey

func GeneratePrivateKey(key *PrivateKey, rng io.Reader) error

func GeneratePublicKey

func GeneratePublicKey(pub *PublicKey, prv *PrivateKey, rng io.Reader)

func Validate

func Validate(pub *PublicKey, rng io.Reader) bool

Validate returns true if 'pub' is a valid cSIDH public key, otherwise false. More precisely, the function verifies that curve

y^2 = x^3 + pub.a * x^2 + x

is supersingular.

Types

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

Defines operations on private key

func (PrivateKey) Export

func (c PrivateKey) Export(out []byte) bool

func (*PrivateKey) Import

func (c *PrivateKey) Import(key []byte) bool

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

Defines operations on public key

func (*PublicKey) Export

func (c *PublicKey) Export(out []byte) bool

Assumes key is exported as encoded in Montgomery domain.

func (*PublicKey) Import

func (c *PublicKey) Import(key []byte) bool

Assumes key is in Montgomery domain.

Jump to

Keyboard shortcuts

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