2016-12-07 12:44:04

by Longpeng(Mike)

[permalink] [raw]
Subject: Question about ctr mode 3des-ede IV len

Hi Jussi and Herbert,

I saw serveral des3-ede testcases(in crypto/testmgr.h) has 16-bytes IV, and the
libgcrypt/nettle/RFC1851 said the IV-len is 8-bytes.

Would you please tell me why these testcases has 16-bytes IV ?

Thank you. :)

--
Regards,
Longpeng(Mike)


2016-12-08 09:04:40

by Herbert Xu

[permalink] [raw]
Subject: Re: Question about ctr mode 3des-ede IV len

On Wed, Dec 07, 2016 at 08:43:16PM +0800, Longpeng (Mike) wrote:
> Hi Jussi and Herbert,
>
> I saw serveral des3-ede testcases(in crypto/testmgr.h) has 16-bytes IV, and the
> libgcrypt/nettle/RFC1851 said the IV-len is 8-bytes.
>
> Would you please tell me why these testcases has 16-bytes IV ?

I think they were automatically generated. Only the first eight
bytes are actually used so the IV size is still 8.

Cheers,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2016-12-08 09:17:36

by Longpeng(Mike)

[permalink] [raw]
Subject: Re: Question about ctr mode 3des-ede IV len



On 2016/12/8 17:04, Herbert Xu wrote:

> On Wed, Dec 07, 2016 at 08:43:16PM +0800, Longpeng (Mike) wrote:
>> Hi Jussi and Herbert,
>>
>> I saw serveral des3-ede testcases(in crypto/testmgr.h) has 16-bytes IV, and the
>> libgcrypt/nettle/RFC1851 said the IV-len is 8-bytes.
>>
>> Would you please tell me why these testcases has 16-bytes IV ?
>
> I think they were automatically generated. Only the first eight
> bytes are actually used so the IV size is still 8.
>
> Cheers,


Cool, thank you very much! :)

--
Regards,
Longpeng(Mike)

2016-12-08 11:16:10

by Jussi Kivilinna

[permalink] [raw]
Subject: Re: Question about ctr mode 3des-ede IV len

Hello,

07.12.2016, 14:43, Longpeng (Mike) kirjoitti:
> Hi Jussi and Herbert,
>
> I saw serveral des3-ede testcases(in crypto/testmgr.h) has 16-bytes IV, and the
> libgcrypt/nettle/RFC1851 said the IV-len is 8-bytes.
>
> Would you please tell me why these testcases has 16-bytes IV ?

Because I used same tool to create test-vectors which I had previously used to create AES/Camellia/Serpent/Twofish test-vectors. So, I must have forgotten to change 16-byte IV generation to 8 bytes and thus those testcases in crypto/testmgr.h have wrong length. The extra trailing 8 bytes are not used and can be removed.

-Jussi

>
> Thank you. :)
>

2016-12-08 11:30:15

by Longpeng(Mike)

[permalink] [raw]
Subject: Re: Question about ctr mode 3des-ede IV len

Hi Jussi,

On 2016/12/7 21:15, Jussi Kivilinna wrote:

> Hello,
>
> 07.12.2016, 14:43, Longpeng (Mike) kirjoitti:
>> Hi Jussi and Herbert,
>>
>> I saw serveral des3-ede testcases(in crypto/testmgr.h) has 16-bytes IV, and the
>> libgcrypt/nettle/RFC1851 said the IV-len is 8-bytes.
>>
>> Would you please tell me why these testcases has 16-bytes IV ?
>
> Because I used same tool to create test-vectors which I had previously used to create AES/Camellia/Serpent/Twofish test-vectors. So, I must have forgotten to change 16-byte IV generation to 8 bytes and thus those testcases in crypto/testmgr.h have wrong length. The extra trailing 8 bytes are not used and can be removed.
>


Thank you very much. :)

> -Jussi
>
>>
>> Thank you. :)
>>
>
> .
>


--
Regards,
Longpeng(Mike)