Package org.apache.sshd.common.cipher
Class ChaCha20Cipher.ChaChaEngine
- java.lang.Object
-
- org.apache.sshd.common.cipher.ChaCha20Cipher.ChaChaEngine
-
- Enclosing class:
- ChaCha20Cipher
protected static class ChaCha20Cipher.ChaChaEngine extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static intBLOCK_BYTESprivate static intBLOCK_INTSprivate static intCOUNTER_OFFSETprivate static int[]ENGINE_STATE_HEADERprotected int[]engineStateprotected longinitialNonceprivate static intKEY_BYTESprivate static intKEY_INTSprivate static intKEY_OFFSETprotected byte[]keyStreamprotected byte[]nonceprivate static intNONCE_OFFSETprotected longnonceVal
-
Constructor Summary
Constructors Modifier Constructor Description protectedChaChaEngine()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadvanceNonce()protected voidcrypt(byte[] in, int offset, int length, byte[] out, int outOffset)protected voidinitCounter(long counter)protected voidinitKey(byte[] key)protected voidinitNonce(byte[] nonce)protected byte[]polyKey()protected voidsetKeyStream(int[] engine)private static voidunpackIntsLE(byte[] buf, int off, int nrInts, int[] dst, int dstOff)private static int[]unpackSigmaString(byte[] buf)
-
-
-
Field Detail
-
BLOCK_BYTES
private static final int BLOCK_BYTES
- See Also:
- Constant Field Values
-
BLOCK_INTS
private static final int BLOCK_INTS
- See Also:
- Constant Field Values
-
KEY_OFFSET
private static final int KEY_OFFSET
- See Also:
- Constant Field Values
-
KEY_BYTES
private static final int KEY_BYTES
- See Also:
- Constant Field Values
-
KEY_INTS
private static final int KEY_INTS
- See Also:
- Constant Field Values
-
COUNTER_OFFSET
private static final int COUNTER_OFFSET
- See Also:
- Constant Field Values
-
NONCE_OFFSET
private static final int NONCE_OFFSET
- See Also:
- Constant Field Values
-
ENGINE_STATE_HEADER
private static final int[] ENGINE_STATE_HEADER
-
engineState
protected final int[] engineState
-
keyStream
protected final byte[] keyStream
-
nonce
protected final byte[] nonce
-
initialNonce
protected long initialNonce
-
nonceVal
protected long nonceVal
-
-
Method Detail
-
initKey
protected void initKey(byte[] key)
-
initNonce
protected void initNonce(byte[] nonce)
-
advanceNonce
protected void advanceNonce()
-
initCounter
protected void initCounter(long counter)
-
crypt
protected void crypt(byte[] in, int offset, int length, byte[] out, int outOffset)
-
polyKey
protected byte[] polyKey()
-
setKeyStream
protected void setKeyStream(int[] engine)
-
unpackIntsLE
private static void unpackIntsLE(byte[] buf, int off, int nrInts, int[] dst, int dstOff)
-
unpackSigmaString
private static int[] unpackSigmaString(byte[] buf)
-
-