Documentation ¶
Overview ¶
Package ecdsa provides ECDSA signature scheme on the bls12-377 curve.
The implementation is adapted from https://pkg.go.dev/crypto/ecdsa. Copyright 2011 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Documentation: - Wikipedia: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm - FIPS 186-4: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf - SEC 1, v-2: https://www.secg.org/sec1-v2.pdf
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrivateKey ¶
type PrivateKey struct { PublicKey PublicKey // contains filtered or unexported fields }
PrivateKey represents an ECDSA private key
func GenerateKey ¶
func GenerateKey(rand io.Reader) (*PrivateKey, error)
GenerateKey generates a public and private key pair.
func (*PrivateKey) Bytes ¶
func (privKey *PrivateKey) Bytes() []byte
Bytes returns the binary representation of pk, as byte array publicKey||scalar where publicKey is as publicKey.Bytes(), and scalar is in big endian, of size sizeFr.
func (*PrivateKey) Public ¶
func (privKey *PrivateKey) Public() signature.PublicKey
Public returns the public key associated to the private key.
type PublicKey ¶
type PublicKey struct {
A bls12377.G1Affine
}
PublicKey represents an ECDSA public key
func (*PublicKey) Bytes ¶
Bytes returns the binary representation of the public key follows https://tools.ietf.org/html/rfc8032#section-3.1 and returns a compressed representation of the point (x,y)
x, y are the coordinates of the point on the curve as big endian integers. compressed representation store x with a parity bit to recompute y