Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
wrap byte slices
Browse files Browse the repository at this point in the history
Signed-off-by: bytemare <[email protected]>
  • Loading branch information
bytemare committed Oct 1, 2024
1 parent 6def777 commit b40f839
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 136 deletions.
72 changes: 4 additions & 68 deletions internal/edwards25519/scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,74 +25,10 @@ var (
scZero Scalar
scOne Scalar
order big.Int
scMinusOne = []byte{
236,
211,
245,
92,
26,
99,
18,
88,
214,
156,
247,
162,
222,
249,
222,
20,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
16,
}
orderBytes = []byte{
237,
211,
245,
92,
26,
99,
18,
88,
214,
156,
247,
162,
222,
249,
222,
20,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
16,
}
scMinusOne = []byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}
orderBytes = []byte{237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}
)

func init() {
Expand Down
72 changes: 4 additions & 68 deletions internal/ristretto/scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,79 +24,15 @@ const canonicalEncodingLength = 32
var (
scZero = &Scalar{*ristretto255.NewScalar()}
scOne Scalar
scMinusOne = []byte{
236,
211,
245,
92,
26,
99,
18,
88,
214,
156,
247,
162,
222,
249,
222,
20,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
16,
}
orderBytes = []byte{
237,
211,
245,
92,
26,
99,
18,
88,
214,
156,
247,
162,
222,
249,
222,
20,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
16,
}
scMinusOne = []byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}
// orderBytes represents curve25519's subgroup prime-order
// = 2^252 + 27742317777372353535851937790883648493
// = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed
// = 7237005577332262213973186563042994240857116359379907606001950938285454250989
// cofactor h = 8.
orderBytes = []byte{237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}
)

func init() {
Expand Down

0 comments on commit b40f839

Please sign in to comment.