File: params.go

package info (click to toggle)
golang-github-cloudflare-circl 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-backports
  • size: 18,064 kB
  • sloc: asm: 20,492; ansic: 1,292; makefile: 68
file content (25 lines) | stat: -rw-r--r-- 807 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package params

// We put these parameters in a separate package so that the Go code,
// such as ntt_amd64_src.go, that generates assembler can import it.

const (
	SeedSize = 32
	N        = 256
	Q        = 8380417 // 2²³ - 2¹³ + 1
	QBits    = 23
	Qinv     = 4236238847 // = -(q^-1) mod 2³²
	ROver256 = 41978      // = (256)⁻¹ R² mod q, where R=2³²
	D        = 13

	// Size of T1 packed.  (Note that the formula is not valid in general,
	// but it is for the parameters used in the modes of Dilithium.)
	PolyT1Size = (N * (QBits - D)) / 8

	// Size of T0 packed.  (Note that the formula is not valid in general,
	// but it is for the parameters used in the modes of Dilithium.)
	PolyT0Size = (N * D) / 8

	// Size of a packed polynomial whose coefficients are in [0,16).
	PolyLe16Size = N / 2
)