Skip to content

Commit

Permalink
Jeff's Comments
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff R. Allen <jeff.allen@epfl.ch>
  • Loading branch information
gnarula and Jeff R. Allen authored Aug 13, 2020
1 parent 5556ed0 commit 6a0ad45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion group/edwards25519/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (P *point) HasSmallOrder() bool {
// Taken from
// https://github.com/jedisct1/libsodium/blob/4744636721d2e420f8bbe2d563f31b1f5e682229/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c#L1113
//
// The meethod accepts a buffer instead of calling `MarshalBianry` on the receiver
// The method accepts a buffer instead of calling `MarshalBinary` on the receiver
// because that always returns a value modulo `prime`.
func (P *point) IsCanonical(s []byte) bool {
if len(s) != 32 {
Expand Down
4 changes: 2 additions & 2 deletions group/edwards25519/scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2231,13 +2231,13 @@ func scReduce(out *[32]byte, s *[64]byte) {
out[31] = byte(s11 >> 17)
}

// IsCanonical whether scalar s is in the range 0<=s<L as required by RFC8032, Section 5.1.7.
// IsCanonical whether the scalar in sb is in the range 0<=s<L as required by RFC8032, Section 5.1.7.
// Also provides Strong Unforgeability under Chosen Message Attacks (SUF-CMA)
// See paper https://eprint.iacr.org/2020/823.pdf for definitions and theorems
// See https://github.com/jedisct1/libsodium/blob/4744636721d2e420f8bbe2d563f31b1f5e682229/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c#L2568
// for a reference.
// The method accepts a buffer instead of calling `MarshalBinary` on the receiver since that
// always returns values modulo `primeOrder`
// always returns values modulo `primeOrder`.
func (s *scalar) IsCanonical(sb []byte) bool {
if len(sb) != 32 {
return false
Expand Down

0 comments on commit 6a0ad45

Please sign in to comment.