utils

package
v0.0.0-...-4ec0ad6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteArrayToUintArray

func ByteArrayToUintArray(input []byte) []uint32

func New2DSlice

func New2DSlice(row int, col int) [][]byte

func UintToByteArray

func UintToByteArray(input [][]uint32) []byte

Types

type GaloisOp

type GaloisOp interface {
	Add(Gfield, Gfield) Gfield
	Sub(Gfield, Gfield) Gfield
	Mul(Gfield, Gfield) Gfield
	AccMul(Gfield, Gfield) Gfield
	Div(Gfield, Gfield) Gfield
}

type Gfield

type Gfield byte

FIXME: make sure this is right

func (*Gfield) AccMul

func (g *Gfield) AccMul(a Gfield, b Gfield) Gfield

Multiplication in galois field, GF(256)

a . b = (res)mod255

func (*Gfield) Add

func (g *Gfield) Add(a Gfield, b Gfield) Gfield

func (*Gfield) Div

func (g *Gfield) Div(a Gfield, b Gfield) Gfield

Make sure it is right

func (*Gfield) Sub

func (g *Gfield) Sub(a Gfield, b Gfield) Gfield

type Padder

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

Implementation of PKCS #7 as per RFC 2315

func NewPadder

func NewPadder(blockSize uint8) *Padder

func (*Padder) Pad

func (p *Padder) Pad(input []byte) ([]byte, error)

func (*Padder) Unpad

func (p *Padder) Unpad(input []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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