Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.macs

public final Class Zuc128Mac

extends Object
implements Mac
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.Mac
Imports
org.bouncycastle.crypto.CipherParameters, .Mac, org.bouncycastle.crypto.engines.Zuc128CoreEngine

Zuc128 Mac implementation. Based on https://www.qtc.jp/3GPP/Specs/eea3eia3specificationv16.pdf

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
theByteIndex

The current byte index.

private final Zuc128Mac.InternalZuc128Engine
theEngine

The Zuc128 Engine.

private final int[]
theKeyStream

The active keyStream.

private int
theMac

The calculated Mac in words.

private Zuc128CoreEngine
theState

The initialised state.

private int
theWordIndex

The current word index.

private static final int
TOPBIT

The Maximum Bit Mask.

Constructor Summary

AccessConstructor and Description
public
Zuc128Mac()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the size of the mac
doFinal
(final byte[]
the output buffer
out
,
final int
the starting offset in the input buffer
outOff
)

Implements org.bouncycastle.crypto.Mac.doFinal.

Finalize the mac.

public String

Returns:

the name
getAlgorithmName
()

Implements org.bouncycastle.crypto.Mac.getAlgorithmName.

Obtain Algorithm Name.

private int

Returns:

the final word
getFinalWord
()

Obtain the final word.

private int

Returns:

the word
getKeyStreamWord
(final int
the bitNumber
bitNo
)

Obtain the keyStreamWord.

public int

Returns:

the size in Bytes
getMacSize
()

Implements org.bouncycastle.crypto.Mac.getMacSize.

Obtain Mac Size.

public void
init(final CipherParameters
the parameters
pParams
)

Implements org.bouncycastle.crypto.Mac.init.

Initialise the Mac.

private void
initKeyStream()

Initialise the keyStream.

public void
reset()

Implements org.bouncycastle.crypto.Mac.reset.

Reset the MAC.

private void
shift4NextByte()

Shift for next byte.

public void
update(final byte
the byte to update with
in
)

Implements org.bouncycastle.crypto.Mac.update.

Update the mac with a single byte.

public void
update(final byte[]
the input buffer
in
,
final int
the starting offset in the input buffer
inOff
,
final int
the length of data to process
len
)

Implements org.bouncycastle.crypto.Mac.update.

Update the mac.

private void
updateMac(final int
the bit number
bitNo
)

Update the Mac.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

theByteIndexback to summary
private int theByteIndex

The current byte index.

theEngineback to summary
private final Zuc128Mac.InternalZuc128Engine theEngine

The Zuc128 Engine.

theKeyStreamback to summary
private final int[] theKeyStream

The active keyStream.

theMacback to summary
private int theMac

The calculated Mac in words.

theStateback to summary
private Zuc128CoreEngine theState

The initialised state.

theWordIndexback to summary
private int theWordIndex

The current word index.

TOPBITback to summary
private static final int TOPBIT

The Maximum Bit Mask.

Constructor Detail

Zuc128Macback to summary
public Zuc128Mac()

Constructor.

Method Detail

doFinalback to summary
public int doFinal(final byte[] out, final int outOff)

Implements org.bouncycastle.crypto.Mac.doFinal.

Finalize the mac.

Parameters
out:byte[]

the output buffer

outOff:int

the starting offset in the input buffer

Returns:int

the size of the mac

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Mac.getAlgorithmName.

Obtain Algorithm Name.

Returns:String

the name

getFinalWordback to summary
private int getFinalWord()

Obtain the final word.

Returns:int

the final word

getKeyStreamWordback to summary
private int getKeyStreamWord(final int bitNo)

Obtain the keyStreamWord.

Parameters
bitNo:int

the bitNumber

Returns:int

the word

getMacSizeback to summary
public int getMacSize()

Implements org.bouncycastle.crypto.Mac.getMacSize.

Obtain Mac Size.

Returns:int

the size in Bytes

initback to summary
public void init(final CipherParameters pParams)

Implements org.bouncycastle.crypto.Mac.init.

Initialise the Mac.

Parameters
pParams:CipherParameters

the parameters

initKeyStreamback to summary
private void initKeyStream()

Initialise the keyStream.

resetback to summary
public void reset()

Implements org.bouncycastle.crypto.Mac.reset.

Doc from org.bouncycastle.crypto.Mac.reset.

Reset the MAC. At the end of resetting the MAC should be in the in the same state it was after the last init (if there was one).

shift4NextByteback to summary
private void shift4NextByte()

Shift for next byte.

updateback to summary
public void update(final byte in)

Implements org.bouncycastle.crypto.Mac.update.

Update the mac with a single byte.

Parameters
in:byte

the byte to update with

updateback to summary
public void update(final byte[] in, final int inOff, final int len)

Implements org.bouncycastle.crypto.Mac.update.

Update the mac.

Parameters
in:byte[]

the input buffer

inOff:int

the starting offset in the input buffer

len:int

the length of data to process

updateMacback to summary
private void updateMac(final int bitNo)

Update the Mac.

Parameters
bitNo:int

the bit number

org.bouncycastle.crypto.macs back to summary

private Class Zuc128Mac.InternalZuc128Engine

extends Zuc128CoreEngine
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
Inherited from org.bouncycastle.crypto.engines.Zuc128CoreEngine:
copyencode32begetAlgorithmNamegetMaxIterationsinitmakeKeyStreamWordprocessBytesresetresetreturnBytesetKeyAndIV

Constructor Detail

InternalZuc128Engineback to summary
private InternalZuc128Engine()

Method Detail

createKeyStreamWordback to summary
pack-priv int createKeyStreamWord()