/** * This interface specifies the Advanced Encryption Standard (AES) cipher. AES is documented in Federal Information Processing Standards Publication (FIPS PUB) 197. Implementations should include a constructor of the form *
* AES(byte[] z)
*
* that constructs an AES cipher using a specific 128-, 192- or 256-bit (i.e. 16-, 24- or 32-byte) secret key z.
* The constructor should throw {@link IllegalArgumentException} if the length of z is not 128, 192 or 256 bits (i.e. 16, 24 or 32 bytes); otherwise, it should generate the key schedule w expanded from z.
*
* @author Craig A. Rich
*/
interface AbstractAES {
// AES(byte[] z);
/**
* Encrypts a 128-bit (16-byte) plaintext block using this AES cipher
*
* @param x The 128-bit (16-byte) plaintext block to be encrypted.
* @return The 128-bit (16-byte) ciphertext block produced by encryption.
* @throws IllegalArgumentException if the plaintext block is not 128 bits (i.e. 16 bytes)
*/
public byte[] encrypt(byte[] x);
/**
* Decrypts a 128-bit (16-byte) ciphertext block using this AES cipher
*
* @param y The 128-bit (16-byte) ciphertext block to be decrypted.
* @return The 128-bit (16-byte) plaintext block produced by decryption.
* @throws IllegalArgumentException if the ciphertext block is not 128 bits (i.e. 16 bytes)
*/
public byte[] decrypt(byte[] y);
}