anchor.diff:  %%%================================================================
   
   -define(COMPAT(CALL),
  -        try CALL
  +        try begin CALL end
           catch
  +            error:{error,_} ->
  +                error(badarg);
               error:{E,_Reason} when E==notsup ; E==badarg ->
                   error(E)
           end).
  
positive.code: alias(aes_cbc256)   -> aes_256_cbc;
  
  alias(Alg) -> Alg.
  
  %%%================================================================
  %%%
  
negative.code:                            {binary(), binary()} | run_time_error().
  
  
  block_encrypt(aes_ige256, Key, Ivec, PlainText) ->
      notsup_to_error(aes_ige_crypt_nif(Key, Ivec, PlainText, true));
  
  block_encrypt(Type, Key0, Ivec, Data) ->
      Key = iolist_to_binary(Key0),
      ?COMPAT(
         case Data of
             {AAD, PlainText} ->
                 aead_encrypt(alias(Type,Key), Key, Ivec, AAD, PlainText, aead_tag_len(Type));
             {AAD, PlainText, TagLength} ->
                 aead_encrypt(alias(Type,Key), Key, Ivec, AAD, PlainText, TagLength);
             PlainText ->
                 crypto_one_shot(alias(Type,Key), Key, Ivec, PlainText, true)
         end).
  
  -spec block_encrypt(Type::block_cipher_no_iv(), Key::key(), PlainText::iodata()) ->
                             binary() | run_time_error().
  
  block_encrypt(Type, Key0, PlainText) ->
      Key = iolist_to_binary(Key0),
      ?COMPAT(crypto_one_shot(alias(Type,Key), Key, <<>>, PlainText, true)).
  
  
  aead_tag_len(chacha20_poly1305) -> 16;
  aead_tag_len(aes_ccm) -> 12;
  aead_tag_len(aes_128_ccm) -> 12;
  aead_tag_len(aes_192_ccm) -> 12;
  aead_tag_len(aes_256_ccm) -> 12;
  aead_tag_len(aes_gcm) -> 16;
  aead_tag_len(aes_128_gcm) -> 16;
  aead_tag_len(aes_192_gcm) -> 16;
  aead_tag_len(aes_256_gcm) -> 16.
  
  %%%----------------------------------------------------------------
  %%%----------------------------------------------------------------
  