[#190] Refactor cryptographic functionality

Remove `signature` and `util/signature` packages. Re-implement their
functionality in new `crypto` package. Generalize the approach of
digital signature computation and verification by adding `Signer` and
`PublicKey` primitives similar to standard `crypto` package. Support
already exising in protocol signature schemes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-04-05 14:13:34 +03:00 committed by LeL
parent 2deaaeef05
commit ea043f4ca3
33 changed files with 728 additions and 627 deletions

View file

@ -8,8 +8,8 @@ import (
v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto"
"github.com/nspcc-dev/neofs-sdk-go/session"
"github.com/nspcc-dev/neofs-sdk-go/signature"
"github.com/nspcc-dev/neofs-sdk-go/version"
)
@ -20,7 +20,7 @@ type Table struct {
version version.Version
cid *cid.ID
token *session.Token
sig *signature.Signature
sig *neofscrypto.Signature
records []Record
}
@ -74,12 +74,12 @@ func (t *Table) SetSessionToken(tok *session.Token) {
}
// Signature returns Table signature.
func (t Table) Signature() *signature.Signature {
func (t Table) Signature() *neofscrypto.Signature {
return t.sig
}
// SetSignature sets Table signature.
func (t *Table) SetSignature(sig *signature.Signature) {
func (t *Table) SetSignature(sig *neofscrypto.Signature) {
t.sig = sig
}