oberon

package
v0.0.0-...-81f100d Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blinding

type Blinding struct {
	Value *curves.PointBls12381G1
}

func NewBlinding

func NewBlinding(data []byte) (*Blinding, error)

func (*Blinding) Create

func (b *Blinding) Create(data []byte) error

func (Blinding) MarshalBinary

func (b Blinding) MarshalBinary() ([]byte, error)

func (Blinding) MarshalText

func (b Blinding) MarshalText() ([]byte, error)

func (*Blinding) UnmarshalBinary

func (b *Blinding) UnmarshalBinary(data []byte) error

func (*Blinding) UnmarshalText

func (b *Blinding) UnmarshalText(in []byte) error

type Proof

type Proof struct {
	UTick, Z *curves.PointBls12381G1
}

func NewProof

func NewProof(token *Token, blindings []*Blinding, id, nonce []byte, rng io.Reader) (*Proof, error)

func (*Proof) Create

func (p *Proof) Create(
	token *Token,
	blindings []*Blinding,
	id, nonce []byte,
	rng io.Reader,
) error

func (Proof) MarshalBinary

func (p Proof) MarshalBinary() ([]byte, error)

func (Proof) MarshalText

func (p Proof) MarshalText() ([]byte, error)

func (Proof) Open

func (p Proof) Open(
	pk *PublicKey,
	id, nonce []byte,
) error

func (*Proof) UnmarshalBinary

func (p *Proof) UnmarshalBinary(in []byte) error

func (*Proof) UnmarshalText

func (p *Proof) UnmarshalText(in []byte) error

type PublicKey

type PublicKey struct {
	W *curves.PointBls12381G2
	X *curves.PointBls12381G2
	Y *curves.PointBls12381G2
}

func (*PublicKey) FromSecretKey

func (p *PublicKey) FromSecretKey(sk *SecretKey)

func (PublicKey) MarshalBinary

func (p PublicKey) MarshalBinary() ([]byte, error)

func (PublicKey) MarshalText

func (p PublicKey) MarshalText() ([]byte, error)

func (*PublicKey) UnmarshalBinary

func (p *PublicKey) UnmarshalBinary(in []byte) error

func (*PublicKey) UnmarshalText

func (p *PublicKey) UnmarshalText(in []byte) error

func (*PublicKey) Verify

func (p *PublicKey) Verify(id []byte, t *Token) error

type SecretKey

type SecretKey struct {
	W *curves.ScalarBls12381
	X *curves.ScalarBls12381
	Y *curves.ScalarBls12381
}

func HashSecretKey

func HashSecretKey(data []byte) (*SecretKey, error)

func NewSecretKey

func NewSecretKey(reader io.Reader) (*SecretKey, error)

func (SecretKey) MarshalBinary

func (s SecretKey) MarshalBinary() ([]byte, error)

func (SecretKey) MarshalText

func (s SecretKey) MarshalText() ([]byte, error)

func (SecretKey) PublicKey

func (s SecretKey) PublicKey() *PublicKey

func (*SecretKey) Sign

func (s *SecretKey) Sign(id []byte) (*Token, error)

func (*SecretKey) UnmarshalBinary

func (s *SecretKey) UnmarshalBinary(in []byte) error

func (*SecretKey) UnmarshalText

func (s *SecretKey) UnmarshalText(in []byte) error

type Token

type Token struct {
	Value *curves.PointBls12381G1
}

func NewToken

func NewToken(sk *SecretKey, id []byte) (*Token, error)

func (*Token) ApplyBlinding

func (t *Token) ApplyBlinding(token *Token, b *Blinding) *Token

func (*Token) Create

func (t *Token) Create(sk *SecretKey, id []byte) error

Create a new token

func (Token) MarshalBinary

func (t Token) MarshalBinary() ([]byte, error)

func (Token) MarshalText

func (t Token) MarshalText() ([]byte, error)

func (*Token) RemoveBlinding

func (t *Token) RemoveBlinding(token *Token, b *Blinding) *Token

func (*Token) UnmarshalBinary

func (t *Token) UnmarshalBinary(data []byte) error

func (*Token) UnmarshalText

func (t *Token) UnmarshalText(in []byte) error

func (*Token) Verify

func (t *Token) Verify(pk *PublicKey, id []byte) error

Verify whether the token is valid to the public key

Jump to

Keyboard shortcuts

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