Skip to content

Commit

Permalink
cipher/hctr: add comments for hctrReductionTable
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun committed Dec 4, 2023
1 parent 2235808 commit 8213fb9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cipher/hctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ func hctrDouble(x *hctrFieldElement) (double hctrFieldElement) {
return
}

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

0 comments on commit 8213fb9

Please sign in to comment.