1. 22 Dec, 2017 1 commit
  2. 03 Nov, 2017 1 commit
  3. 05 Apr, 2017 1 commit
    • Ondrej Mosnáček's avatar
      crypto: gf128mul - define gf128mul_x_* in gf128mul.h · acb9b159
      Ondrej Mosnáček authored
      The gf128mul_x_ble function is currently defined in gf128mul.c, because
      it depends on the gf128mul_table_be multiplication table.
      
      However, since the function is very small and only uses two values from
      the table, it is better for it to be defined as inline function in
      gf128mul.h. That way, the function can be inlined by the compiler for
      better performance.
      
      For consistency, the other gf128mul_x_* functions are also moved to the
      header file. In addition, the code is rewritten to be constant-time.
      
      After this change, the speed of the generic 'xts(aes)' implementation
      increased from ~225 MiB/s to ~235 MiB/s (measured using 'cryptsetup
      benchmark -c aes-xts-plain64' on an Intel system with CRYPTO_AES_X86_64
      and CRYPTO_AES_NI_INTEL disabled).
      Signed-off-by: 's avatarOndrej Mosnacek <omosnacek@gmail.com>
      Reviewd-by: 's avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: 's avatarHerbert Xu <herbert@gondor.apana.org.au>
      acb9b159
  4. 09 Mar, 2017 4 commits
  5. 17 Nov, 2016 1 commit
  6. 13 Nov, 2016 1 commit
  7. 08 Jul, 2011 1 commit
  8. 31 Mar, 2011 1 commit
  9. 04 Mar, 2009 1 commit
  10. 10 Oct, 2007 1 commit
  11. 07 Dec, 2006 1 commit
    • Rik Snel's avatar
      [CRYPTO] lib: table driven multiplications in GF(2^128) · c494e070
      Rik Snel authored
      A lot of cypher modes need multiplications in GF(2^128). LRW, ABL, GCM...
      I use functions from this library in my LRW implementation and I will
      also use them in my ABL (Arbitrary Block Length, an unencumbered (correct
      me if I am wrong, wide block cipher mode).
      
      Elements of GF(2^128) must be presented as u128 *, it encourages automatic
      and proper alignment.
      
      The library contains support for two different representations of GF(2^128),
      see the comment in gf128mul.h. There different levels of optimization
      (memory/speed tradeoff).
      
      The code is based on work by Dr Brian Gladman. Notable changes:
      - deletion of two optimization modes
      - change from u32 to u64 for faster handling on 64bit machines
      - support for 'bbe' representation in addition to the, already implemented,
        'lle' representation.
      - move 'inline void' functions from header to 'static void' in the
        source file
      - update to use the linux coding style conventions
      
      The original can be found at:
      http://fp.gladman.plus.com/AES/modes.vc8.19-06-06.zip
      
      The copyright (and GPL statement) of the original author is preserved.
      Signed-off-by: 's avatarRik Snel <rsnel@cube.dyndns.org>
      Signed-off-by: 's avatarHerbert Xu <herbert@gondor.apana.org.au>
      c494e070