-func blake2bKeyless() hash.Hash {
- h, err := blake2b.New256(nil)
+// PasswordApply applies the password: create Ed25519 keypair based on it,
+// saves public key in verifier.
+func (v *Verifier) PasswordApply(password string) (*[ed25519.PrivateKeySize]byte, error) {
+ // TODO: there is an extremely weird bug, `balloon.H` panic if I the `hash.Hash`
+ // outside the `hasher` function.
+ var err error
+ hasher := func() hash.Hash {
+ var nilHash hash.Hash
+ nilHash, err = blake2b.New256(nil)
+ return nilHash
+ }
+ r := balloon.H(hasher, []byte(password), v.ID[:], v.S, v.T, v.P)