rngb

package
v0.0.0-...-1cacaac Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

Package rngb implements a driver for the NXP True Random Number Generator (RNGB) adopting the following specifications:

  • IMX6ULLRM - i.MX 6ULL Applications Processor Reference Manual - Rev 1 2017/11

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/usbarmory/tamago.

Index

Constants

View Source
const (
	RNG_CMD    = 0x04
	RNG_CMD_SR = 6
	RNG_CMD_CE = 5
	RNG_CMD_CI = 4
	RNG_CMD_GS = 1
	RNG_CMD_ST = 0

	RNG_CR    = 0x08
	RNG_CR_AR = 4
	RNG_CR_GS = 1

	RNG_SR          = 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 = 0x10
	RNG_OUT = 0x14
)

RNGB registers

Variables

This section is empty.

Functions

This section is empty.

Types

type RNGB

type RNGB struct {
	sync.Mutex

	// Base register
	Base uint32
	// contains filtered or unexported fields
}

RNGB represents the RNGB instance.

func (*RNGB) GetRandomData

func (hw *RNGB) GetRandomData(b []byte)

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

func (*RNGB) Init

func (hw *RNGB) Init()

Init initializes the RNGB module with automatic seeding.

func (*RNGB) Reset

func (hw *RNGB) Reset()

Reset resets the RNGB module.

Jump to

Keyboard shortcuts

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