Class XTS

java.lang.Object
org.h2.store.fs.encrypt.XTS

class XTS extends Object
An XTS implementation as described in IEEE P1619 (Standard Architecture for Encrypted Shared Storage Media). See also http://axelkenzo.ru/downloads/1619-2007-NIST-Submission.pdf
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final BlockCipher
     
    private static final int
    The AES encryption block size.
    private static final int
    Galois field feedback.
  • Constructor Summary

    Constructors
    Constructor
    Description
    XTS(BlockCipher cipher)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    decrypt(long id, int len, byte[] data, int offset)
    Decrypt the data.
    (package private) void
    encrypt(long id, int len, byte[] data, int offset)
    Encrypt the data.
    private byte[]
    initTweak(long id)
     
    private static void
    swap(byte[] data, int source, int target, int len)
     
    private static void
    updateTweak(byte[] tweak)
     
    private static void
    xorTweak(byte[] data, int pos, byte[] tweak)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GF_128_FEEDBACK

      private static final int GF_128_FEEDBACK
      Galois field feedback.
      See Also:
    • CIPHER_BLOCK_SIZE

      private static final int CIPHER_BLOCK_SIZE
      The AES encryption block size.
      See Also:
    • cipher

      private final BlockCipher cipher
  • Constructor Details

  • Method Details

    • encrypt

      void encrypt(long id, int len, byte[] data, int offset)
      Encrypt the data.
      Parameters:
      id - the (sector) id
      len - the number of bytes
      data - the data
      offset - the offset within the data
    • decrypt

      void decrypt(long id, int len, byte[] data, int offset)
      Decrypt the data.
      Parameters:
      id - the (sector) id
      len - the number of bytes
      data - the data
      offset - the offset within the data
    • initTweak

      private byte[] initTweak(long id)
    • xorTweak

      private static void xorTweak(byte[] data, int pos, byte[] tweak)
    • updateTweak

      private static void updateTweak(byte[] tweak)
    • swap

      private static void swap(byte[] data, int source, int target, int len)