public final class ChaCha20 extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
decrypt(byte[] key,
byte[] iv,
byte[] ciphertext,
int ciphertextOffset,
byte[] plaintext,
int plaintextOffset,
int length)
Encrypt from ciphertext to plaintext
|
static void |
decrypt(byte[] key,
byte[] iv,
int ivOffset,
byte[] ciphertext,
int ciphertextOffset,
byte[] plaintext,
int plaintextOffset,
int length)
Encrypt from ciphertext to plaintext
|
static void |
encrypt(byte[] key,
byte[] iv,
byte[] plaintext,
int plaintextOffset,
byte[] ciphertext,
int ciphertextOffset,
int length)
Encrypt from plaintext to ciphertext
|
static void |
encrypt(byte[] key,
byte[] iv,
int ivOffset,
byte[] plaintext,
int plaintextOffset,
byte[] ciphertext,
int ciphertextOffset,
int length)
Encrypt from plaintext to ciphertext
|
public static void decrypt(byte[] key,
byte[] iv,
byte[] ciphertext,
int ciphertextOffset,
byte[] plaintext,
int plaintextOffset,
int length)
key - first 32 bytes used as the keyiv - first 12 bytes used as the ivciphertext - the ciphertext to decryptciphertextOffset - offset in ciphertextplaintext - the plaintext output bufferplaintextOffset - offset in plaintextlength - the length to decryptpublic static void decrypt(byte[] key,
byte[] iv,
int ivOffset,
byte[] ciphertext,
int ciphertextOffset,
byte[] plaintext,
int plaintextOffset,
int length)
key - first 32 bytes used as the keyiv - first 12 bytes starting at ivOffset used as the ivciphertext - the ciphertext to decryptciphertextOffset - offset in ciphertextplaintext - the plaintext output bufferplaintextOffset - offset in plaintextlength - the length to decryptpublic static void encrypt(byte[] key,
byte[] iv,
byte[] plaintext,
int plaintextOffset,
byte[] ciphertext,
int ciphertextOffset,
int length)
key - first 32 bytes used as the keyiv - first 12 bytes used as the ivplaintext - the plaintext to encryptplaintextOffset - offset in plaintextciphertext - the ciphertext output bufferciphertextOffset - offset in ciphertextlength - the length to encryptpublic static void encrypt(byte[] key,
byte[] iv,
int ivOffset,
byte[] plaintext,
int plaintextOffset,
byte[] ciphertext,
int ciphertextOffset,
int length)
key - first 32 bytes used as the keyiv - first 12 bytes starting at ivOffset used as the iv