Documentation
¶
Index ¶
- Constants
- func Decode64(src []byte) []byte
- func DecodeSetting(setting []byte) (flags, ln, r int, err error)
- func Encode64(src []byte) []byte
- func EncodeSetting(flags, ln, r int) []byte
- func Hash(password, setting []byte) ([]byte, error)
- func Key(password, salt []byte, N, r, p, keyLen int) ([]byte, error)
Constants ¶
const ( PWXsimple = 2 PWXgather = 4 PWXrounds = 6 Swidth = 8 )
These were tunable at design time, but they must meet certain constraints
const ( PWXbytes = PWXgather * PWXsimple * 8 PWXwords = PWXbytes / 8 Sbytes = 3 * (1 << Swidth) * PWXsimple * 8 Swords = Sbytes / 8 Smask = (((1 << Swidth) - 1) * PWXsimple * 8) )
Derived values. These were never tunable on their own.
Variables ¶
This section is empty.
Functions ¶
func DecodeSetting ¶ added in v0.4.1
func EncodeSetting ¶ added in v0.4.1
func Hash ¶
Hash computes yescrypt hash encoding given the password and existing yescrypt setting or full hash encoding. The salt and other parameters are decoded from setting. Currently supports (only a little more than) the subset of yescrypt parameters that libxcrypt can generate (as of libxcrypt 4.4.36).
func Key ¶
Key computes native yescrypt assuming reference yescrypt's current default flags (as of yescrypt 1.1.0), p=1 (which it currently requires), t=0, and no ROM. Example usage:
dk, err := yescrypt.Key([]byte("some password"), salt, 32768, 8, 1, 32)
The set of parameters accepted by Key will likely change in future versions of this Go module to support more yescrypt functionality.
Types ¶
This section is empty.