Giter Site home page Giter Site logo

tectrolabs / microrng Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 81 KB

MicroRNG Software Kit for Raspberry PI 3+ or other Linux-based single-board computers

Home Page: https://tectrolabs.com/microrng/

License: MIT License

Makefile 1.87% C++ 91.53% C 6.60%
microrng mikrobus raspberry-pi-3 raspberry-pi-4 raspberry spi-device entropy-source random-number-generators-trng

microrng's Introduction

MicroRNG Software Kit

MicroRNG is a hardware (true) random number generator device that can be used in embedded systems as a reliable entropy source. It can interface with microcontrollers or microprocessors (mainboards) with integrated circuits and modules through a mikroBUS™ socket using SPI or 2-wire UART interfaces. It can generate random numbers at a rate up to 1 Mbps in SPI mode and up to 1.5 Mbps in UART mode.

This repository contains the MicroRNG Software Kit and utilities for using the MicroRNG device with Raspberry Pi 3+ or other Linux-based single-board computers via an SPI interface.

Contents

  • MicroRngSPI.cpp - API source code in C++ for communicating with a MicroRNG device over an SPI interface.
  • mcdiag.cpp - general purpose diagnostics utility that interacts with the MicroRNG device for determining the maximum clock speed and for validating the communication over an SPI interface.
  • mcrng.cpp - utility for downloading random bytes generated by MicroRNG device over an SPI interface.
  • sample.cpp - sample C++ program that demonstrates how to use the API for communicating with the MicroRNG device over an SPI interface.

Getting Started

To build and run the MicroRNG utilities you will need sudo access permissions on your Linux instance.

Dependencies

The following dependencies are required to successfully build utilities:

  • C++ compiler
  • git
  • make

The C++ compiler can be installed on Ubuntu with the following command:

sudo apt-get install g++

The git development dependency can be installed on Ubuntu with the following command:

sudo apt-get install git

The make development dependency can be installed on Ubuntu with the following command:

sudo apt-get install make

Installing

  • Download the project:
git clone https://github.com/tectrolabs/microrng.git
  • Build the utilities:
cd microrng/mcrng
make 
  • Install the necessary executables:
sudo make install

Verify communication with the MicroRNG

  • Connect MicroRNG device to the target board through the provided SPI interface.
  • Verify device connectivity with the following command (you may need to use a target board specific device path):
sudo mcdiag /dev/spidev0.0
  • You may get an output similar to the following:
~/microrng/mcrng$ sudo mcdiag /dev/spidev0.0 
-------------------------------------------------------------------
--- TectroLabs - mcdiag - MicroRNG diagnostics utility Ver 1.0  ---
--- Use with RPI 3+ or other Linux-based single-board computers ---
-------------------------------------------------------------------
Opening device /dev/spidev0.0 ----------------------------- Success
Identifying device /dev/spidev0.0 --------------  MicroRNG detected
Identifying maximum SPI clock frequency --------------- 31000000 Hz
New SPI clock frequency ------------------------------- 31000000 Hz
Retrieving 32000 random bytes ----------------------------- Success
Retrieving 32000 RAW random bytes ------------------------- Success
Retrieving 32000 random bytes ----------------------------- Success
Shutting down RNG ----------------------------------------- Success
Starting RNG up ------------------------------------------- Success
Computing SPI transfer speed ----------------------------  497 kbps
Validating MicroRNG internal status  ---------------------- Healthy

Authors

Andrian Belinski

microrng's People

Contributors

abelinski avatar ebelinski avatar tectrolabs avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

ebelinski

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.