rc5

package
v1.0.2062 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	W16  = 16      // word size in bits
	WW16 = W16 / 8 // word size in bytes
	B16  = 32      // block size in bits
	BB16 = B16 / 8 // block size in bytes

	// BlockSize the RC5/16 block size in bytes.
	BlockSize16 = BB16

	P16 = 0xb7e1
	Q16 = 0x9e37
)
View Source
const (
	// BlockSize the RC5/32 block size in bytes.
	BlockSize32 = 8
	P32         = 0xB7E15163
	Q32         = 0x9E3779B9
)
View Source
const (
	// BlockSize the RC5/64 block size in bytes.
	BlockSize64 = 16
	P64         = 0xB7E151628AED2A6B
	Q64         = 0x9E3779B97F4A7C15
)

Variables

This section is empty.

Functions

func NewCipher

func NewCipher(key []byte, wordSize, r uint) (cipher.Block, error)

NewCipher creates and returns a new cipher.Block. The key argument should be the RC5 key, the wordSize arguement should be word size in bits, the r argument should be number of rounds.

func NewCipher16 added in v1.0.2033

func NewCipher16(key []byte, r uint) (cipher.Block, error)

NewCipher16 creates and returns a new cipher.Block with 16 bits word size. The key argument should be the RC5 key, the r argument should be number of rounds.

func NewCipher32

func NewCipher32(key []byte, r uint) (cipher.Block, error)

NewCipher32 creates and returns a new cipher.Block with 32 bits word size. The key argument should be the RC5 key, the r argument should be number of rounds.

func NewCipher64

func NewCipher64(key []byte, r uint) (cipher.Block, error)

NewCipher64 creates and returns a new cipher.Block with 64 bits word size. The key argument should be the RC5 key, the r argument should be number of rounds.

Types

type KeySizeError added in v1.0.2033

type KeySizeError int

KeySizeError

func (KeySizeError) Error added in v1.0.2033

func (k KeySizeError) Error() string

Jump to

Keyboard shortcuts

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