refactor user defined keypad

This commit is contained in:
2024-08-24 21:02:50 -05:00
parent 1a7dc45ab9
commit 3bf2b4d71f
19 changed files with 273 additions and 190 deletions

View File

@@ -8,6 +8,7 @@ import (
type User struct {
Username m.Username
EncipheredPasscode m.EncipheredNKode
Kp m.KeypadDimension
UserKeys UserCipherKeys
Interface UserInterface
Renew bool
@@ -29,7 +30,8 @@ func (u *User) RenewKeys(setXor []uint64, attrXor []uint64) error {
}
func (u *User) RefreshPasscode(passcodeAttrIdx []int, customerAttributes CustomerAttributes) error {
newKeys, err := NewUserCipherKeys(customerAttributes.KeypadSize, customerAttributes.SetVals, u.UserKeys.MaxNKodeLen)
setVals, err := customerAttributes.SetVals(u.Kp)
newKeys, err := NewUserCipherKeys(&u.Kp, setVals, u.UserKeys.MaxNKodeLen)
if err != nil {
return err
}