Git Product home page Git Product logo

hctr2's Introduction

HCTR2

HCTR2 is a length-preserving encryption mode that is efficient on processors with instructions to accelerate AES and carryless multiplication, e.g. x86 processors with AES-NI and CLMUL, and ARM processors with the ARMv8 Crypto Extensions.

Usually, the right mode to use for encryption is a mode like AES-GCM or AES-GCM-SIV which includes a tag as well as a fresh nonce. However there are some applications, such as disk encryption, where the ciphertext must be the same size as the plaintext and there is no room for such information. For disk encryption, AES-XTS is often used, but it operates on each block of the plaintext independently, so changes to a given plaintext block affect only the corresponding ciphertext block and vice versa, revealing more information to the attacker than necessary. HCTR2 is a tweakable super-pseudorandom permutation: any change to the plaintext will result in an unrecognizably different ciphertext and vice versa.

For more information, see the HCTR2 paper.

File layout

  • paper/: LaTeX sources for our paper presenting HCTR2
  • test_vectors/other/: Test vectors we use to validate our implementations of other primitives
  • test_vectors/ours/: Test vectors we generate, in JSON format
  • python/: Python implementation and test vector generation
  • benchmark/: C implementation and benchmarking code
  • third_party/: derived works covered by a different license than our main MIT license

Notices

third_party/ includes derived works not covered by the MIT license; specifically software derived from the Linux kernel and licensed under GPLv2.

We include here a variety of algorithms and implementations; we make no guarantee they are suitable for production use.

This is not an officially supported Google product.

hctr2's People

Contributors

ciphergoth avatar ebiggers avatar nhukc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

doytsujin

hctr2's Issues

Linux test vectors: assign key length, message size, tweak size randomly

@ebiggers writes:

This PR makes it so that there are two test vectors per message size per key size, so 6 total per message size. Maybe cut that down to 1 per message size per key size, so 3 total per message size? Or even less and just assign key sizes randomly.

not very effective to have 2 test vectors per message length per key length. Problems are more likely to arise for different length inputs, not for different input contents. The xctr test vectors are especially odd, as they only test 32 and 255-byte messages, but have 6 test vectors for each length. We could get better test coverage in the same number (or fewer) of test vectors by focusing on different lengths rather than different contents.

Fix variable types and remove casts

Make variable types consistent and sensible. Remove extraneous casting.

Swap aligned field elements to be128 or ble128 depending on which field they're in. Arbitrary buffers should just be u8 arrays.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.