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 |
encrypt(byte[] key,
byte[] iv,
byte[] plaintext,
int plaintextOffset,
byte[] ciphertext,
int ciphertextOffset,
int length)
Encrypt from plaintext to ciphertext
|
public 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 ivpublic 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 iv