common

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: AGPL-3.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package common contains common implementation details of other packages, and should not be used directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Msb

func Msb(buf []byte) uint8

Msb returns the most significant bit of the supplied data (which must be non-empty). This is the MSB(L) function of RFC 4493.

func PadBlock

func PadBlock(block []byte) []byte

PadBlock pads a string of bytes less than 16 bytes long to a full block size by appending a one bit followed by zero bits. This is the padding function used in RFCs 4493 and 5297.

func ShiftLeft

func ShiftLeft(b []byte) []byte

ShiftLeft shifts the binary string left by one bit, causing the most-signficant bit to disappear and a zero to be introduced at the right. This corresponds to the `x << 1` notation of RFC 4493.

func Xor

func Xor(dst []byte, a []byte, b []byte)

Xor computes `a XOR b`, as defined by RFC 4493. dst, a, and b must all have the same length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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