Code Monkey home page Code Monkey logo

rdrand.jl's Introduction

RdRand.jl

Introduction

The RdRand package provides an interface for using Intel's RDRAND instruction, which provides extremely high quality random numbers. The instruction is currently only available on Ivy Bridge processors.

On a 1.8 GHz Intel Core i5 (i5-3427U) each rdrand() call takes about 50 nanoseconds, while rand(), which uses a SIMD Mersenne Twister implementation, takes about 5 nanoseconds.

Installation

In the Julia interpreter type:

Pkg.add("RdRand")

API

  • rdrand(): provides a random number on the interval [0,1]
  • rdrand16(): provides a UInt16 random number
  • rdrand32(): provides a UInt32 random number
  • rdrand64(): provides a UInt64 random number

Randomness

The random numbers are generated by combining a high quality hardware source of entropy (thermal noise) with a cryptographically secure random number generator (CSPRNG). Quoting Intel's guide:

With respect to the RNG taxonomy discussed above, the DRNG follows the cascade construction RNG model, using a processor resident entropy source to repeatedly seed a hardware-implemented CSPRNG. Unlike software approaches, it includes a high-quality entropy source implementation that can be sampled quickly to repeatedly seed the CSPRNG with high-quality entropy. Furthermore, it represents a self-contained hardware module that is isolated from software attacks on its internal state. The result is a solution that achieves RNG objectives with considerable robustness: statistical quality (independence, uniform distribution), highly unpredictable random number sequences, high performance, and protection against attack.

image

rdrand.jl's People

Contributors

samchill avatar blackeneth avatar tkelman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.