MCPcopy
hub / github.com/FiloSottile/age / SetWorkFactor

Method SetWorkFactor

scrypt.go:55–60  ·  view source on GitHub ↗

SetWorkFactor sets the scrypt work factor to 2^logN. It must be called before Wrap. If SetWorkFactor is not called, a reasonable default is used.

(logN int)

Source from the content-addressed store, hash-verified

53//
54// If SetWorkFactor is not called, a reasonable default is used.
55func (r *ScryptRecipient) SetWorkFactor(logN int) {
56 if logN > 30 || logN < 1 {
57 panic("age: SetWorkFactor called with illegal value")
58 }
59 r.workFactor = logN
60}
61
62const scryptSaltSize = 16
63

Callers 5

TestScryptRoundTripFunction · 0.95
TestEncryptDecryptScryptFunction · 0.95
TestScryptIdentityErrorsFunction · 0.95
mainFunction · 0.95
TestMainFunction · 0.80

Calls

no outgoing calls

Tested by 4

TestScryptRoundTripFunction · 0.76
TestEncryptDecryptScryptFunction · 0.76
TestScryptIdentityErrorsFunction · 0.76
TestMainFunction · 0.64