mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Expand JavaDocs for AuthenticatedCipher
This commit is contained in:
@@ -1,19 +1,41 @@
|
|||||||
package org.briarproject.crypto;
|
package org.briarproject.crypto;
|
||||||
|
|
||||||
import java.security.GeneralSecurityException;
|
|
||||||
|
|
||||||
import org.briarproject.api.crypto.SecretKey;
|
import org.briarproject.api.crypto.SecretKey;
|
||||||
|
|
||||||
|
import java.security.GeneralSecurityException;
|
||||||
|
|
||||||
interface AuthenticatedCipher {
|
interface AuthenticatedCipher {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes this cipher for encryption or decryption with a key and an
|
* Initializes this cipher for encryption or decryption with a key and an
|
||||||
* initialisation vector (IV).
|
* initialisation vector (IV).
|
||||||
|
*
|
||||||
|
* @param encrypt whether we are encrypting or decrypting.
|
||||||
|
* @param key the key material to use.
|
||||||
|
* @param iv the IV.
|
||||||
|
* @throws GeneralSecurityException on invalid input.
|
||||||
*/
|
*/
|
||||||
void init(boolean encrypt, SecretKey key, byte[] iv)
|
void init(boolean encrypt, SecretKey key, byte[] iv)
|
||||||
throws GeneralSecurityException;
|
throws GeneralSecurityException;
|
||||||
|
|
||||||
/** Encrypts or decrypts data in a single-part operation. */
|
/**
|
||||||
|
* Encrypts or decrypts data in a single-part operation.
|
||||||
|
*
|
||||||
|
* @param input the input byte array. If encrypting, the plaintext to be
|
||||||
|
* encrypted. If decrypting, the ciphertext to be decrypted
|
||||||
|
* including the MAC.
|
||||||
|
* @param inputOff the offset into the input array where the data to be
|
||||||
|
* processed starts.
|
||||||
|
* @param len the number of bytes to be processed. If decrypting, includes
|
||||||
|
* the MAC length.
|
||||||
|
* @param output the output buffer the processed bytes go into. If
|
||||||
|
* encrypting, the ciphertext including the MAC. If
|
||||||
|
* decrypting, the plaintext.
|
||||||
|
* @param outputOff the offset into the output byte array the processed
|
||||||
|
* data starts at.
|
||||||
|
* @return the number of bytes processed.
|
||||||
|
* @throws GeneralSecurityException on invalid input.
|
||||||
|
*/
|
||||||
int process(byte[] input, int inputOff, int len, byte[] output,
|
int process(byte[] input, int inputOff, int len, byte[] output,
|
||||||
int outputOff) throws GeneralSecurityException;
|
int outputOff) throws GeneralSecurityException;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user