Skip to content

XTS upper bound assertion is wrong #8

@jdanders

Description

@jdanders

On line 454 of blockcipher.py, the assertion:

assert len(data) < 128*pow(2,20)

should be

assert len(data) < 16*pow(2,20)

The NIST recommendation reads:

The length of the data unit for any instance of an implementation of XTS-AES shall not exceed
2^20 AES blocks

An AES block is 16 bytes, or 128 bits, and the data in the code at this point is bytes, not bits, so the number 16 should be used, not 128. Or even better, a constant AES_BLK_BYTES should be created with the value of 16, and all the 16's in this section could be replaced with that constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions