ntrepid8 / ex_crypto

Wrapper around the Erlang crypto module for Elixir.
MIT License
150 stars 48 forks source link

Functions such as :crypto.block_encrypt will be deprecated #35

Closed x-ji closed 3 years ago

x-ji commented 5 years ago

In http://erlang.org/doc/apps/crypto/new_api.html it is recommended that the "new API", with functions such as crypto_one_time/4, be used over the "old API", with functions such as block_encrypt/4. The old functions might be deprecated in the future.

ex_crypto uses the old API in its implementations of the encrypt function, for example.

x-ji commented 5 years ago

Though it does seem to be the case that those functions are introduced in relatively recent versions of crypto.

pmarreck commented 3 years ago

I've been testing OTP24RC2 and indeed, this library breaks, because the old API is now completely deprecated. Hey @ntrepid8 , will you be updating it to work with the new :crypto API anytime soon? The JIT in OTP24 is highly desirable.

ntrepid8 commented 3 years ago

Yeah, this library needs some TLC to get it updated. I'm planning to devote some time, but I also like pull-requests if any of y'all want to take a shot at it :)

lukaszsamson commented 3 years ago

I confirm it's broken on OTP 24.

warning: :crypto.hmac/3 is undefined or private. Did you mean one of:

      * mac/3
      * mac/4
      * macN/4
      * macN/5

  lib/ex_crypto/hmac.ex:15: ExCrypto.HMAC.hmac/3

warning: :crypto.block_decrypt/4 is undefined or private. Did you mean one of:

      * public_decrypt/4
      * public_encrypt/4

  lib/ex_crypto.ex:388: ExCrypto._decrypt/4

warning: :crypto.block_encrypt/4 is undefined or private. Did you mean one of:

      * public_decrypt/4
      * public_encrypt/4

  lib/ex_crypto.ex:317: ExCrypto._encrypt/4