key

package
v0.0.0-...-65bcca3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveSecret

func DeriveSecret(secret []byte, label []byte, messages ...[]byte) []byte

func HkdfExpandLabel

func HkdfExpandLabel(secret []byte, label []byte, context []byte, length uint16) []byte

HKDF-Expand-Label(Secret, Label, Context, Length) = HKDF-Expand(Secret, HkdfLabel, Length)

func TranscriptHash

func TranscriptHash(messages ...[]byte) []byte

Types

type ClientKeys

type ClientKeys struct {
	// contains filtered or unexported fields
}

func (ClientKeys) DecryptTLSCiphertext

func (k ClientKeys) DecryptTLSCiphertext(encrypted record.TLSCiphertext, messages ...[]byte) []byte

func (ClientKeys) GetEarlySecret

func (k ClientKeys) GetEarlySecret() []byte

0 | v PSK -> HKDF-Extract = Early Secret

func (ClientKeys) GetFinishedKey

func (k ClientKeys) GetFinishedKey(messages ...[]byte) []byte

func (ClientKeys) GetHandshakeSecret

func (k ClientKeys) GetHandshakeSecret() []byte

| +-----> Derive-Secret(., "ext binder" | "res binder", "") | = binder_key | +-----> Derive-Secret(., "c e traffic", ClientHello) | = client_early_traffic_secret | +-----> Derive-Secret(., "e exp master", ClientHello) | = early_exporter_master_secret v Derive-Secret(., "derived", "") | v (EC)DHE -> HKDF-Extract = Handshake Secret

func (ClientKeys) GetServerHandshakeTrafficSecret

func (k ClientKeys) GetServerHandshakeTrafficSecret(messages ...[]byte) []byte

| +-----> Derive-Secret(., "c hs traffic", | ClientHello...ServerHello) | = client_handshake_traffic_secret | +-----> Derive-Secret(., "s hs traffic", | ClientHello...ServerHello) | = server_handshake_traffic_secret

func (*ClientKeys) SetClientPrivateKey

func (k *ClientKeys) SetClientPrivateKey(privateKey []byte)

func (*ClientKeys) SetCurve

func (k *ClientKeys) SetCurve(curve elliptic.Curve)

func (*ClientKeys) SetServerPublicKey

func (k *ClientKeys) SetServerPublicKey(publicKey []byte)

func (ClientKeys) Verify

func (k ClientKeys) Verify(f handshake.Finished, messages ...[]byte) bool

type HkdfLabel

type HkdfLabel struct {
	// contains filtered or unexported fields
}

func NewHkdfLabel

func NewHkdfLabel(length uint16, label []byte, context []byte) HkdfLabel

func (HkdfLabel) Encode

func (l HkdfLabel) Encode() []byte

Jump to

Keyboard shortcuts

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