Skip to content

Commit

Permalink
Remove needless 0 check.
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Sep 27, 2023
1 parent 7fc70c1 commit dd0945a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions galois.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ var logTable = [fieldSize]byte{

/**
* Inverse of the logarithm table. Maps integer logarithms
* to members of the field. There is no entry for 255
* because the highest log is 254.
* to members of the field. Entry 255 is the same as entry 0 sue to mod 255.
*
* This table was generated by `go run gentables.go`
* Table has been truncated to 256 bytes, since no lookups are bigger.
Expand Down Expand Up @@ -892,10 +891,7 @@ func galOneOver(a byte) byte {
if a == 0 {
panic("Argument 'divisor' is 0")
}
logResult := logTable[a]
if logResult != 0 {
logResult ^= 255
}
logResult := logTable[a] ^ 255
return expTable[logResult]
}

Expand Down

0 comments on commit dd0945a

Please sign in to comment.