Documentation ¶
Index ¶
- Constants
- Variables
- func ADD31(a *uint32, b uint32)
- func BitReconstruction2(X1, X2 *uint32, LFSR []uint32)
- func BitReconstruction3(X0, X1, X2 *uint32, LFSR []uint32)
- func BitReconstruction4(X0, X1, X2, X3 *uint32, LFSR []uint32)
- func EEA_ENCRYPT_NBYTES(nbits int) int
- func EEA_ENCRYPT_NWORDS(nbits int) int
- func EeaEncrypt(in []uint32, out []uint32, nbits int, key []byte, count uint32, bearer uint32, ...)
- func EiaGenerateMac(data []uint32, nbits int, key [16]byte, count uint32, bearer uint32, ...) uint32
- func F(R1, R2 *uint32, X0, X1, X2 uint32) uint32
- func F_(R1, R2 *uint32, X1, X2 uint32)
- func GETU32(ptr []byte) uint32
- func L1(X uint32) uint32
- func L2(X uint32) uint32
- func LFSRWithInitialisationMode(u uint32, LFSR []uint32)
- func LFSRWithWorkMode(LFSR []uint32)
- func MAKEU31(k uint8, d uint32, iv uint8) uint32
- func MAKEU32(a, b, c, d uint8) uint32
- func MemsetByte(a []byte, v byte)
- func New256Cipher(key []byte, iv []byte) (cipher.Stream, error)
- func New256CipherWithMacbits(key []byte, iv []byte, macbits int32) (cipher.Stream, error)
- func NewCipher(key []byte, iv []byte) (cipher.Stream, error)
- func NewEEACipher(key []byte, count, bearer, direction uint32) (cipher.Stream, error)
- func PUTU32(ptr []byte, a uint32)
- func ROT31(a, k uint32) uint32
- func ROT32(a, k uint32) uint32
- func SetEiaIV(iv []byte, count uint32, bearer uint32, direction uint32)
- func ZUC256_MAKEU31(a, b, c, d byte) uint32
- type IVSizeError
- type KeySizeError
- type Zuc
- type Zuc256Mac
- type Zuc256State
- type ZucMac
- type ZucState
Constants ¶
View Source
const IV_SIZE = 16
View Source
const KEY_SIZE = 16
View Source
const MAC_SIZE = 4
View Source
const ZUC256_IV_SIZE = 23
View Source
const ZUC256_KEY_SIZE = 32
View Source
const ZUC256_MAC128_SIZE = 16
View Source
const ZUC256_MAC32_SIZE = 4
View Source
const ZUC256_MAC64_SIZE = 8
View Source
const ZUC256_MAX_MAC_SIZE = ZUC256_MAC128_SIZE
View Source
const ZUC256_MIN_MAC_SIZE = ZUC256_MAC32_SIZE
View Source
const ZUC_BLOCK_SIZE = 4
Variables ¶
View Source
var KD = [16]uint32{
0x44D7, 0x26BC, 0x626B, 0x135E, 0x5789, 0x35E2, 0x7135, 0x09AF,
0x4D78, 0x2F13, 0x6BC4, 0x1AF1, 0x5E26, 0x3C4D, 0x789A, 0x47AC,
}
View Source
var S0 = [256]uint8{}/* 256 elements not displayed */
View Source
var S1 = [256]uint8{}/* 256 elements not displayed */
View Source
var ZUC256_D = [][]uint8{
{
0x22, 0x2F, 0x24, 0x2A, 0x6D, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x52, 0x10, 0x30,
},
{
0x22, 0x2F, 0x25, 0x2A, 0x6D, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x52, 0x10, 0x30,
},
{
0x23, 0x2F, 0x24, 0x2A, 0x6D, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x52, 0x10, 0x30,
},
{
0x23, 0x2F, 0x25, 0x2A, 0x6D, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x52, 0x10, 0x30,
},
}
Functions ¶
func BitReconstruction2 ¶
func BitReconstruction3 ¶
func BitReconstruction4 ¶
func EEA_ENCRYPT_NBYTES ¶
func EEA_ENCRYPT_NWORDS ¶
func EeaEncrypt ¶
func EiaGenerateMac ¶
func LFSRWithWorkMode ¶
func LFSRWithWorkMode(LFSR []uint32)
func MemsetByte ¶
func New256Cipher ¶
New256Cipher creates and returns a new cipher.Stream.
func New256CipherWithMacbits ¶
New256CipherWithMacbits creates and returns a new cipher.Stream.
func NewEEACipher ¶
NewEEACipher creates and returns a new cipher.Stream.
func ZUC256_MAKEU31 ¶
Types ¶
type IVSizeError ¶
type IVSizeError int
func (IVSizeError) Error ¶
func (k IVSizeError) Error() string
type KeySizeError ¶
type KeySizeError int
func (KeySizeError) Error ¶
func (k KeySizeError) Error() string
type Zuc ¶
type Zuc struct {
// contains filtered or unexported fields
}
func NewZucDecrypt ¶
func NewZucEncrypt ¶
type Zuc256Mac ¶
type Zuc256State ¶
func NewZuc256State ¶
func NewZuc256State(key []byte, iv []byte) *Zuc256State
func NewZuc256StateWithMacbits ¶
func NewZuc256StateWithMacbits(key []byte, iv []byte, macbits int32) *Zuc256State
func (*Zuc256State) Encrypt ¶
func (this *Zuc256State) Encrypt(out []byte, in []byte)
func (*Zuc256State) GenerateKeystream ¶
func (this *Zuc256State) GenerateKeystream(nwords int, keystream []uint32)
func (*Zuc256State) GenerateKeyword ¶
func (this *Zuc256State) GenerateKeyword() uint32
type ZucMac ¶
type ZucState ¶
func NewZucState ¶
func (*ZucState) GenerateKeystream ¶
func (*ZucState) GenerateKeyword ¶
Click to show internal directories.
Click to hide internal directories.