Package org.bouncycastle.crypto.engines
Class Zuc256CoreEngine
java.lang.Object
org.bouncycastle.crypto.engines.Zuc128CoreEngine
org.bouncycastle.crypto.engines.Zuc256CoreEngine
- All Implemented Interfaces:
StreamCipher
,Memoable
- Direct Known Subclasses:
Zuc256Engine
Zuc256 implementation.
Based on https://www.is.cas.cn/ztzl2016/zouchongzhi/201801/W020180126529970733243.pdf
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor for streamCipher.protected
Zuc256CoreEngine
(int pLength) Constructor for Mac.protected
Zuc256CoreEngine
(Zuc256CoreEngine pSource) Constructor for Memoable. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of the engine.Obtain Algorithm Name.protected int
Obtain Max iterations.void
Reset from saved engine state.protected void
setKeyAndIV
(int[] pLFSR, byte[] k, byte[] iv) Process key and IV into LFSR.Methods inherited from class org.bouncycastle.crypto.engines.Zuc128CoreEngine
encode32be, init, makeKeyStreamWord, processBytes, reset, returnByte
-
Constructor Details
-
Zuc256CoreEngine
protected Zuc256CoreEngine()Constructor for streamCipher. -
Zuc256CoreEngine
protected Zuc256CoreEngine(int pLength) Constructor for Mac.- Parameters:
pLength
- the Mac length
-
Zuc256CoreEngine
Constructor for Memoable.- Parameters:
pSource
- the source engine
-
-
Method Details
-
getMaxIterations
protected int getMaxIterations()Obtain Max iterations.- Overrides:
getMaxIterations
in classZuc128CoreEngine
- Returns:
- the maximum iterations
-
getAlgorithmName
Obtain Algorithm Name.- Specified by:
getAlgorithmName
in interfaceStreamCipher
- Overrides:
getAlgorithmName
in classZuc128CoreEngine
- Returns:
- the name
-
setKeyAndIV
protected void setKeyAndIV(int[] pLFSR, byte[] k, byte[] iv) Process key and IV into LFSR.- Overrides:
setKeyAndIV
in classZuc128CoreEngine
- Parameters:
pLFSR
- the LFSRk
- the keyiv
- the iv
-
copy
Create a copy of the engine.- Specified by:
copy
in interfaceMemoable
- Overrides:
copy
in classZuc128CoreEngine
- Returns:
- the copy
-
reset
Reset from saved engine state.- Specified by:
reset
in interfaceMemoable
- Overrides:
reset
in classZuc128CoreEngine
- Parameters:
pState
- the state to restore
-