File: rand.go

package info (click to toggle)
golang-github-smallstep-crypto 0.57.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,284 kB
  • sloc: sh: 53; makefile: 36
file content (16 lines) | stat: -rw-r--r-- 262 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package rand

import (
	"fmt"
	"io"

	"go.step.sm/crypto/tpm"
)

func New(opts ...tpm.NewTPMOption) (io.Reader, error) {
	t, err := tpm.New(opts...)
	if err != nil {
		return nil, fmt.Errorf("failed creating TPM instance: %w", err)
	}
	return t.RandomReader()
}