ciphersuite

package
v0.0.0-...-a53afcb Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package ciphersuite provides the crypto operations needed for a DTLS CipherSuite

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CBC

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

CBC Provides an API to Encrypt/Decrypt DTLS 1.2 Packets

func NewCBC

func NewCBC(localKey, localWriteIV, localMac, remoteKey, remoteWriteIV, remoteMac []byte, h prf.HashFunc) (*CBC, error)

NewCBC creates a DTLS CBC Cipher

func (*CBC) Decrypt

func (c *CBC) Decrypt(in []byte) ([]byte, error)

Decrypt decrypts a DTLS RecordLayer message

func (*CBC) Encrypt

func (c *CBC) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

Encrypt encrypt a DTLS RecordLayer message

type CCM

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

CCM Provides an API to Encrypt/Decrypt DTLS 1.2 Packets

func NewCCM

func NewCCM(tagLen CCMTagLen, localKey, localWriteIV, remoteKey, remoteWriteIV []byte) (*CCM, error)

NewCCM creates a DTLS GCM Cipher

func (*CCM) Decrypt

func (c *CCM) Decrypt(in []byte) ([]byte, error)

Decrypt decrypts a DTLS RecordLayer message

func (*CCM) Encrypt

func (c *CCM) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

Encrypt encrypt a DTLS RecordLayer message

type CCMTagLen

type CCMTagLen int

CCMTagLen is the length of Authentication Tag

const (
	CCMTagLength8 CCMTagLen = 8
	CCMTagLength  CCMTagLen = 16
)

CCM Enums

type GCM

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

GCM Provides an API to Encrypt/Decrypt DTLS 1.2 Packets

func NewGCM

func NewGCM(localKey, localWriteIV, remoteKey, remoteWriteIV []byte) (*GCM, error)

NewGCM creates a DTLS GCM Cipher

func (*GCM) Decrypt

func (g *GCM) Decrypt(in []byte) ([]byte, error)

Decrypt decrypts a DTLS RecordLayer message

func (*GCM) Encrypt

func (g *GCM) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

Encrypt encrypt a DTLS RecordLayer message

Jump to

Keyboard shortcuts

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