/** * Decrypt data using AE (EtA) with SHA256-based HMAC. * * @param data * to decrypt * * @return decrypted data * * @throws EncryptionError * @throws AuthenticationFailed * if the authentication record does not match the data. */ public byte[] etaDecrypt(byte[] data) throws EncryptionError, AuthenticationFailed { try { return Do.read(etaDecryptStream(new ByteArrayInputStream(data))); } catch (AuthenticationFailed e) { throw e; } catch (IOException e) { throw new RuntimeException("unexpected IOError", e); } }