private byte[] aeadImpl(int cipherMode, byte[] key, byte[] nonce, byte[] aad, byte[] text) {
        try {
            var cipher  = Cipher.getInstance(AEAD_CIPHER_SPEC);
            var gcmSpec = new GCMParameterSpec(nT() * 8/* in bits */, nonce);
            var aesKey  = new SecretKeySpec(key, "AES");
            cipher.init(cipherMode, aesKey, gcmSpec);
            cipher.updateAAD(aad);
            return cipher.doFinal(text);
        } catch (NoSuchAlgorithmException | NoSuchPaddingException
                | InvalidKeyException | InvalidAlgorithmParameterException
                | IllegalBlockSizeException | BadPaddingException e) {
            throw new RuntimeException(e);
        }
    }
@param key Symmetric key bytes for encryption/decryption
@param nonce Nonce to use for the encryption/decrytion
@param aad Associated authenticated data that will <em>not</em> be encrypted
@param text Plaintext to seal or ciphertext to open, depending on cipherMode
@return resulting ciphertext or plaintext, depending on cipherMode
security-utils/src/main/java/com/yahoo/security/hpke/Aes128Gcm.java