crypto

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

converter implements some routines to go back and forth from a protobuf point and scalar to a kyber Point and Scalar interface.

Package crypto is a generated protocol buffer package.

It is generated from these files:

crypto/element.proto

It has these top-level messages:

Point
Scalar

Index

Constants

This section is empty.

Variables

View Source
var GroupID_name = map[int32]string{
	0:  "Ed25519",
	21: "BN256_G1",
	22: "BN256_G2",
	23: "BN256_GT",
}
View Source
var GroupID_value = map[string]int32{
	"Ed25519":  0,
	"BN256_G1": 21,
	"BN256_G2": 22,
	"BN256_GT": 23,
}

Functions

func ProtoToKyberPoint

func ProtoToKyberPoint(p *ProtobufPoint) (kyber.Point, error)

func ProtoToKyberScalar

func ProtoToKyberScalar(p *ProtobufScalar) (kyber.Scalar, error)

Types

type GroupID

type GroupID int32

GroupID is an enumeration holding all possible groups that can be marshalled / unmarshalled, supported by the kyber library

const (
	GroupID_Ed25519  GroupID = 0
	GroupID_BN256_G1 GroupID = 21
	GroupID_BN256_G2 GroupID = 22
	GroupID_BN256_GT GroupID = 23
)

func (GroupID) EnumDescriptor

func (GroupID) EnumDescriptor() ([]byte, []int)

func (GroupID) String

func (x GroupID) String() string

type Point

type Point struct {
	Gid  GroupID `protobuf:"varint,1,opt,name=gid,enum=element.GroupID" json:"gid,omitempty"`
	Data []byte  `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

Point represents a point on a curve,i.e. a public key, a commitment etc It is parametrized by its group.

func (*Point) Descriptor

func (*Point) Descriptor() ([]byte, []int)

func (*Point) GetData

func (m *Point) GetData() []byte

func (*Point) GetGid

func (m *Point) GetGid() GroupID

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) Reset

func (m *Point) Reset()

func (*Point) String

func (m *Point) String() string

type ProtobufPoint

type ProtobufPoint = Point

func KyberToProtoPoint

func KyberToProtoPoint(p kyber.Point) (*ProtobufPoint, error)

type ProtobufScalar

type ProtobufScalar = Scalar

func KyberToProtoScalar

func KyberToProtoScalar(s kyber.Scalar) (*ProtobufScalar, error)

type Scalar

type Scalar struct {
	Gid  GroupID `protobuf:"varint,1,opt,name=gid,enum=element.GroupID" json:"gid,omitempty"`
	Data []byte  `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

Scalar represents a scalar on the field attached to the group. It is parametrized by the group using this field (1-1 mapping).

func (*Scalar) Descriptor

func (*Scalar) Descriptor() ([]byte, []int)

func (*Scalar) GetData

func (m *Scalar) GetData() []byte

func (*Scalar) GetGid

func (m *Scalar) GetGid() GroupID

func (*Scalar) ProtoMessage

func (*Scalar) ProtoMessage()

func (*Scalar) Reset

func (m *Scalar) Reset()

func (*Scalar) String

func (m *Scalar) String() string

Directories

Path Synopsis
Package share is a generated protocol buffer package.
Package share is a generated protocol buffer package.
vss
Package vss is a generated protocol buffer package.
Package vss is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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