anchor.diff:  %%%-------- helpers
   crypto_stream_emulate({Cipher,{Ref0,flg_undefined}}, Data, EncryptFlag) when is_reference(Ref0) ->
       ?COMPAT(begin
  -                Ref = crypto_init(Ref0, EncryptFlag),
  +                Ref = ng_crypto_init_nif(Ref0, <<>>, <<>>, EncryptFlag),
                   {{Cipher,Ref}, crypto_update(Ref, Data)}
               end);
   
  
positive.code:                                                             EncryptFlag :: boolean(),
                                                              State :: crypto_state() .
  crypto_init(Cipher, Key, undefined, EncryptFlag) ->
      crypto_init(Cipher, Key, <<>>, EncryptFlag);
  
  crypto_init(Cipher, Key, IV, EncryptFlag) ->
      ng_crypto_init_nif(alias(Cipher),
                         iolist_to_binary(Key), iolist_to_binary(IV),
                         EncryptFlag).
  
  
  -spec crypto_init(Cipher, Key, IV) -> State | ng_crypto_error()
                                            when Cipher :: stream_cipher()
                                                         | block_cipher_with_iv()
                                                         | block_cipher_without_iv(),
                                                 Key :: iodata(),
                                                 IV :: iodata() | undefined,
                                                 State :: crypto_state() .
  crypto_init(Cipher, Key, undefined) ->
      ng_crypto_init_nif(alias(Cipher),
                         iolist_to_binary(Key), <<>>,
                         undefined);
  
  crypto_init(Cipher, Key, IV) ->
      ng_crypto_init_nif(alias(Cipher),
                         iolist_to_binary(Key), iolist_to_binary(IV),
                         undefined).
  
  
  -spec crypto_init(Ref, EncryptFlag) -> crypto_state() | ng_crypto_error()
                                             when Ref :: crypto_state(),
                                                  EncryptFlag :: boolean() .
  
  crypto_init(Ref, EncryptFlag) when is_reference(Ref),
                                     is_atom(EncryptFlag) ->
      ng_crypto_init_nif(Ref, <<>>, <<>>, EncryptFlag).
  
  %%%----------------------------------------------------------------
  %%%
  
negative.code:                                                IVec ::binary(),
                                                 State :: stream_state() .
  stream_init(Type, Key, IVec) when is_binary(IVec) -> 
      Ref = ?COMPAT(ng_crypto_init_nif(alias(Type),
                                       iolist_to_binary(Key), iolist_to_binary(IVec),
                                       undefined)
                   ),
      {Type, {Ref,flg_undefined}}.
  
  
  