Browse Source

sike: move common (#33)

* makes common reusable
* exports some more symbols from common
* remove kem for a moment
multikem
Henry Case 4 years ago
committed by GitHub
parent
commit
a152c09fd5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 45 additions and 58 deletions
  1. +1
    -1
      dh/sidh/internal/p434/arith_amd64_test.go
  2. +1
    -1
      dh/sidh/internal/p434/arith_decl.go
  3. +1
    -1
      dh/sidh/internal/p434/arith_generic.go
  4. +1
    -1
      dh/sidh/internal/p434/arith_test.go
  5. +1
    -1
      dh/sidh/internal/p434/core.go
  6. +1
    -1
      dh/sidh/internal/p434/curve.go
  7. +1
    -1
      dh/sidh/internal/p434/curve_test.go
  8. +1
    -1
      dh/sidh/internal/p434/fp2.go
  9. +1
    -1
      dh/sidh/internal/p434/fp2_test.go
  10. +1
    -1
      dh/sidh/internal/p434/params.go
  11. +1
    -1
      dh/sidh/internal/p434/params_test.go
  12. +1
    -1
      dh/sidh/internal/p503/arith_amd64_test.go
  13. +1
    -1
      dh/sidh/internal/p503/arith_decl.go
  14. +1
    -1
      dh/sidh/internal/p503/arith_generic.go
  15. +1
    -1
      dh/sidh/internal/p503/arith_test.go
  16. +1
    -1
      dh/sidh/internal/p503/core.go
  17. +1
    -1
      dh/sidh/internal/p503/curve.go
  18. +1
    -1
      dh/sidh/internal/p503/curve_test.go
  19. +1
    -1
      dh/sidh/internal/p503/fp2.go
  20. +1
    -1
      dh/sidh/internal/p503/fp2_test.go
  21. +1
    -1
      dh/sidh/internal/p503/params.go
  22. +1
    -1
      dh/sidh/internal/p503/params_test.go
  23. +1
    -1
      dh/sidh/internal/p751/arith_amd64_test.go
  24. +1
    -1
      dh/sidh/internal/p751/arith_decl.go
  25. +1
    -1
      dh/sidh/internal/p751/arith_generic.go
  26. +1
    -1
      dh/sidh/internal/p751/arith_test.go
  27. +1
    -1
      dh/sidh/internal/p751/core.go
  28. +1
    -1
      dh/sidh/internal/p751/curve.go
  29. +1
    -1
      dh/sidh/internal/p751/curve_test.go
  30. +1
    -1
      dh/sidh/internal/p751/fp2.go
  31. +1
    -1
      dh/sidh/internal/p751/fp2_test.go
  32. +1
    -1
      dh/sidh/internal/p751/params.go
  33. +1
    -1
      dh/sidh/internal/p751/params_test.go
  34. +1
    -1
      dh/sidh/internal/templates/arith_decl.gotemp
  35. +1
    -1
      dh/sidh/internal/templates/arith_generic.gotemp
  36. +1
    -1
      dh/sidh/internal/templates/arith_test.gotemp
  37. +1
    -1
      dh/sidh/internal/templates/core.gotemp
  38. +1
    -1
      dh/sidh/internal/templates/curve.gotemp
  39. +1
    -1
      dh/sidh/internal/templates/curve_test.gotemp
  40. +1
    -1
      dh/sidh/internal/templates/fp2.gotemp
  41. +1
    -1
      dh/sidh/internal/templates/fp2_test.gotemp
  42. +1
    -1
      dh/sidh/sidh.go
  43. +1
    -1
      dh/sidh/sidh_test.go
  44. +1
    -1
      dh/sidh/sike.go
  45. +1
    -1
      dh/sidh/sike_test.go
  46. +0
    -13
      kem/mkem/csidh.go

+ 1
- 1
dh/sidh/internal/p434/arith_amd64_test.go View File

@@ -10,7 +10,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"golang.org/x/sys/cpu"
)



+ 1
- 1
dh/sidh/internal/p434/arith_decl.go View File

@@ -6,7 +6,7 @@
package p434

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x.


+ 1
- 1
dh/sidh/internal/p434/arith_generic.go View File

@@ -8,7 +8,7 @@ package p434
import (
"math/bits"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Compute z = x + y (mod p).


+ 1
- 1
dh/sidh/internal/p434/arith_test.go View File

@@ -6,7 +6,7 @@ package p434
import (
"testing"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Package-level storage for this field element is intended to deter


+ 1
- 1
dh/sidh/internal/p434/core.go View File

@@ -4,7 +4,7 @@
package p434

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// -----------------------------------------------------------------------------


+ 1
- 1
dh/sidh/internal/p434/curve.go View File

@@ -4,7 +4,7 @@
package p434

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// Stores isogeny 3 curve constants


+ 1
- 1
dh/sidh/internal/p434/curve_test.go View File

@@ -7,7 +7,7 @@ import (
"bytes"
"testing"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

func vartimeEqProjFp2(lhs, rhs *ProjectivePoint) bool {


+ 1
- 1
dh/sidh/internal/p434/fp2.go View File

@@ -4,7 +4,7 @@
package p434

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Montgomery multiplication. Input values must be already


+ 1
- 1
dh/sidh/internal/p434/fp2_test.go View File

@@ -9,7 +9,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

type testParams struct {


+ 1
- 1
dh/sidh/internal/p434/params.go View File

@@ -3,7 +3,7 @@ package p434
//go:generate go run ../templates/gen.go P434

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"golang.org/x/sys/cpu"
)



+ 1
- 1
dh/sidh/internal/p434/params_test.go View File

@@ -4,7 +4,7 @@ package p434
import (
"testing/quick"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// Values omputed using Sage


+ 1
- 1
dh/sidh/internal/p503/arith_amd64_test.go View File

@@ -10,7 +10,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"golang.org/x/sys/cpu"
)



+ 1
- 1
dh/sidh/internal/p503/arith_decl.go View File

@@ -6,7 +6,7 @@
package p503

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x.


+ 1
- 1
dh/sidh/internal/p503/arith_generic.go View File

@@ -8,7 +8,7 @@ package p503
import (
"math/bits"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Compute z = x + y (mod p).


+ 1
- 1
dh/sidh/internal/p503/arith_test.go View File

@@ -6,7 +6,7 @@ package p503
import (
"testing"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Package-level storage for this field element is intended to deter


+ 1
- 1
dh/sidh/internal/p503/core.go View File

@@ -4,7 +4,7 @@
package p503

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// -----------------------------------------------------------------------------


+ 1
- 1
dh/sidh/internal/p503/curve.go View File

@@ -4,7 +4,7 @@
package p503

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// Stores isogeny 3 curve constants


+ 1
- 1
dh/sidh/internal/p503/curve_test.go View File

@@ -7,7 +7,7 @@ import (
"bytes"
"testing"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

func vartimeEqProjFp2(lhs, rhs *ProjectivePoint) bool {


+ 1
- 1
dh/sidh/internal/p503/fp2.go View File

@@ -4,7 +4,7 @@
package p503

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Montgomery multiplication. Input values must be already


+ 1
- 1
dh/sidh/internal/p503/fp2_test.go View File

@@ -9,7 +9,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

type testParams struct {


+ 1
- 1
dh/sidh/internal/p503/params.go View File

@@ -3,7 +3,7 @@ package p503
//go:generate go run ../templates/gen.go P503

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"golang.org/x/sys/cpu"
)



+ 1
- 1
dh/sidh/internal/p503/params_test.go View File

@@ -4,7 +4,7 @@ package p503
import (
"testing/quick"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// Values omputed using Sage


+ 1
- 1
dh/sidh/internal/p751/arith_amd64_test.go View File

@@ -10,7 +10,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"golang.org/x/sys/cpu"
)



+ 1
- 1
dh/sidh/internal/p751/arith_decl.go View File

@@ -6,7 +6,7 @@
package p751

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x.


+ 1
- 1
dh/sidh/internal/p751/arith_generic.go View File

@@ -8,7 +8,7 @@ package p751
import (
"math/bits"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Compute z = x + y (mod p).


+ 1
- 1
dh/sidh/internal/p751/arith_test.go View File

@@ -6,7 +6,7 @@ package p751
import (
"testing"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Package-level storage for this field element is intended to deter


+ 1
- 1
dh/sidh/internal/p751/core.go View File

@@ -4,7 +4,7 @@
package p751

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// -----------------------------------------------------------------------------


+ 1
- 1
dh/sidh/internal/p751/curve.go View File

@@ -4,7 +4,7 @@
package p751

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// Stores isogeny 3 curve constants


+ 1
- 1
dh/sidh/internal/p751/curve_test.go View File

@@ -7,7 +7,7 @@ import (
"bytes"
"testing"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

func vartimeEqProjFp2(lhs, rhs *ProjectivePoint) bool {


+ 1
- 1
dh/sidh/internal/p751/fp2.go View File

@@ -4,7 +4,7 @@
package p751

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Montgomery multiplication. Input values must be already


+ 1
- 1
dh/sidh/internal/p751/fp2_test.go View File

@@ -9,7 +9,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

type testParams struct {


+ 1
- 1
dh/sidh/internal/p751/params.go View File

@@ -3,7 +3,7 @@ package p751
//go:generate go run ../templates/gen.go P751

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"golang.org/x/sys/cpu"
)



+ 1
- 1
dh/sidh/internal/p751/params_test.go View File

@@ -4,7 +4,7 @@ package p751
import (
"testing/quick"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

var (


+ 1
- 1
dh/sidh/internal/templates/arith_decl.gotemp View File

@@ -6,7 +6,7 @@
package {{ .PACKAGE}}

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x.


+ 1
- 1
dh/sidh/internal/templates/arith_generic.gotemp View File

@@ -8,7 +8,7 @@ package {{ .PACKAGE}}
import (
"math/bits"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Compute z = x + y (mod p).


+ 1
- 1
dh/sidh/internal/templates/arith_test.gotemp View File

@@ -6,7 +6,7 @@ package {{ .PACKAGE}}
import (
"testing"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Package-level storage for this field element is intended to deter


+ 1
- 1
dh/sidh/internal/templates/core.gotemp View File

@@ -4,7 +4,7 @@
package {{ .PACKAGE}}

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// -----------------------------------------------------------------------------


+ 1
- 1
dh/sidh/internal/templates/curve.gotemp View File

@@ -4,7 +4,7 @@
package {{ .PACKAGE}}

import (
. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

// Stores isogeny 3 curve constants


+ 1
- 1
dh/sidh/internal/templates/curve_test.gotemp View File

@@ -7,7 +7,7 @@ import (
"bytes"
"testing"

. "github.com/henrydcase/nobs/dh/sidh/internal/common"
. "github.com/henrydcase/nobs/dh/sidh/common"
)

func vartimeEqProjFp2(lhs, rhs *ProjectivePoint) bool {


+ 1
- 1
dh/sidh/internal/templates/fp2.gotemp View File

@@ -4,7 +4,7 @@
package {{ .PACKAGE}}

import (
"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

// Montgomery multiplication. Input values must be already


+ 1
- 1
dh/sidh/internal/templates/fp2_test.gotemp View File

@@ -9,7 +9,7 @@ import (
"testing"
"testing/quick"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

type testParams struct {


+ 1
- 1
dh/sidh/sidh.go View File

@@ -4,7 +4,7 @@ import (
"errors"
"io"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"github.com/henrydcase/nobs/dh/sidh/internal/p434"
"github.com/henrydcase/nobs/dh/sidh/internal/p503"
"github.com/henrydcase/nobs/dh/sidh/internal/p751"


+ 1
- 1
dh/sidh/sidh_test.go View File

@@ -8,7 +8,7 @@ import (
"math/big"
"testing"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

/* -------------------------------------------------------------------------


+ 1
- 1
dh/sidh/sike.go View File

@@ -5,7 +5,7 @@ import (
"errors"
"io"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
"github.com/henrydcase/nobs/hash/sha3"
)



+ 1
- 1
dh/sidh/sike_test.go View File

@@ -12,7 +12,7 @@ import (
"strings"
"testing"

"github.com/henrydcase/nobs/dh/sidh/internal/common"
"github.com/henrydcase/nobs/dh/sidh/common"
)

type sikeVec struct {


+ 0
- 13
kem/mkem/csidh.go View File

@@ -1,13 +0,0 @@
package mkem

func PK_enc() {

}

func PK_dec() {

}

func KEM_mEnc() {

}

Loading…
Cancel
Save