bytes

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(b []byte) []byte

Clone returns a copy of b[:len(b)]. The result may have additional unused capacity.

func FromString

func FromString(str string) []byte

string to bytes

func GfnDouble

func GfnDouble(input []byte) []byte

GfnDouble computes 2 * input in the field of 2^n elements. The irreducible polynomial in the finite field for n=128 is x^128 + x^7 + x^2 + x + 1 (equals 0x87) Constant-time execution in order to avoid side-channel attacks

func RightXOR

func RightXOR(X, Y []byte) []byte

RightXOR XORs smaller input (assumed Y) at the right of the larger input (assumed X)

func ShiftLeft

func ShiftLeft(x []byte) []byte

ShiftLeft outputs the byte array corresponding to x << 1 in binary.

func ShiftLeftN

func ShiftLeftN(dst, x []byte, n int)

ShiftLeftN puts in dst the byte array corresponding to x << n in binary.

func SplitSize

func SplitSize(buf []byte, size int) [][]byte

split bytes with n length

func ToString

func ToString(buf []byte) string

bytes to string

func XORBytes

func XORBytes(Z, X, Y []byte)

XORBytes assumes equal input length, puts X XOR Y into Z

func XORBytesMut

func XORBytesMut(X, Y []byte)

XORBytesMut assumes equal input length, replaces X with X XOR Y

Types

This section is empty.

Jump to

Keyboard shortcuts

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