Skip to content

Commit 8213fb9

Browse files
committed
cipher/hctr: add comments for hctrReductionTable
1 parent 2235808 commit 8213fb9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cipher/hctr.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ func hctrDouble(x *hctrFieldElement) (double hctrFieldElement) {
8787
return
8888
}
8989

90+
// hctrReductionTable is stored irreducible polynomial's double & add precomputed results.
91+
// 0000 - 0
92+
// 0001 - irreducible polynomial >> 3
93+
// 0010 - irreducible polynomial >> 2
94+
// 0011 - (irreducible polynomial >> 3 xor irreducible polynomial >> 2)
95+
// ...
96+
// 1000 - just the irreducible polynomial
9097
var hctrReductionTable = []uint16{
9198
0x0000, 0x1c20, 0x3840, 0x2460, 0x7080, 0x6ca0, 0x48c0, 0x54e0,
9299
0xe100, 0xfd20, 0xd940, 0xc560, 0x9180, 0x8da0, 0xa9c0, 0xb5e0,

0 commit comments

Comments
 (0)