mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
25 lines
785 B
Java
25 lines
785 B
Java
package org.briarproject.api.crypto;
|
|
|
|
import java.security.GeneralSecurityException;
|
|
|
|
/** An authenticated cipher that support additional authenticated data. */
|
|
public interface AuthenticatedCipher {
|
|
|
|
/**
|
|
* Initializes this cipher with a key, an initialisation vector (IV) and
|
|
* additional authenticated data (AAD).
|
|
*/
|
|
void init(boolean encrypt, SecretKey key, byte[] iv, byte[] aad)
|
|
throws GeneralSecurityException;
|
|
|
|
/** Encrypts or decrypts data in a single-part operation. */
|
|
int doFinal(byte[] input, int inputOff, int len, byte[] output,
|
|
int outputOff) throws GeneralSecurityException;
|
|
|
|
/** Returns the length of the message authenticated code (MAC) in bytes. */
|
|
int getMacLength();
|
|
|
|
/** Returns the block size of the cipher in bytes. */
|
|
int getBlockSize();
|
|
}
|