[openssl-dev] [openssl.org #4500] Testing cipher AES-128-XTS(encrypt/decrypt) failure

Dr. Pala director at openca.org
Thu Apr 7 16:46:09 UTC 2016


Hi Paul,

I have not checked the code for the test, but I do get the expected 
values with my little test program. Here's the dump (key and iv set to 0 
- block size is 32 bytes (i.e. 2 * 128bit units)):

    AES XTS Encrypt:
    ----------------

    Plaintext (32):
    0020 - <SPACES/NULS>

    Ciphertext 32:
    0000 - 91 7c f6 9e bd 68 b2 ec-9b 9f e9 a3 ea dd a6 92 .|...h..........
    0010 - cd 43 d2 f5 95 98 ed 85-8c 02 c2 65 2f bf 92 2e .C.........e/...

    AES XTS Decrypt:
    ----------------

    Encrypted Data:
    0000 - 91 7c f6 9e bd 68 b2 ec-9b 9f e9 a3 ea dd a6 92 .|...h..........
    0010 - cd 43 d2 f5 95 98 ed 85-8c 02 c2 65 2f bf 92 2e .C.........e/...

    Decrypt Offset: 0
    Original Start: 0
    Throw Away: 0

    Clear Text 32:
    0020 - <SPACES/NULS>

My guess is that the second part of the key is not all zeros - this 
would cause you to get the first part of the message encrypted correctly 
and the second part not having the good values... this is just my guess, 
of course.

Cheers,
Max


On 4/6/16 11:03 PM, Paul Dembry via RT wrote:
> OpenSSL: Version 1.0.2g
>
> OS: Linux tri26 3.0.13-0.27-default #1 SMP Wed Feb 15 13:33:49 UTC 2012
> (d73692b) s390x s390x s390x GNU/Linux
>
> Hardware: Hercules 3.11 emulator, running on Linux rad5 2.6.18.2-34-default
> #1 SMP Mon Nov 27 11:46:27 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
>
>   
>
> make test
>
>   
>
> Testing cipher AES-128-XTS(encrypt/decrypt)
>
> Key
>
> 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> 0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> IV
>
> 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> Plaintext
>
> 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> 0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> Ciphertext
>
> 0000 91 7c f6 9e bd 68 b2 ec 9b 9f e9 a3 ea dd a6 92
>
> 0010 cd 43 d2 f5 95 98 ed 85 8c 02 c2 65 2f bf 92 2e
>
> Ciphertext mismatch
>
> Got
>
> 0000 91 7c f6 9e bd 68 b2 ec 9b 9f e9 a3 ea dd a6 92
>
> 0010 89 36 96 08 51 3b fa 4f 4e 41 fd cf 81 18 01 b4
>
> Expected
>
> 0000 91 7c f6 9e bd 68 b2 ec 9b 9f e9 a3 ea dd a6 92
>
> 0010 cd 43 d2 f5 95 98 ed 85 8c 02 c2 65 2f bf 92 2e
>
> make[1]: *** [test_evp] Error 9
>
> make[1]: Leaving directory `/usr4/tmp/openssl-1.0.2g/test'
>
> make: *** [tests] Error 2
>
>   
>
> Regards,
>
> Paul
>
>


-- 
Massimiliano Pala, PhD
Director at OpenCA Labs
twitter: @openca

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160407/80823a19/attachment.html>


More information about the openssl-dev mailing list