Documentation ¶
Index ¶
- Constants
- func CurveNames() []string
- type Curve
- func EdwardsCurve(p, c, d, n, h, gx, gy *big.Int, bits uint) *Curve
- func MontgomeryCurve(p, B, A, n, h, gx, gy *big.Int, bits uint) *Curve
- func NamedCurve(name string) (z *Curve)
- func ShortWeierstrassCurve(p, a, b, n, h, gx, gy *big.Int, bits uint) *Curve
- func TwistedEdwardsCurve(p, a, d, n, h, gx, gy *big.Int, bits uint) *Curve
- type ECDSASignature
- type ECDSASignatureScheme
- type ECElgamalCiphertext
- type FieldElement
- func (z *FieldElement) Add(a, b *FieldElement) *FieldElement
- func (z *FieldElement) AsInt() (r *big.Int)
- func (z *FieldElement) Bit(i int) uint
- func (z *FieldElement) Cmp(a *FieldElement) int
- func (z *FieldElement) Exp(a *FieldElement, e uint64) *FieldElement
- func (z *FieldElement) Inv(a *FieldElement) (fe *FieldElement, err error)
- func (z *FieldElement) Mul(a, b *FieldElement) *FieldElement
- func (z *FieldElement) Neg(a *FieldElement) *FieldElement
- func (z *FieldElement) Order() (r *big.Int)
- func (z *FieldElement) Sqrt(a *FieldElement) (fe *FieldElement, err error)
- func (z *FieldElement) Sub(a, b *FieldElement) *FieldElement
- type Point
- func (z *Point) Add(a, b *Point) *Point
- func (z *Point) Affine() (x, y *big.Int)
- func (z *Point) BytesCompressed() []byte
- func (z *Point) BytesUncompressed() []byte
- func (z *Point) Cmp(a *Point) int
- func (z *Point) IsNeutral() bool
- func (z *Point) Mul(a *Point, b *big.Int) *Point
- func (z *Point) Neg(a *Point) *Point
- func (z *Point) Set(a *Point) *Point
- func (z *Point) SetupBaseMul()
- func (z *Point) StringCompressed() string
- func (z *Point) StringUncompressed() string
- func (z *Point) Sub(a, b *Point) *Point
Constants ¶
View Source
const ( EQTypeNone = iota EQTypeUninitialized = iota EQTypeShortWeierstrass = iota EQTypeEdwards = iota EQTypeMontgomery = iota EQTypeTwistedEdwards = iota )
curve types
Variables ¶
This section is empty.
Functions ¶
func CurveNames ¶
func CurveNames() []string
Types ¶
type Curve ¶
type Curve struct {
// contains filtered or unexported fields
}
func NamedCurve ¶
func ShortWeierstrassCurve ¶
func TwistedEdwardsCurve ¶
type ECDSASignature ¶
type ECDSASignature struct {
// contains filtered or unexported fields
}
func (*ECDSASignature) AsBytes ¶
func (sig *ECDSASignature) AsBytes() []byte
type ECDSASignatureScheme ¶
type ECDSASignatureScheme struct {
// contains filtered or unexported fields
}
func NewECDSASignatureScheme ¶
func NewECDSASignatureScheme(c *Curve, h hash.Hash) (ss *ECDSASignatureScheme)
func (*ECDSASignatureScheme) Sign ¶
func (ss *ECDSASignatureScheme) Sign(sK *big.Int, message []byte) *ECDSASignature
func (*ECDSASignatureScheme) SignatureFromBytes ¶
func (ss *ECDSASignatureScheme) SignatureFromBytes(gobytes []byte) *ECDSASignature
type ECElgamalCiphertext ¶
type ECElgamalCiphertext struct {
// contains filtered or unexported fields
}
func ECElgamalEncrypt ¶
func ECElgamalEncrypt(pK *Point, ptxt *Point) (ctxt *ECElgamalCiphertext)
func NewECElgamalCiphertext ¶
func NewECElgamalCiphertext(c, d *Point) (ctxt *ECElgamalCiphertext)
func (*ECElgamalCiphertext) C ¶
func (ctxt *ECElgamalCiphertext) C() (c *Point)
func (*ECElgamalCiphertext) D ¶
func (ctxt *ECElgamalCiphertext) D() (d *Point)
type FieldElement ¶
type FieldElement struct {
// contains filtered or unexported fields
}
func NewFieldElement ¶
func NewFieldElement(value, field *big.Int) (z *FieldElement)
func NewFieldElementUI ¶
func NewFieldElementUI(value uint64, field *big.Int) (z *FieldElement)
func NewFieldElementURandom ¶
func NewFieldElementURandom(field *big.Int) (z *FieldElement)
func (*FieldElement) Add ¶
func (z *FieldElement) Add(a, b *FieldElement) *FieldElement
func (*FieldElement) AsInt ¶
func (z *FieldElement) AsInt() (r *big.Int)
func (*FieldElement) Bit ¶
func (z *FieldElement) Bit(i int) uint
func (*FieldElement) Cmp ¶
func (z *FieldElement) Cmp(a *FieldElement) int
func (*FieldElement) Exp ¶
func (z *FieldElement) Exp(a *FieldElement, e uint64) *FieldElement
func (*FieldElement) Inv ¶
func (z *FieldElement) Inv(a *FieldElement) (fe *FieldElement, err error)
func (*FieldElement) Mul ¶
func (z *FieldElement) Mul(a, b *FieldElement) *FieldElement
func (*FieldElement) Neg ¶
func (z *FieldElement) Neg(a *FieldElement) *FieldElement
func (*FieldElement) Order ¶
func (z *FieldElement) Order() (r *big.Int)
func (*FieldElement) Sqrt ¶
func (z *FieldElement) Sqrt(a *FieldElement) (fe *FieldElement, err error)
func (*FieldElement) Sub ¶
func (z *FieldElement) Sub(a, b *FieldElement) *FieldElement
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func NewPointFromBytes ¶
func NewPointFromString ¶
func NewPointGenerator ¶
func NewPointNeutral ¶
func NewPointURandom ¶
func (*Point) BytesCompressed ¶
func (*Point) BytesUncompressed ¶
func (*Point) SetupBaseMul ¶
func (z *Point) SetupBaseMul()
func (*Point) StringCompressed ¶
func (*Point) StringUncompressed ¶
Click to show internal directories.
Click to hide internal directories.