// sign-in-ecdh
seed = ECDH({ curve: P-256 })
// sign-in
seed = stretch({ user: username, note: password })
// stretch
|--PBKDF2--------|
| salt <-
| passphrase <-
| hash: sha256 |
| round: 100_000 |
|----------------|
acc = seed || cornerlation.namespace
uuid = uuid || cornerlation[slug].uuid
for (x of [ salt?, note?, user?, uuid ]) {
acc = PBKDF2({ salt: acc, passphrase: x || acc })
}
// application
entropy = acc
password = sha512(entropy).map(n => lookup_table[n])
mnemonic = bip39(sha256(entropy))
{ enc, dec } = aes256gcm({ key_iv: sha512(entropy) })