public final class SymCipherMultithreadedCTR extends java.lang.Object implements ISymCipher
| Modifier and Type | Class and Description |
|---|---|
private class |
SymCipherMultithreadedCTR.EncryptionThread |
| Modifier and Type | Field and Description |
|---|---|
private javax.crypto.Cipher |
m_aesEngine1 |
private javax.crypto.Cipher |
m_aesEngine2 |
private byte[] |
m_aesKeys |
private byte[] |
m_arCounters1 |
private SymCipherMultithreadedCTR.EncryptionThread[] |
m_arEncryptionThreads |
private byte[] |
m_arOpads1 |
private boolean[] |
m_arRunningThread |
private int |
m_iOpadPerThread |
private int |
m_iRunningEncryptionThreads |
private byte[] |
m_iv1 |
private byte[] |
m_iv2 |
private int |
m_nrThreads |
private int |
m_OpadIndex |
private java.lang.Object |
m_oSyncEncryptionThreads |
private static int |
OPAD_LEN |
| Constructor and Description |
|---|
SymCipherMultithreadedCTR() |
| Modifier and Type | Method and Description |
|---|---|
private void |
decRunningEncryptionthreads() |
int |
encryptAES1(byte[] from,
int ifrom,
byte[] to,
int ito,
int len) |
int |
encryptAES2(byte[] buff) |
byte[] |
getKeys()
Returns the currently used key(s) for encryption.
|
private void |
incRunningEncryptionthreads() |
static void |
main(java.lang.String[] argv) |
int |
setEncryptionKeyAES(byte[] key)
Sets the AES encryption key to the value in the key buffer.
|
int |
setEncryptionKeyAES(byte[] key,
int offset,
int len) |
int |
setEncryptionKeysAES(byte[] keys)
Set both keys to different value, if keys.length==2* KEY_SIZe, else set
both keys to the same value
|
void |
setIV2(byte[] buff) |
private javax.crypto.Cipher m_aesEngine1
private javax.crypto.Cipher m_aesEngine2
private byte[] m_iv1
private byte[] m_iv2
private byte[] m_aesKeys
private static final int OPAD_LEN
private byte[] m_arCounters1
private byte[] m_arOpads1
private int m_nrThreads
private int m_iOpadPerThread
private SymCipherMultithreadedCTR.EncryptionThread[] m_arEncryptionThreads
private java.lang.Object m_oSyncEncryptionThreads
private int m_OpadIndex
private volatile boolean[] m_arRunningThread
private volatile int m_iRunningEncryptionThreads
private void incRunningEncryptionthreads()
private void decRunningEncryptionthreads()
public int setEncryptionKeyAES(byte[] key)
ISymCiphersetEncryptionKeyAES in interface ISymCipherpublic int setEncryptionKeyAES(byte[] key,
int offset,
int len)
setEncryptionKeyAES in interface ISymCipherkey - byte[]offset - intlen - int if len==16 --> only the key is set; if len==32 --> key and
IV is setpublic int setEncryptionKeysAES(byte[] keys)
setEncryptionKeysAES in interface ISymCipherkeys - byte[]public byte[] getKeys()
getKeys in interface ISymCipherpublic void setIV2(byte[] buff)
setIV2 in interface ISymCipherpublic int encryptAES1(byte[] from,
int ifrom,
byte[] to,
int ito,
int len)
encryptAES1 in interface ISymCipherpublic int encryptAES2(byte[] buff)
encryptAES2 in interface ISymCipherpublic static void main(java.lang.String[] argv)
Copyright © 2023. All rights reserved.