diff --git a/signer/node.go b/signer/node.go index 09bf9cd..1b92272 100644 --- a/signer/node.go +++ b/signer/node.go @@ -73,7 +73,7 @@ func NewNode(ctx context.Context, cancel context.CancelFunc, store store.Storage } } groupId := sha3.Sum256(group) - valid, err := store.CheckGroupIdenity(groupId[:]) + valid, err := store.CheckPolyGroup(groupId[:]) if err != nil || !valid { panic(fmt.Errorf("Group check failed %v %v", valid, err)) } diff --git a/store/badger.go b/store/badger.go index ceff048..cb207eb 100644 --- a/store/badger.go +++ b/store/badger.go @@ -10,8 +10,7 @@ import ( ) const ( - badgerKeyGroupIdentity = "GROUP" - + badgerKeyPolyGroup = "POLY#GROUP" badgerKeyPolyPublic = "POLY#PUBLIC" badgerKeyPolyShare = "POLY#SHARE" @@ -116,9 +115,9 @@ func (bs *BadgerStorage) RotateEphemeralNonce(key, ephemeral []byte, nonce uint6 }) } -func (bs *BadgerStorage) CheckGroupIdenity(group []byte) (bool, error) { +func (bs *BadgerStorage) CheckPolyGroup(group []byte) (bool, error) { var valid bool - key := []byte(badgerKeyGroupIdentity) + key := []byte(badgerKeyPolyGroup) err := bs.db.Update(func(txn *badger.Txn) error { item, err := txn.Get(key) if err == badger.ErrKeyNotFound { diff --git a/store/badger_test.go b/store/badger_test.go index 62396d3..6917926 100644 --- a/store/badger_test.go +++ b/store/badger_test.go @@ -69,24 +69,24 @@ func TestBadgerNonce(t *testing.T) { assert.True(res) } -func TestBadgerGroupIdentity(t *testing.T) { +func TestBadgerPolyGroup(t *testing.T) { assert := assert.New(t) bs := testBadgerStore() defer bs.Close() - valid, err := bs.CheckGroupIdenity([]byte("group")) + valid, err := bs.CheckPolyGroup([]byte("group")) assert.Nil(err) assert.True(valid) - valid, err = bs.CheckGroupIdenity([]byte("group")) + valid, err = bs.CheckPolyGroup([]byte("group")) assert.Nil(err) assert.True(valid) - valid, err = bs.CheckGroupIdenity([]byte("invalid")) + valid, err = bs.CheckPolyGroup([]byte("invalid")) assert.Nil(err) assert.False(valid) - valid, err = bs.CheckGroupIdenity([]byte("group")) + valid, err = bs.CheckPolyGroup([]byte("group")) assert.Nil(err) assert.True(valid) } diff --git a/store/interface.go b/store/interface.go index dffae06..a3fb00c 100644 --- a/store/interface.go +++ b/store/interface.go @@ -3,8 +3,7 @@ package store import "time" type Storage interface { - CheckGroupIdenity(group []byte) (bool, error) - + CheckPolyGroup(group []byte) (bool, error) ReadPolyPublic() ([]byte, error) ReadPolyShare() ([]byte, error) WritePoly(public, share []byte) error diff --git a/web/workflow.jpg b/web/workflow.jpg index 9f4c90f..ead289c 100644 Binary files a/web/workflow.jpg and b/web/workflow.jpg differ