Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

ff3: fix maxLen calculation #33

Open
anitgandhi opened this issue Feb 10, 2021 · 0 comments
Open

ff3: fix maxLen calculation #33

anitgandhi opened this issue Feb 10, 2021 · 0 comments

Comments

@anitgandhi
Copy link
Contributor

maxLen is incorrectly being calculated by moving the multiplication by 2 into the floor, whereas the spec calls for the multiplication to happen outside (after) the flooring.

This causes the bug referenced later in Encrypt, where the length of the input, n, is not allowed to be equal to maxLen, whereas it is allowed in the spec.

fpe/ff3/ff3.go

Line 87 in e6bfa0d

maxLen := uint32(math.Floor((192 / math.Log2(float64(radix)))))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant