Compare commits

..

3 Commits
main ... dev

Author SHA1 Message Date
09e5ac97b9 [dev] local kyber 2025-07-28 13:02:48 +08:00
cfeb092957 Allow setting suite key stream 2025-07-28 12:46:17 +08:00
e1b3e68983 [wip] check qualified set 2025-07-28 12:46:17 +08:00
3 changed files with 22 additions and 3 deletions

View File

@ -97,6 +97,7 @@ type DSSArgs = struct {
Random DistKeyShare
Msg *big.Int
T int
Qualified []int
}
// PartialSig is partial representation of the final distributed signature. It
@ -213,6 +214,17 @@ func (d *DSS) ProcessPartialSig(ps *PartialSig) error {
if err := ethschnorr.Verify(public, ps.Hash(), ps.Signature); err != nil {
return err
}
// qualified := false
// for _, idx := range d.Qualified {
// if ps.Partial.I == idx {
// qualified = true
// break
// }
// }
// if !qualified {
// return errors.New("dss: partial signature from non-qualifying participant")
// }
if _, ok := d.partialsIdx[ps.Partial.I]; ok {
return errors.New("dss: partial signature already received from peer")
}

3
go.mod
View File

@ -22,4 +22,5 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace go.dedis.ch/kyber/v3 => github.com/cerc-io/kyber/v3 v3.0.0-20250728035006-f80208a7f291 // branch dev-3.x
replace go.dedis.ch/kyber/v3 => ../kyber
// replace go.dedis.ch/kyber/v3 => github.com/cerc-io/kyber/v3 v3.0.0-20250728035006-f80208a7f291 // branch dev-3.x

View File

@ -77,8 +77,8 @@ func (s *SuiteSecp256k1) New(t reflect.Type) interface{} {
return nil
}
// RandomStream returns a cipher.Stream that returns a key stream
// from crypto/rand.
// RandomStream returns the cipher.Stream with which the suite was initialized with, or a new key
// stream from crypto/rand if one is not set.
func (s *SuiteSecp256k1) RandomStream() cipher.Stream {
if s.r != nil {
return s.r
@ -92,3 +92,9 @@ func (s *SuiteSecp256k1) RandomStream() cipher.Stream {
func NewBlakeKeccackSecp256k1() *SuiteSecp256k1 {
return new(SuiteSecp256k1)
}
// NewBlakeKeccackSecp256k1 returns a cipher suite based on package
// go.dedis.ch/kyber/xof/blake2xb, SHA-256, and the secp256k1 curve.
func NewBlakeKeccackSecp256k1WithKeyStream(stream cipher.Stream) *SuiteSecp256k1 {
return &SuiteSecp256k1{r: stream}
}