safer

package
v1.0.2065 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SAFER_K64_DEFAULT_NOF_ROUNDS   = 6
	SAFER_K128_DEFAULT_NOF_ROUNDS  = 10
	SAFER_SK64_DEFAULT_NOF_ROUNDS  = 8
	SAFER_SK128_DEFAULT_NOF_ROUNDS = 10
	SAFER_MAX_NOF_ROUNDS           = 13
	SAFER_BLOCK_LEN                = 8
)
View Source
const BlockSize = 8

Variables

View Source
var SAFER_KEY_LEN = (1 + SAFER_BLOCK_LEN*(1+2*SAFER_MAX_NOF_ROUNDS))

Functions

func EXP

func EXP(x uint8) uint8

func IPHT

func IPHT(x *uint8, y *uint8)

func LOG

func LOG(x uint8) uint8

func NewCipher

func NewCipher(key []byte, rounds int32) (cipher.Block, error)

NewCipher creates and returns a new cipher.Block.

func NewKCipher

func NewKCipher(key []byte, rounds int32) (cipher.Block, error)

NewKCipher creates and returns a new cipher.Block.

func NewSKCipher

func NewSKCipher(key []byte, rounds int32) (cipher.Block, error)

NewSKCipher creates and returns a new cipher.Block.

func PHT

func PHT(x *uint8, y *uint8)

func ROL8

func ROL8(x, n uint8) uint8

func Safer_Expand_Userkey

func Safer_Expand_Userkey(
	userkey_1 []uint8,
	userkey_2 []uint8,
	nof_rounds uint32,
	strengthened int32,
	key []uint8,
)

Types

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (k KeySizeError) Error() string

Jump to

Keyboard shortcuts

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