   // Instance to perform enc/dec.
   //OpenTRV::AESGCM::AES128GCM16small eo;
   // Do encryption.
-  OTAESGCM::OTAES128GCMGeneric<> gen;
-  gen.gcmEncrypt(key, nonce, input, sizeof(input),
+  OTAESGCM::OTAES128GCMGenericWithWorkspace<> gen(workspace, sizeof(workspace));
+  gen.gcmEncryptPadded(key, nonce, input, sizeof(input),
               aad, sizeof(aad), cipherText, tag);
   // Decrypt...
   uint8_t plain[sizeof(cipherText)]; // Space for decrypted text.

  // Instance to perform enc/dec.
  //OpenTRV::AESGCM::AES128GCM16small eo;
  // Do encryption.
  OTAESGCM::OTAES128GCMGeneric<> gen;
  AssertIsTrue(!gen.gcmEncrypt(NULL, nonce, NULL, 0,
                      ADATA, sizeof(ADATA), NULL, tag));
  }


  // Instance to perform enc/dec.
  //OpenTRV::AESGCM::AES128GCM16small eo;
  // Do encryption.
  OTAESGCM::OTAES128GCMGenericWithWorkspace<> gen(workspace, sizeof(workspace));
  AssertIsTrue(gen.gcmEncryptPadded(key, nonce, plainText, sizeof(plainText),
                      NULL, 0, cipherText, tag));
  // Decrypt...
  uint8_t tempTag[GCM_TAG_LENGTH];
