Documentation ¶
Index ¶
- Constants
- Variables
- func NewHmacSha512(key []byte) *hmacSHA512
- func NewShareManager(share *big.Int, pubKey *ecpointgrouplaw.ECPoint, chainCode []byte, depth byte, ...) (*shareManager, error)
- func Sha512Compression(p []byte, preState []uint64) []uint64
- func Sha512GetBlockWithPadding(p []byte) ([]byte, error)
- type BodyEncH
- type BodyInitial
- func (*BodyInitial) Descriptor() ([]byte, []int)deprecated
- func (x *BodyInitial) GetGarcirMsg() *circuit.GarbleCircuitMessage
- func (x *BodyInitial) GetOtRecMsg() *ot.OtReceiverMessage
- func (x *BodyInitial) GetOtherInfoWire() [][]byte
- func (x *BodyInitial) GetPubKey() []byte
- func (x *BodyInitial) GetPubKeyN() []byte
- func (x *BodyInitial) GetShareGProofMsg() *zkproof.SchnorrProofMessage
- func (*BodyInitial) ProtoMessage()
- func (x *BodyInitial) ProtoReflect() protoreflect.Message
- func (x *BodyInitial) Reset()
- func (x *BodyInitial) String() string
- type BodyOtReceiver
- func (*BodyOtReceiver) Descriptor() ([]byte, []int)deprecated
- func (x *BodyOtReceiver) GetOtExtReceiveMsg() *ot.OtExtReceiveMessage
- func (*BodyOtReceiver) ProtoMessage()
- func (x *BodyOtReceiver) ProtoReflect() protoreflect.Message
- func (x *BodyOtReceiver) Reset()
- func (x *BodyOtReceiver) String() string
- type BodyOtSendResponse
- func (*BodyOtSendResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BodyOtSendResponse) GetOtExtSendResponseMsg() *ot.OtExtSendResponseMessage
- func (*BodyOtSendResponse) ProtoMessage()
- func (x *BodyOtSendResponse) ProtoReflect() protoreflect.Message
- func (x *BodyOtSendResponse) Reset()
- func (x *BodyOtSendResponse) String() string
- type BodySh2Hash
- func (*BodySh2Hash) Descriptor() ([]byte, []int)deprecated
- func (x *BodySh2Hash) GetResult() []byte
- func (x *BodySh2Hash) GetSh2Hash() []byte
- func (*BodySh2Hash) ProtoMessage()
- func (x *BodySh2Hash) ProtoReflect() protoreflect.Message
- func (x *BodySh2Hash) Reset()
- func (x *BodySh2Hash) String() string
- type Child
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (m *Message) GetBody() isMessage_Body
- func (x *Message) GetEncH() *BodyEncH
- func (x *Message) GetId() string
- func (x *Message) GetInitial() *BodyInitial
- func (m *Message) GetMessageType() types.MessageType
- func (x *Message) GetOtReceiver() *BodyOtReceiver
- func (x *Message) GetOtSendResponse() *BodyOtSendResponse
- func (x *Message) GetSh2Hash() *BodySh2Hash
- func (x *Message) GetType() Type
- func (m *Message) IsValid() bool
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type Message_EncH
- type Message_Initial
- type Message_OtReceiver
- type Message_OtSendResponse
- type Message_Sh2Hash
- type Result
- type Type
Constants ¶
View Source
const ( MAXUINT32 = 2147483647 SHA512BlOCKSIZE = 1024 MAXUINT64 = 18446744073709551615 SHA512PADDING = 896 )
We implement a version of "garbled circuit" according to paper: "Better Concrete Security for Half-Gates Garbling" and "Two Halves Make a Whole Reducing data Transfer in Garbled Circuits using Half Gates". We support the parse of Bristol fashion ref: https://homes.esat.kuleuven.be/~nsmart/MPC/
View Source
const ( // MinHardenKey is the first index of "harded" child key in the bip32 spec MinHardenKey = uint32(0x80000000) // PublicKeyCompressedLength is the byte count of a compressed public key PublicKeyCompressedLength = 33 )
View Source
const (
PaillierLength = 2048
)
Variables ¶
View Source
var ( ErrPeerNotFound = errors.New("peer message not found") ErrInvalidSeed = errors.New("invalid seed") )
View Source
var ( // ErrSliceLength is returned if two slices are different. ErrSliceLength = errors.New("two slices are different") // ErrVerifyFailure is returned the verify failures. ErrVerifyFailure = errors.New("the verify failures") )
View Source
var ( ConstantSHA512 = []uint64{ 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, 0x3956c25bf348b538, 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242, 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df, 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218, 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, 0xca273eceea26619c, 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b, 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817, } // ErrInputSizeLarge is returned if the size of input is too large ErrInputSizeLarge = errors.New("large input") )
View Source
var ( Type_name = map[int32]string{ 0: "Initial", 1: "OtReceiver", 2: "OtSendResponse", 3: "EncH", 4: "Sh2Hash", } Type_value = map[string]int32{ "Initial": 0, "OtReceiver": 1, "OtSendResponse": 2, "EncH": 3, "Sh2Hash": 4, } )
Enum value maps for Type.
View Source
var ( // ErrNonHardenedKey is returned the index < MinHardenKey ErrNonHardenedKey = errors.New("the index can not produce any hardened key") // ErrHardenedKey is returned the index >= MinHardenKey ErrHardenedKey = errors.New("the index can not produce any nonhardened key") // ErrInvalidTranslation is invalid translate ErrInvalidTranslation = errors.New("invalid translate") // ErrIdentityChildPublicKey is the child public key is identity ErrIdentityChildPublicKey = errors.New("identity child public key") ErrNotCorrectShare = errors.New("the share value is invalid") )
View Source
var (
ErrNotReady = errors.New("not ready")
)
View Source
var File_github_com_getamis_alice_crypto_bip32_child_message_proto protoreflect.FileDescriptor
Functions ¶
func NewHmacSha512 ¶
func NewHmacSha512(key []byte) *hmacSHA512
func NewShareManager ¶
func NewShareManager(share *big.Int, pubKey *ecpointgrouplaw.ECPoint, chainCode []byte, depth byte, bks map[string]*birkhoffinterpolation.BkParameter, selfId string) (*shareManager, error)
func Sha512Compression ¶
WARN: p is bit-Slice
Types ¶
type BodyEncH ¶
type BodyEncH struct { EncH []byte `protobuf:"bytes,1,opt,name=encH,proto3" json:"encH,omitempty"` // contains filtered or unexported fields }
func (*BodyEncH) Descriptor
deprecated
func (*BodyEncH) ProtoMessage ¶
func (*BodyEncH) ProtoMessage()
func (*BodyEncH) ProtoReflect ¶
func (x *BodyEncH) ProtoReflect() protoreflect.Message
type BodyInitial ¶
type BodyInitial struct { OtRecMsg *ot.OtReceiverMessage `protobuf:"bytes,1,opt,name=otRecMsg,proto3" json:"otRecMsg,omitempty"` GarcirMsg *circuit.GarbleCircuitMessage `protobuf:"bytes,2,opt,name=garcirMsg,proto3" json:"garcirMsg,omitempty"` OtherInfoWire [][]byte `protobuf:"bytes,3,rep,name=otherInfoWire,proto3" json:"otherInfoWire,omitempty"` PubKey []byte `protobuf:"bytes,4,opt,name=pubKey,proto3" json:"pubKey,omitempty"` PubKeyN []byte `protobuf:"bytes,5,opt,name=pubKeyN,proto3" json:"pubKeyN,omitempty"` // contains filtered or unexported fields }
func (*BodyInitial) Descriptor
deprecated
func (*BodyInitial) Descriptor() ([]byte, []int)
Deprecated: Use BodyInitial.ProtoReflect.Descriptor instead.
func (*BodyInitial) GetGarcirMsg ¶
func (x *BodyInitial) GetGarcirMsg() *circuit.GarbleCircuitMessage
func (*BodyInitial) GetOtRecMsg ¶
func (x *BodyInitial) GetOtRecMsg() *ot.OtReceiverMessage
func (*BodyInitial) GetOtherInfoWire ¶
func (x *BodyInitial) GetOtherInfoWire() [][]byte
func (*BodyInitial) GetPubKey ¶
func (x *BodyInitial) GetPubKey() []byte
func (*BodyInitial) GetPubKeyN ¶
func (x *BodyInitial) GetPubKeyN() []byte
func (*BodyInitial) GetShareGProofMsg ¶
func (x *BodyInitial) GetShareGProofMsg() *zkproof.SchnorrProofMessage
func (*BodyInitial) ProtoMessage ¶
func (*BodyInitial) ProtoMessage()
func (*BodyInitial) ProtoReflect ¶
func (x *BodyInitial) ProtoReflect() protoreflect.Message
func (*BodyInitial) Reset ¶
func (x *BodyInitial) Reset()
func (*BodyInitial) String ¶
func (x *BodyInitial) String() string
type BodyOtReceiver ¶
type BodyOtReceiver struct { OtExtReceiveMsg *ot.OtExtReceiveMessage `protobuf:"bytes,1,opt,name=otExtReceiveMsg,proto3" json:"otExtReceiveMsg,omitempty"` // contains filtered or unexported fields }
func (*BodyOtReceiver) Descriptor
deprecated
func (*BodyOtReceiver) Descriptor() ([]byte, []int)
Deprecated: Use BodyOtReceiver.ProtoReflect.Descriptor instead.
func (*BodyOtReceiver) GetOtExtReceiveMsg ¶
func (x *BodyOtReceiver) GetOtExtReceiveMsg() *ot.OtExtReceiveMessage
func (*BodyOtReceiver) ProtoMessage ¶
func (*BodyOtReceiver) ProtoMessage()
func (*BodyOtReceiver) ProtoReflect ¶
func (x *BodyOtReceiver) ProtoReflect() protoreflect.Message
func (*BodyOtReceiver) Reset ¶
func (x *BodyOtReceiver) Reset()
func (*BodyOtReceiver) String ¶
func (x *BodyOtReceiver) String() string
type BodyOtSendResponse ¶
type BodyOtSendResponse struct { OtExtSendResponseMsg *ot.OtExtSendResponseMessage `protobuf:"bytes,1,opt,name=otExtSendResponseMsg,proto3" json:"otExtSendResponseMsg,omitempty"` // contains filtered or unexported fields }
func (*BodyOtSendResponse) Descriptor
deprecated
func (*BodyOtSendResponse) Descriptor() ([]byte, []int)
Deprecated: Use BodyOtSendResponse.ProtoReflect.Descriptor instead.
func (*BodyOtSendResponse) GetOtExtSendResponseMsg ¶
func (x *BodyOtSendResponse) GetOtExtSendResponseMsg() *ot.OtExtSendResponseMessage
func (*BodyOtSendResponse) ProtoMessage ¶
func (*BodyOtSendResponse) ProtoMessage()
func (*BodyOtSendResponse) ProtoReflect ¶
func (x *BodyOtSendResponse) ProtoReflect() protoreflect.Message
func (*BodyOtSendResponse) Reset ¶
func (x *BodyOtSendResponse) Reset()
func (*BodyOtSendResponse) String ¶
func (x *BodyOtSendResponse) String() string
type BodySh2Hash ¶
type BodySh2Hash struct { Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` Sh2Hash []byte `protobuf:"bytes,2,opt,name=sh2Hash,proto3" json:"sh2Hash,omitempty"` // contains filtered or unexported fields }
func (*BodySh2Hash) Descriptor
deprecated
func (*BodySh2Hash) Descriptor() ([]byte, []int)
Deprecated: Use BodySh2Hash.ProtoReflect.Descriptor instead.
func (*BodySh2Hash) GetResult ¶
func (x *BodySh2Hash) GetResult() []byte
func (*BodySh2Hash) GetSh2Hash ¶
func (x *BodySh2Hash) GetSh2Hash() []byte
func (*BodySh2Hash) ProtoMessage ¶
func (*BodySh2Hash) ProtoMessage()
func (*BodySh2Hash) ProtoReflect ¶
func (x *BodySh2Hash) ProtoReflect() protoreflect.Message
func (*BodySh2Hash) Reset ¶
func (x *BodySh2Hash) Reset()
func (*BodySh2Hash) String ¶
func (x *BodySh2Hash) String() string
type Child ¶
func NewAlice ¶
func NewAlice(peerManager types.PeerManager, sid []uint8, share *big.Int, bks map[string]*birkhoffinterpolation.BkParameter, path string, chainCode []byte, depth uint8, childIndex uint32, pubKey *ecpointgrouplaw.ECPoint, listener types.StateChangedListener) (*Child, error)
func NewBob ¶
func NewBob(peerManager types.PeerManager, sid []uint8, share *big.Int, bks map[string]*birkhoffinterpolation.BkParameter, path string, chainCode []byte, depth uint8, childIndex uint32, pubKey *ecpointgrouplaw.ECPoint, listener types.StateChangedListener) (*Child, error)
type Message ¶
type Message struct { Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=getamis.alice.crypto.bip32.child.Type" json:"type,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Body: // *Message_Initial // *Message_OtReceiver // *Message_OtSendResponse // *Message_EncH // *Message_Sh2Hash Body isMessage_Body `protobuf_oneof:"body"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetInitial ¶
func (x *Message) GetInitial() *BodyInitial
func (*Message) GetMessageType ¶
func (m *Message) GetMessageType() types.MessageType
func (*Message) GetOtReceiver ¶
func (x *Message) GetOtReceiver() *BodyOtReceiver
func (*Message) GetOtSendResponse ¶
func (x *Message) GetOtSendResponse() *BodyOtSendResponse
func (*Message) GetSh2Hash ¶
func (x *Message) GetSh2Hash() *BodySh2Hash
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type Message_EncH ¶
type Message_EncH struct {
EncH *BodyEncH `protobuf:"bytes,6,opt,name=encH,proto3,oneof"`
}
type Message_Initial ¶
type Message_Initial struct {
Initial *BodyInitial `protobuf:"bytes,3,opt,name=initial,proto3,oneof"`
}
type Message_OtReceiver ¶
type Message_OtReceiver struct {
OtReceiver *BodyOtReceiver `protobuf:"bytes,4,opt,name=otReceiver,proto3,oneof"`
}
type Message_OtSendResponse ¶
type Message_OtSendResponse struct {
OtSendResponse *BodyOtSendResponse `protobuf:"bytes,5,opt,name=otSendResponse,proto3,oneof"`
}
type Message_Sh2Hash ¶
type Message_Sh2Hash struct {
Sh2Hash *BodySh2Hash `protobuf:"bytes,7,opt,name=sh2Hash,proto3,oneof"`
}
type Type ¶
type Type int32
func (Type) Descriptor ¶
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
func (Type) Number ¶
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶
func (Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.