rngb

package
v0.0.0-...-d73fcdd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package rngb implements a driver for the NXP True Random Number Generator (RNGB) included in i.MX6ULL/i.MX6ULZ SoCs.

This package is only meant to be used with `GOOS=tamago GOARCH=arm` as supported by the TamaGo framework for bare metal Go on ARM SoCs, see https://github.com/f-secure-foundry/tamago.

Index

Constants

View Source
const (
	RNG_BASE = 0x02284000

	RNG_CMD    = RNG_BASE + 0x04
	RNG_CMD_SR = 6
	RNG_CMD_CE = 5
	RNG_CMD_CI = 4
	RNG_CMD_GS = 1
	RNG_CMD_ST = 0

	RNG_CR    = RNG_BASE + 0x08
	RNG_CR_AR = 4
	RNG_CR_GS = 1

	RNG_SR          = RNG_BASE + 0x0c
	RNG_SR_ST_PF    = 21
	RNG_SR_ERR      = 16
	RNG_SR_FIFO_LVL = 8
	RNG_SR_SDN      = 5
	RNG_SR_STDN     = 4

	RNG_ESR = RNG_BASE + 0x10
	RNG_OUT = RNG_BASE + 0x14
)

RNGB registers

Variables

This section is empty.

Functions

func Fill

func Fill(b []byte, index int, val uint32) int

func GetRandomData

func GetRandomData(b []byte)

GetRandomData returns len(b) random bytes gathered from the RNGB module.

func Init

func Init()

Init initializes the RNGB module with automatic seeding.

func Reset

func Reset()

Reset resets the RNGB module.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL