Package net.i2p.crypto
Class ChaCha20
java.lang.Object
net.i2p.crypto.ChaCha20
ChaCha20, wrapper around Noise ChaChaCore.
RFC 7539
- Since:
- 0.9.39
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddecrypt(byte[] key, byte[] iv, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) Encrypt from ciphertext to plaintextstatic voiddecrypt(byte[] key, byte[] iv, int ivOffset, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) Encrypt from ciphertext to plaintextstatic voidencrypt(byte[] key, byte[] iv, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) Encrypt from plaintext to ciphertextstatic voidencrypt(byte[] key, byte[] iv, int ivOffset, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) Encrypt from plaintext to ciphertext
-
Method Details
-
encrypt
public static void encrypt(byte[] key, byte[] iv, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) Encrypt from plaintext to ciphertext- Parameters:
key- first 32 bytes used as the keyiv- first 12 bytes used as the iv
-
encrypt
public static void encrypt(byte[] key, byte[] iv, int ivOffset, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) Encrypt from plaintext to ciphertext- Parameters:
key- first 32 bytes used as the keyiv- first 12 bytes starting at ivOffset used as the iv- Since:
- 0.9.54
-
decrypt
public static void decrypt(byte[] key, byte[] iv, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) Encrypt from ciphertext to plaintext- Parameters:
key- first 32 bytes used as the keyiv- first 12 bytes used as the iv
-
decrypt
public static void decrypt(byte[] key, byte[] iv, int ivOffset, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) Encrypt from ciphertext to plaintext- Parameters:
key- first 32 bytes used as the keyiv- first 12 bytes starting at ivOffset used as the iv- Since:
- 0.9.54
-