Package org.h2.store.fs.encrypt
Class XTS
- java.lang.Object
-
- org.h2.store.fs.encrypt.XTS
-
class XTS extends java.lang.ObjectAn 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 BlockCiphercipherprivate static intCIPHER_BLOCK_SIZEThe AES encryption block size.private static intGF_128_FEEDBACKGalois field feedback.
-
Constructor Summary
Constructors Constructor Description XTS(BlockCipher cipher)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voiddecrypt(long id, int len, byte[] data, int offset)Decrypt the data.(package private) voidencrypt(long id, int len, byte[] data, int offset)Encrypt the data.private byte[]initTweak(long id)private static voidswap(byte[] data, int source, int target, int len)private static voidupdateTweak(byte[] tweak)private static voidxorTweak(byte[] data, int pos, byte[] tweak)
-
-
-
Field Detail
-
GF_128_FEEDBACK
private static final int GF_128_FEEDBACK
Galois field feedback.- See Also:
- Constant Field Values
-
CIPHER_BLOCK_SIZE
private static final int CIPHER_BLOCK_SIZE
The AES encryption block size.- See Also:
- Constant Field Values
-
cipher
private final BlockCipher cipher
-
-
Constructor Detail
-
XTS
XTS(BlockCipher cipher)
-
-
Method Detail
-
encrypt
void encrypt(long id, int len, byte[] data, int offset)Encrypt the data.- Parameters:
id- the (sector) idlen- the number of bytesdata- the dataoffset- the offset within the data
-
decrypt
void decrypt(long id, int len, byte[] data, int offset)Decrypt the data.- Parameters:
id- the (sector) idlen- the number of bytesdata- the dataoffset- 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)
-
-