belt

package
v1.0.4016 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// hash size
	Size = 32

	// block size
	BlockSize = 32
)
View Source
const BELT_BLOCK_LEN = 16 /* The BELT encryption block length */
View Source
const BELT_HASH_BLOCK_SIZE = 32
View Source
const BELT_HASH_DIGEST_SIZE = 32
View Source
const BELT_HASH_DIGEST_SIZE_BITS = 256
View Source
const BELT_KEY_SCHED_LEN = 32 /* The BELT key schedul length */

Variables

View Source
var KIdx = [8][7]uint32{
	{0, 1, 2, 3, 4, 5, 6},
	{7, 0, 1, 2, 3, 4, 5},
	{6, 7, 0, 1, 2, 3, 4},
	{5, 6, 7, 0, 1, 2, 3},
	{4, 5, 6, 7, 0, 1, 2},
	{3, 4, 5, 6, 7, 0, 1},
	{2, 3, 4, 5, 6, 7, 0},
	{1, 2, 3, 4, 5, 6, 7},
}
View Source
var S = [256]byte{}/* 256 elements not displayed */

Functions

func BeltEncrypt

func BeltEncrypt(in [BELT_BLOCK_LEN]byte, out *[BELT_BLOCK_LEN]byte, ks [BELT_KEY_SCHED_LEN]byte)

func G

func G(x uint32, r int) uint32

func GET_BYTE

func GET_BYTE(x uint32, a int) byte

func New

func New() hash.Hash

New returns a new hash.Hash computing the BELT checksum

func PUT_BYTE

func PUT_BYTE(x byte, a int) uint32

func ROTL_BELT

func ROTL_BELT(x uint32, n int) uint32

func SB

func SB(x uint32, a int) uint32

func Sum

func Sum(data []byte) (sum [Size]byte)

Sum returns the BELT checksum of the data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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