Package org.h2.store.fs.encrypt
Class XTS
java.lang.Object
org.h2.store.fs.encrypt.XTS
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
FieldsModifier and TypeFieldDescriptionprivate final BlockCipher
private static final int
The AES encryption block size.private static final int
Galois field feedback. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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)
-
Field Details
-
GF_128_FEEDBACK
private static final int GF_128_FEEDBACKGalois field feedback.- See Also:
-
CIPHER_BLOCK_SIZE
private static final int CIPHER_BLOCK_SIZEThe AES encryption block size.- See Also:
-
cipher
-
-
Constructor Details
-
XTS
XTS(BlockCipher cipher)
-
-
Method Details
-
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)
-