vectors

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package vectors provides types for the JSON formatted test vectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Vectors []Vector `json:"vectors"`
}

File is a collection of test vectors.

type HexBuffer

type HexBuffer []byte

HexBuffer is a byte slice that will marshal to/unmarshal from a hex encoded string.

func (*HexBuffer) MarshalText

func (x *HexBuffer) MarshalText() ([]byte, error)

MarshalText implements the TextMarshaler interface.

func (*HexBuffer) UnmarshalText

func (x *HexBuffer) UnmarshalText(data []byte) error

UnmarshalText implements the TextUnmarshaler interface.

type Message

type Message struct {
	Payload    HexBuffer `json:"payload"`
	Ciphertext HexBuffer `json:"ciphertext"`
}

Message is a test vector handshake message.

type Vector

type Vector struct {
	Name string `json:"name"`

	ProtocolName    string `json:"protocol_name"`
	Fail            bool   `json:"fail"`
	Fallback        bool   `json:"fallback"`
	FallbackPattern string `json:"fallback_pattern"`

	InitPrologue     HexBuffer   `json:"init_prologue"`
	InitPsks         []HexBuffer `json:"init_psks"`
	InitStatic       HexBuffer   `json:"init_static"`
	InitEphemeral    HexBuffer   `json:"init_ephemeral"`
	InitRemoteStatic HexBuffer   `json:"init_remote_static"`

	RespPrologue     HexBuffer   `json:"resp_prologue"`
	RespPsks         []HexBuffer `json:"resp_psks"`
	RespStatic       HexBuffer   `json:"resp_static"`
	RespEphemeral    HexBuffer   `json:"resp_ephemeral"`
	RespRemoteStatic HexBuffer   `json:"resp_remote_static"`

	HandshakeHash HexBuffer `json:"handshake_hash"`

	Messages []Message `json:"messages"`
}

Vector is a single test vector case.

Jump to

Keyboard shortcuts

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