I intend to use Crypto++ XTS-AES for encrypting data. I tested XTS-AES with the following NIST vector and got an unexpected CT= 54a8629d76db46d0c516fca52c9c903baa3a635ddd56f09760f63252c8b46140 .I call the following function:XTS_Mode< AES >::Encryption e;e.SetKeyWithIV(in_key, KeySize, in_iv, IVSize);StringSource(in_plain_txt,svSize(plain_txt, 1),true,new StreamTransformationFilter(e,new StringSink(cipher),StreamTransformationFilter::NO_PADDING) // StreamTransformationFilter); // StringSourceMy questions:
- Does Crypto++ XTS-AES not support non-byte aligned data encryption and decryption
Thank you for your reply.
All test vector in https://github.com/weidai11/cryptopp/blob/master/TestVectors/xts.txt. are byte-aligned . I've tested these vectors locally, and they're all pass. But it doesn't have a non-byte-aligned vector like datalen=250bit in https://github.com/weidai11/cryptopp/blob/master/TestVectors/xts.txt. We can found non-byte-aligned vector in https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/CAVP-TESTING-BLOCK-CIPHER-MODES#XTS . All byte-aligned vector in https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/CAVP-TESTING-BLOCK-CIPHER-MODES#XTS can pass, but all non-byte-aligned vector are fail.