Skip to content

Commit 23491bd

Browse files
committed
Adding generic Power2Round method.
1 parent 5da4a63 commit 23491bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sign/internal/dilithium/generic.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,11 @@ func (p *Poly) Exceeds(bound uint32) bool {
7979
func (p *Poly) MulBy2toD(q *Poly) {
8080
p.mulBy2toDGeneric(q)
8181
}
82+
83+
// Splits p into p1 and p0 such that [i]p1 * 2ᴰ + [i]p0 = [i]p
84+
// with -2ᴰ⁻¹ < [i]p0 ≤ 2ᴰ⁻¹. Returns p0 + Q and p1.
85+
//
86+
// Requires the coefficients of p to be normalized.
87+
func (p *Poly) Power2Round(p0PlusQ, p1 *Poly) {
88+
p.power2RoundGeneric(p0PlusQ, p1)
89+
}

0 commit comments

Comments
 (0)