Versions in this module Expand all Collapse all v0 v0.4.0 Dec 9, 2019 Changes in this version + const FieldElementSize + const K + const PrivateKeySize + const PublicKeySize + func AesCtr(key, plaintext []byte) ([]byte, error) + func BytesToString(b []byte) string + func CompareElements(e1, e2 CryptoElement) bool + func GenerateKeyPair() (*PrivateKey, *PublicKey, error) + func Hmac(key, message []byte) ([]byte, error) + func KDF(key []byte) ([]byte, error) + func ProcessSphinxHeader(packet Header, privKey *PrivateKey) (Hop, Commands, Header, error) + func ProcessSphinxPacket(packetBytes []byte, privKey *PrivateKey) (Hop, Commands, []byte, error) + func ProcessSphinxPayload(alpha []byte, payload []byte, privKey *PrivateKey) ([]byte, error) + func XorBytes(b1, b2 []byte) []byte + type Commands struct + Delay float64 + Flag []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Commands) Descriptor() ([]byte, []int) + func (*Commands) ProtoMessage() + func (m *Commands) GetDelay() float64 + func (m *Commands) GetFlag() []byte + func (m *Commands) Reset() + func (m *Commands) String() string + func (m *Commands) XXX_DiscardUnknown() + func (m *Commands) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Commands) XXX_Merge(src proto.Message) + func (m *Commands) XXX_Size() int + func (m *Commands) XXX_Unmarshal(b []byte) error + type CryptoElement interface + Bytes func() []byte + type FieldElement struct + func BytesToFieldElement(b []byte) *FieldElement + func RandomElement() (*FieldElement, error) + func (fe *FieldElement) Bytes() []byte + type Header struct + Alpha []byte + Beta []byte + Mac []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Header) Descriptor() ([]byte, []int) + func (*Header) ProtoMessage() + func (m *Header) GetAlpha() []byte + func (m *Header) GetBeta() []byte + func (m *Header) GetMac() []byte + func (m *Header) Reset() + func (m *Header) String() string + func (m *Header) XXX_DiscardUnknown() + func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Header) XXX_Merge(src proto.Message) + func (m *Header) XXX_Size() int + func (m *Header) XXX_Unmarshal(b []byte) error + type HeaderInitials struct + Alpha []byte + Blinder []byte + Secret []byte + SecretHash []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*HeaderInitials) Descriptor() ([]byte, []int) + func (*HeaderInitials) ProtoMessage() + func (m *HeaderInitials) GetAlpha() []byte + func (m *HeaderInitials) GetBlinder() []byte + func (m *HeaderInitials) GetSecret() []byte + func (m *HeaderInitials) GetSecretHash() []byte + func (m *HeaderInitials) Reset() + func (m *HeaderInitials) String() string + func (m *HeaderInitials) XXX_DiscardUnknown() + func (m *HeaderInitials) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *HeaderInitials) XXX_Merge(src proto.Message) + func (m *HeaderInitials) XXX_Size() int + func (m *HeaderInitials) XXX_Unmarshal(b []byte) error + type Hop struct + Address string + Id string + PubKey []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Hop) Descriptor() ([]byte, []int) + func (*Hop) ProtoMessage() + func (m *Hop) GetAddress() string + func (m *Hop) GetId() string + func (m *Hop) GetPubKey() []byte + func (m *Hop) Reset() + func (m *Hop) String() string + func (m *Hop) XXX_DiscardUnknown() + func (m *Hop) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Hop) XXX_Merge(src proto.Message) + func (m *Hop) XXX_Size() int + func (m *Hop) XXX_Unmarshal(b []byte) error + type PrivateKey struct + func BytesToPrivateKey(b []byte) *PrivateKey + func (pk *PrivateKey) Bytes() []byte + func (pk *PrivateKey) MarshalBinary() ([]byte, error) + func (pk *PrivateKey) ToFieldElement() *FieldElement + func (pk *PrivateKey) UnmarshalBinary(data []byte) error + type PublicKey struct + func BytesToPublicKey(b []byte) *PublicKey + func (pub *PublicKey) Bytes() []byte + func (pub *PublicKey) MarshalBinary() ([]byte, error) + func (pub *PublicKey) ToFieldElement() *FieldElement + func (pub *PublicKey) UnmarshalBinary(data []byte) error + type RoutingInfo struct + Mac []byte + NextHop *Hop + NextHopMetaData []byte + RoutingCommands *Commands + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*RoutingInfo) Descriptor() ([]byte, []int) + func (*RoutingInfo) ProtoMessage() + func (m *RoutingInfo) GetMac() []byte + func (m *RoutingInfo) GetNextHop() *Hop + func (m *RoutingInfo) GetNextHopMetaData() []byte + func (m *RoutingInfo) GetRoutingCommands() *Commands + func (m *RoutingInfo) Reset() + func (m *RoutingInfo) String() string + func (m *RoutingInfo) XXX_DiscardUnknown() + func (m *RoutingInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *RoutingInfo) XXX_Merge(src proto.Message) + func (m *RoutingInfo) XXX_Size() int + func (m *RoutingInfo) XXX_Unmarshal(b []byte) error + type SphinxPacket struct + Hdr *Header + Pld []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func PackForwardMessage(path config.E2EPath, delays []float64, message []byte) (SphinxPacket, error) + func (*SphinxPacket) Descriptor() ([]byte, []int) + func (*SphinxPacket) ProtoMessage() + func (m *SphinxPacket) GetHdr() *Header + func (m *SphinxPacket) GetPld() []byte + func (m *SphinxPacket) Reset() + func (m *SphinxPacket) String() string + func (m *SphinxPacket) XXX_DiscardUnknown() + func (m *SphinxPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *SphinxPacket) XXX_Merge(src proto.Message) + func (m *SphinxPacket) XXX_Size() int + func (m *SphinxPacket) XXX_Unmarshal(b []byte) error