Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Nim wrapper for the libsodium library

License

Notifications You must be signed in to change notification settings

FedericoCeratto/nim-libsodium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nim-libsodium

Nim wrapper for the libsodium library

Build Status badge tags License

Features

  • Wrap libsodium and expose only memory-safe entities

  • Follow libsodium naming convention for most functions

  • Tested on Linux, MacOS and windows

  • Basic unit tests

  • No homemade crypto

Usage

and the generated documentation using nim doc.

Also, the structure of libsodium/sodium.nim follows the order of https://doc.libsodium.org/

sudo apt-get install libsodium18
nimble install libsodium
import libsodium.sodium
import libsodium.sodium_sizes

let
  msg = "hello and goodbye"
  (pk, sk) = crypto_box_keypair()
  nonce = randombytes(crypto_box_NONCEBYTES())
  ciphertext = crypto_box_easy(msg, nonce, pk, sk)

Contributing

Testing and PRs are welcome.