Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveKey ¶
func DeriveKey(o []DeriveOptionsBuilder) ([]byte, error)
Types ¶
type DeriveOptionsBuilder ¶
type DeriveOptionsBuilder func(*DeriveOpts)
DeriveOptionsBuilder creates the options to derive a key from scrypt.
func DefaultDeriveOptions ¶
func DefaultDeriveOptions() DeriveOptionsBuilder
func FromEncryptedKey ¶
func FromEncryptedKey(length, n, p, r int, salt []byte) DeriveOptionsBuilder
func RandomSalt ¶
func RandomSalt() (DeriveOptionsBuilder, error)
func WithPassphrase ¶
func WithPassphrase(passphrase string) DeriveOptionsBuilder
WithPassphrase adds passphrase to the dervive options
type DeriveOpts ¶
type DeriveOpts struct { Len int `json:"len"` N int `json:"n"` P int `json:"p"` R int `json:"r"` Salt []byte `json:"salt"` Passphrase string `json:"-"` }
func CreateOptions ¶
func CreateOptions(o []DeriveOptionsBuilder) *DeriveOpts
func (DeriveOpts) KDF ¶
func (d DeriveOpts) KDF() string
Click to show internal directories.
Click to hide internal directories.