Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillBytes ¶
func FillBytes(out []byte)
FillBytes fills out with random bytes from the OS CSPRNG, or panics
func UseProvidedOrFillBytes ¶
func UseProvidedOrFillBytes(unitTestNonce, out []byte)
UseProvidedOrFillBytes will fill `out' with unitTestNonce, provided it is not nil and unitTestNonce matches the length of `out' exactly. If unitTestNonce's length is incorrect, this will panic. If unitTestNonce is nil, `out' will be filled with CSPRNG bytes using FillBytes.
This allows us to unit test where encryption would otherwise be non-deterministic. Functions which accept unitTestNonce will not be exported and so do not present a footgun in the user-available API.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.