Skip to content

Instantly share code, notes, and snippets.

@reynir
Created March 15, 2020 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reynir/f68eee2de94fbebf0701bef7a99b9140 to your computer and use it in GitHub Desktop.
Save reynir/f68eee2de94fbebf0701bef7a99b9140 to your computer and use it in GitHub Desktop.

Migration guide from Nocrypto

The modules have been split into four packages: mirage-crypto, mirage-crypto-pk, mirage-crypto-rng and mirage-crypto-entropy. Some of the signatures have changed slightly, and sexp has been removed from mirage-crypto (but not mirage-crypto-pk).

Mirage-crypto

This module contains most of the content of Nocrypto except for public key cryptography and RNG. The Base64 module has been removed. In particular, it contains symmetric key cryptography and hashes.

Mirage-crypto-pk

This module contains the public key cryptography as well as Zarith utility functions formerly in Nocrypto.Numeric.Z. The key types have been made private and smart constructors have been introduced. Input is being validated to a higher degree and thus some functions now return (_, [>`Msg of string]) result

Mirage-crypto-rng

Mirage-crypto-entropy

Cheatsheet

  • Nocrypto.UncommonMirage_crypto.Uncommon
  • Nocrypto.HashMirage_crypto.Hash
  • Nocrypto.Cipher_blockMirage_crypto.Cipher_block
  • Nocrypto.Cipher_streamMirage_crypto.Cipher_stream
  • Nocrypto.Base64 → use Base64 from the package base64
  • Nocrypto.RsaMirage_crypto_pk.Rsa
  • Nocrypto.DsaMirage_crypto_pk.Dsa
  • Nocrypto.DhMirage_crypto_pk.Dh
  • Nocrypto.RngMirage_crypto_rng
@hannesm
Copy link

hannesm commented Mar 15, 2020

thanks for writing this up, I also tried to note down the major API breakages in the CHANGES: https://github.com/mirage/mirage-crypto/releases/tag/v0.6.0 -- maybe this helps (and FWIW, the mirage-crypto-entropy shouldn't be needed/used by any consumer) ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment