scmp_auth

package
v0.0.0-...-c8fc2fc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectionLength = 1
	PaddingLength   = 3
	MACLength       = 16

	DirectionOffset  = spse.SecModeLength
	MACOffset        = DirectionOffset + DirectionLength + PaddingLength
	DRKeyTotalLength = MACOffset + MACLength
)
View Source
const (
	MaxHeight = 16

	HeightLength    = 1
	ReservedLength  = 1
	OrderLength     = 2
	SignatureLength = 64
	HashLength      = 16

	HeightOffset    = spse.SecModeLength
	OrderOffset     = HeightOffset + ReservedLength + HeightLength
	SignatureOffset = OrderOffset + OrderLength
	HashesOffset    = SignatureOffset + SignatureLength
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DRKeyExtn

type DRKeyExtn struct {
	*spse.BaseExtn
	// Direction indicates which key has been used during authentication.
	Direction Dir
	// MAC is the mac of the SCION Packet with CurrHF and CurrINF set to zero.
	MAC common.RawBytes
}

DRKeyExtn is an implementation of the SCMPAuthDRKey extension. It is used to authenticate scmp messages.

func NewDRKeyExtn

func NewDRKeyExtn() *DRKeyExtn

func (*DRKeyExtn) Copy

func (s *DRKeyExtn) Copy() common.Extension

func (*DRKeyExtn) Len

func (s *DRKeyExtn) Len() int

func (*DRKeyExtn) Pack

func (s *DRKeyExtn) Pack() (common.RawBytes, error)

func (DRKeyExtn) SetDirection

func (s DRKeyExtn) SetDirection(dir Dir) error

func (DRKeyExtn) SetMAC

func (s DRKeyExtn) SetMAC(mac common.RawBytes) error

func (*DRKeyExtn) String

func (s *DRKeyExtn) String() string

func (*DRKeyExtn) Write

func (s *DRKeyExtn) Write(b common.RawBytes) error

type Dir

type Dir uint8
const (
	AsToAs             Dir = iota // Authenticated with S -> D
	AsToHost                      // Authenticated with S -> D:HD
	HostToHost                    // Authenticated with S:HS -> D:HD
	HostToAs                      // Authenticated with D -> S:HS
	AsToAsReversed                // Authenticated with D -> S
	HostToHostReversed            // Authenticated with D:HD -> S:HS
)

func (Dir) String

func (d Dir) String() string

type HashTreeExtn

type HashTreeExtn struct {
	*spse.BaseExtn
	// Height is the height of the hash tree. Max height is 16.
	Height uint8
	// Order is a bit vector. The bit at index i is associated with hash i.
	// 0 (1) indicates hash i shall be used as left (right) input.
	Order common.RawBytes
	// Signature is the signature of the root hash.
	Signature common.RawBytes
	// Hashes are the hashes to verify the proof.
	// At index 0 is the leaf hash. At index height is the root hash.
	Hashes common.RawBytes
}

HashTreeExtn is the implementation of the SCMPAuthHashTree extension. It is used to authenticate scmp messages.

func NewHashTreeExtn

func NewHashTreeExtn(height uint8) (*HashTreeExtn, error)

func (*HashTreeExtn) Copy

func (s *HashTreeExtn) Copy() common.Extension

func (*HashTreeExtn) Len

func (s *HashTreeExtn) Len() int

func (*HashTreeExtn) Pack

func (s *HashTreeExtn) Pack() (common.RawBytes, error)

func (HashTreeExtn) SetHashes

func (s HashTreeExtn) SetHashes(hashes common.RawBytes) error

func (HashTreeExtn) SetOrder

func (s HashTreeExtn) SetOrder(order common.RawBytes) error

func (HashTreeExtn) SetSignature

func (s HashTreeExtn) SetSignature(signature common.RawBytes) error

func (*HashTreeExtn) String

func (s *HashTreeExtn) String() string

func (*HashTreeExtn) Write

func (s *HashTreeExtn) Write(b common.RawBytes) error

Jump to

Keyboard shortcuts

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