zuc

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: ISC Imports: 0 Imported by: 1

README

zuc

ISC License GoDoc Go Report Card GitHub go.mod Go version GitHub release (latest by date)

GM/T 0001-2012 Zu Chongzhi stream cipher

Confidentiality algorithm 128-EEA3 and the 3GPP integrity algorithm 128-EIA3.

ZUC is a stream cipher that forms the basis of the 128-EEA3 and 128-EIA3 cryptographic algorithms utilised within LTE networks. The 128-EEA3 is the 128 bit encryption algorithm defined using ZUC and the 128-EIA3 is the EPS Integrity Algorithm designed as a Universal Hash Function using ZUC at its core. Following agreements in 2009 for a requirement for a third LTE encryption and integrity algorithm set, 128-EEA and 128-EIA were designed in China. The algorithm set is based on a core stream cipher algorithm named ZUC, after Zu Chongzhi, a famous Chinese scientist.

License

This project is licensed under the ISC License.

Documentation

Index

Constants

View Source
const (
	KEY_UPLINK   = KeyDirection(0)
	KEY_DOWNLINK = KeyDirection(1)
)

Variables

View Source
var (
	S0 = [256]uint8{}/* 256 elements not displayed */

	S1 = [256]uint8{}/* 256 elements not displayed */

)

S-boxes

View Source
var (
	D = []uint16{
		0x44D7, 0x26BC, 0x626B, 0x135E, 0x5789, 0x35E2, 0x7135, 0x09AF,
		0x4D78, 0x2F13, 0x6BC4, 0x1AF1, 0x5E26, 0x3C4D, 0x789A, 0x47AC,
	}
)

D

Functions

This section is empty.

Types

type BRC

type BRC struct {
	X0 uint32
	X1 uint32
	X2 uint32
	X3 uint32
}

type F

type F struct {
	R1 uint32
	R2 uint32
}

type KeyDirection

type KeyDirection uint32

type LFSR

type LFSR struct {
	S0  uint32
	S1  uint32
	S2  uint32
	S3  uint32
	S4  uint32
	S5  uint32
	S6  uint32
	S7  uint32
	S8  uint32
	S9  uint32
	S10 uint32
	S11 uint32
	S12 uint32
	S13 uint32
	S14 uint32
	S15 uint32
}

func (*LFSR) WithInitialisationMode

func (lfsr *LFSR) WithInitialisationMode(u uint32)

func (*LFSR) WithWorkMode

func (lfsr *LFSR) WithWorkMode()

type ZUC

type ZUC struct {
	// contains filtered or unexported fields
}

func NewZUC

func NewZUC(k []uint8, iv []uint8) *ZUC

func (*ZUC) GenerateKeystream

func (z *ZUC) GenerateKeystream(length uint32) []uint32

func (*ZUC) Initialization

func (z *ZUC) Initialization(k []uint8, iv []uint8)

func (*ZUC) NextKey

func (z *ZUC) NextKey() uint32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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