Package org.apache.sshd.common.cipher
Class ChaCha20Cipher.ChaChaEngine
java.lang.Object
org.apache.sshd.common.cipher.ChaCha20Cipher.ChaChaEngine
- Enclosing class:
- ChaCha20Cipher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int[]
protected final int[]
protected long
private static final int
private static final int
private static final int
protected final byte[]
private static final int
private static final int
private static final int
protected final int[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected static void
columnRound
(int[] state) protected void
crypt
(byte[] in, int offset, int length, byte[] out, int outOffset) protected static void
diagonalRound
(int[] state) protected void
initCounter
(long counter) protected void
initKey
(byte[] key) protected void
initNonce
(byte[] nonce) private static void
packIntLE
(int value, byte[] dst, int off, int len) protected static void
permute
(int[] state) protected byte[]
polyKey()
protected static void
quarterRound
(int[] state, int a, int b, int c, int d) private static int
unpackIntLE
(byte[] buf, int off) private static int
unpackIntLE
(byte[] buf, int off, int len) private static void
unpackIntsLE
(byte[] buf, int off, int nrInts, int[] dst, int dstOff) private static int[]
unpackSigmaString
(byte[] buf)
-
Field Details
-
BLOCK_BYTES
private static final int BLOCK_BYTES- See Also:
-
BLOCK_INTS
private static final int BLOCK_INTS- See Also:
-
KEY_OFFSET
private static final int KEY_OFFSET- See Also:
-
KEY_BYTES
private static final int KEY_BYTES- See Also:
-
KEY_INTS
private static final int KEY_INTS- See Also:
-
COUNTER_OFFSET
private static final int COUNTER_OFFSET- See Also:
-
NONCE_OFFSET
private static final int NONCE_OFFSET- See Also:
-
NONCE_BYTES
private static final int NONCE_BYTES- See Also:
-
NONCE_INTS
private static final int NONCE_INTS- See Also:
-
ENGINE_STATE_HEADER
private static final int[] ENGINE_STATE_HEADER -
x
protected final int[] x -
engineState
protected final int[] engineState -
nonce
protected final byte[] nonce -
initialNonce
protected long initialNonce
-
-
Constructor Details
-
ChaChaEngine
protected ChaChaEngine()
-
-
Method Details
-
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() -
permute
protected static void permute(int[] state) -
columnRound
protected static void columnRound(int[] state) -
diagonalRound
protected static void diagonalRound(int[] state) -
quarterRound
protected static void quarterRound(int[] state, int a, int b, int c, int d) -
unpackIntLE
private static int unpackIntLE(byte[] buf, int off) -
unpackIntLE
private static int unpackIntLE(byte[] buf, int off, int len) -
unpackIntsLE
private static void unpackIntsLE(byte[] buf, int off, int nrInts, int[] dst, int dstOff) -
unpackSigmaString
private static int[] unpackSigmaString(byte[] buf) -
packIntLE
private static void packIntLE(int value, byte[] dst, int off, int len)
-