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 lengthpublic 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 ivivOffset - offset into iv arrayciphertext - the ciphertext to decryptciphertextOffset - offset in ciphertextplaintext - the plaintext output bufferplaintextOffset - offset in plaintextlength - the lengthpublic 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 lengthpublic 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 ivivOffset - offset into iv arrayplaintext - the plaintext input bufferplaintextOffset - offset into plaintext bufferciphertext - the ciphertext output bufferciphertextOffset - offset into ciphertext bufferlength - the number of bytes to encrypt