TXTSCipherMode
XTS Cipher Mode.
A chaining mode for 128–bit block ciphers
Methods
Method Start:Int(cipher:TCipher, key1:Byte Ptr, key2:Byte Ptr, keylen:Int, numRounds:Int)
Initializes the cipher mode.
It requires two private keys (of equal length) to perform the encryption process.
Returns
CRYPT_OK if the cipher initialized correctly, otherwise, returns an error code.
Method Encrypt:Int(pt:Byte Ptr, ptlength:UInt, ct:Byte Ptr, tweak:Byte Ptr)
Encrypts the plaintext pt of length to ct.
Supports ciphertext stealing (blocks that are not multiples of 16 bytes).
The P1619 specification states the tweak for sector number shall be represented as a 128–bit little endian string.
Returns
CRYPT_OK on success.
Method Decrypt:Int(ct:Byte Ptr, ptlength:UInt, pt:Byte Ptr, tweak:Byte Ptr)
Decrypts the ciphertext ct of length to pt.
Supports ciphertext stealing (blocks that are not multiples of 16 bytes).
The P1619 specification states the tweak for sector number shall be represented as a 128–bit little endian string.
Returns
CRYPT_OK on success.
Method Done:Int()
Terminates the cipher stream.