Skip to content

Commit

Permalink
field arithmetic cleanup
Browse files Browse the repository at this point in the history
Co-authored-by: Armando Faz <[email protected]>
  • Loading branch information
pufferffish and armfazh committed Dec 9, 2022
1 parent d81cf1e commit 9dbf468
Show file tree
Hide file tree
Showing 18 changed files with 238 additions and 254 deletions.
10 changes: 5 additions & 5 deletions kem/mceliece/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,39 @@ func (m Instance) Is8192128() bool {

var (
McElieceParam348864 = Param{
Gf: "gf4096",
Gf: "gf2e12",
PublicKeySize: 261120,
PrivateKeySize: 6492,
CiphertextSize: 96,
SysN: 3488,
SysT: 64,
}
McElieceParam460896 = Param{
Gf: "gf8192",
Gf: "gf2e13",
PublicKeySize: 524160,
PrivateKeySize: 13608,
CiphertextSize: 156,
SysN: 4608,
SysT: 96,
}
McElieceParam6688128 = Param{
Gf: "gf8192",
Gf: "gf2e13",
PublicKeySize: 1044992,
PrivateKeySize: 13932,
CiphertextSize: 208,
SysN: 6688,
SysT: 128,
}
McElieceParam6960119 = Param{
Gf: "gf8192",
Gf: "gf2e13",
PublicKeySize: 1047319,
PrivateKeySize: 13948,
CiphertextSize: 194,
SysN: 6960,
SysT: 119,
}
McElieceParam8192128 = Param{
Gf: "gf8192",
Gf: "gf2e13",
PublicKeySize: 1357824,
PrivateKeySize: 14120,
CiphertextSize: 208,
Expand Down
12 changes: 6 additions & 6 deletions kem/mceliece/internal/fft_const.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package internal

import (
"github.com/cloudflare/circl/math/gf4096"
"github.com/cloudflare/circl/math/gf8192"
"github.com/cloudflare/circl/math/gf2e12"
"github.com/cloudflare/circl/math/gf2e13"
)

var ButterfliesReversal4096 = [64]byte{
Expand Down Expand Up @@ -45,7 +45,7 @@ var RadixConversionsMask = [5][2]uint64{
{0xFFFF000000000000, 0x0000FFFF00000000},
}

var ButterfliesConst = [128][gf8192.GfBits]uint64{
var ButterfliesConst = [128][gf2e13.Bits]uint64{
{
0x6969969669699696,
0x9966669966999966,
Expand Down Expand Up @@ -1968,7 +1968,7 @@ var ButterfliesConst = [128][gf8192.GfBits]uint64{
},
}

var RadixConversionsS = [5][2][gf8192.GfBits]uint64{
var RadixConversionsS = [5][2][gf2e13.Bits]uint64{
{
{
0x3C3CF30C0000C003,
Expand Down Expand Up @@ -2131,7 +2131,7 @@ var RadixConversionsS = [5][2][gf8192.GfBits]uint64{
},
}

var RadixConversionsS4096 = [5][gf4096.GfBits]uint64{
var RadixConversionsS4096 = [5][gf2e12.Bits]uint64{
{
0xF3CFC030FC30F003,
0x3FCF0F003C00C00C,
Expand Down Expand Up @@ -2204,7 +2204,7 @@ var RadixConversionsS4096 = [5][gf4096.GfBits]uint64{
},
}

var ButterfliesConsts4096 = [63][gf4096.GfBits]uint64{
var ButterfliesConsts4096 = [63][gf2e12.Bits]uint64{
// 64
{
0xF00F0FF0F00F0FF0,
Expand Down
8 changes: 4 additions & 4 deletions kem/mceliece/internal/powers.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package internal

import (
"github.com/cloudflare/circl/math/gf4096"
"github.com/cloudflare/circl/math/gf8192"
"github.com/cloudflare/circl/math/gf2e12"
"github.com/cloudflare/circl/math/gf2e13"
)

var Powers4096 = [64][gf4096.GfBits]uint64{
var Powers4096 = [64][gf2e12.Bits]uint64{
{
0x0F0F0F0FF0F0F0F0,
0xFFFF0000FFFF0000,
Expand Down Expand Up @@ -904,7 +904,7 @@ var Powers4096 = [64][gf4096.GfBits]uint64{
},
}

var Powers8192 = [128][gf8192.GfBits]uint64{
var Powers8192 = [128][gf2e13.Bits]uint64{
{
0x5AA55AA5A55AA55A,
0x3CC33CC3C33CC33C,
Expand Down
34 changes: 17 additions & 17 deletions kem/mceliece/mceliece348864/mceliece.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions kem/mceliece/mceliece348864f/mceliece.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9dbf468

Please sign in to comment.