Skip to content

Commit

Permalink
going back to dedis makefile + fixing a function that got chopped dur…
Browse files Browse the repository at this point in the history
…ing the merge
  • Loading branch information
Robingoumaz committed Apr 4, 2024
1 parent 8f039bf commit 1f8da36
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@ tidy:
#go install honnef.co/go/tools/cmd/staticcheck@latest
go mod tidy

Coding/bin/Makefile.base:
git clone https://github.com/dedis/Coding
include Coding/bin/Makefile.base
generate: tidy
go generate ./...

.PHONY: fetch-dependencies
fetch-dependencies:
go get -v -t -d ./...
# Coding style static check.
lint: tidy
@echo "Please setup a linter!"
#golangci-lint run
#staticcheck go list ./...


vet: tidy
go vet ./...

test: tidy
go test ./...

coverage: tidy
go test -json -covermode=count -coverprofile=profile.cov ./... > report.json

# target to run all the possible checks; it's a good habit to run it before
# pushing code
check: lint vet test
echo "check done"
11 changes: 11 additions & 0 deletions sign/schnorr/schnorr.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ func VerifyWithChecks(g kyber.Group, pub, msg, sig []byte) error {
if err := R.UnmarshalBinary(sig[:pointSize]); err != nil {
return err
}
if p, ok := R.(pointCanCheckCanonicalAndSmallOrder); ok {
if !p.IsCanonical(sig[:pointSize]) {
return fmt.Errorf("R is not canonical")
}
if p.HasSmallOrder() {
return fmt.Errorf("R has small order")
}
}
if s, ok := g.Scalar().(scalarCanCheckCanonical); ok && !s.IsCanonical(sig[pointSize:]) {
return fmt.Errorf("signature is not canonical")
}
if sub, ok := R.(kyber.SubGroupElement); ok && !sub.IsInCorrectGroup() {
return fmt.Errorf("schnorr: point not in correct group")
}
Expand Down

0 comments on commit 1f8da36

Please sign in to comment.