Skip to content
  • Eric Biggers's avatar
    fs-verity: add CRC-32C support · a391d614
    Eric Biggers authored
    
    
    Add CRC-32C support to fs-verity, to provide a faster alternative to
    SHA-256 for users who want integrity-only (not authenticity), i.e. who
    want to detect only accidental corruption, not malicious changes.
    
    CRC-32C is chosen over CRC-32 because the CRC-32C polynomial is believed
    to provide slightly better error-detection properties; and CRC-32C is
    just as fast (or can be just as fast) as CRC-32, or even faster e.g. on
    some x86 processors that have a CRC-32C instruction but not CRC-32.
    
    We use "crc32c" from the crypto API, so the polynomial convention is
    bitwise little-endian, the digest is bytewise little-endian, and the CRC
    bits are inverted at the beginning and end (which is desirable).
    
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    a391d614