nskinkel / libredsalt

2 stars 1 forks source link

implement randombytes in rust #1

Closed nskinkel closed 9 years ago

nskinkel commented 9 years ago

This pull request implements the required randombytes() function in pure Rust using the rand::OsRng crate. This should work on any Rust-compatible platform.

A couple unanswered questions remain:

  1. Is it really necessary to create a new instance of OsRng with every function invocation, or is there a way to create a single global/protected static instance that can just be re-used over the lifetime of the program.
  2. Where is the right place for randombytes()? It's currently in its own file, but this (maybe?) should change.

I'm fine with leaving these questions as future work for now, though.