-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement UsortBody hint * Debug hint code * Implement error check for inputLength * Add bugfixes, add testcases * Implement comments from PR * Resolve merge conflicts * Fix unit tests issues * Specify the type of '__usort_max_size' * Code cleanups * Address comments from PR * Address comments from PR * Lint PR
- Loading branch information
1 parent
70ad3af
commit a9d37d1
Showing
7 changed files
with
384 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package utils | ||
|
||
import "github.com/consensys/gnark-crypto/ecc/stark-curve/fp" | ||
|
||
// SortFelt is a type that implements the sort.Interface for a slice of fp.Element | ||
// This file provides utility functions for sorting slices of fp.Element | ||
type SortFelt []fp.Element | ||
|
||
func (s SortFelt) Len() int { | ||
return len(s) | ||
} | ||
|
||
func (s SortFelt) Less(i, j int) bool { | ||
return s[i].Cmp(&s[j]) < 0 | ||
} | ||
|
||
func (s SortFelt) Swap(i, j int) { | ||
s[i], s[j] = s[j], s[i] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.