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

ff3: fix maxLen calculation #33

@anitgandhi

Description

@anitgandhi

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)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions