Subject: [Cfrg] draft-fluhrer-lms-more-parm-sets-01

From: Russ Housley <[email-masked]>
Date: Thu, 23 Apr 2020 15:01:18 -0400

Scott:

Thanks for your talk on this draft yesterday.  It raised a few questions.

1) SHA256-192:  I like it.  Does the size of I change?  My guess is that it is still 16 bytes, but I want to be sure.

2) SHAKE256-256 and SHAKE256-192:  Why use an Extendable-Output Function (XOF)?  Since the output in the application is always 256 bits or 192 bits, the normal reason for picking an XOF does not seem relevant.

3) Temporary code points: Why do you have collisions?  For example, LMOTS_SHA256_N24_W1 and LMS_SHA256_M24_H5 are the same, and RFC 8554 avoided overlaps between LMS and LMOTS code points.

Russ

---

From: "Blumenthal, Uri - 0553 - MITLL" <[email-masked]>
Date: Thu, 23 Apr 2020 19:42:07 +0000

On 4/23/20, 15:03, "Cfrg on behalf of Russ Housley" <[email-masked] on behalf of [email-masked]> wrote:

> 2) SHAKE256-256 and SHAKE256-192:  Why use an Extendable-Output
> Function (XOF)? 

Because it's pseudorandom by provable design rather than conjecture (like in case of SHA-1 and SHA-2)?

> Since the output in the application is always 256 bits or 192 bits, the normal reason
> for picking an XOF does not seem relevant.

There are no reasons NOT to, either.

---

From: Russ Housley <[email-masked]>
Date: Thu, 23 Apr 2020 16:21:19 -0400

> On Apr 23, 2020, at 3:42 PM, Blumenthal, Uri - 0553 - MITLL <[email-masked]> wrote:
> 

I think that is true for SHA3-256, which has the fixed size output.

> There are no reasons NOT to, either.

FIPS 202, Appendix A seems to offer some warning in this direction.

Russ

---

From: "Scott Fluhrer (sfluhrer)" <[email-masked]>
Date: Thu, 23 Apr 2020 21:18:08 +0000

> -----Original Message-----
> From: Russ Housley <[email-masked]>
> Sent: Thursday, April 23, 2020 3:01 PM
> To: Scott Fluhrer (sfluhrer) <[email-masked]>
> Cc: IRTF CFRG <[email-masked]>
> Subject: draft-fluhrer-lms-more-parm-sets-01
> 
> Scott:
> 

The size of I remains at 16 bytes.  The reason I is there is to address potential multitarget attacks; that is, where someone attacks two different public keys by hashing a single value and seeing if it matched a value from either Merkle tree/Winternitz chain.  Because two different public keys will have different I values, this doesn't yield an advantage (as the attempted hash will need to select a specific I value.

This protection doesn't have anything to do with the hash size, and so it does not change.

> Function (XOF)?  Since the output in the application is always 256 bits or 192
> bits, the normal reason for picking an XOF does not seem relevant.

That's actually a Dang question; he suggested we add it, so I copied him.

On the other hand, SHAKE256 and SHA3-256 are almost the same (differing only in the end-of-message padding), and so I don't believe it really matters.

> 
> 3) Temporary code points: Why do you have collisions?  For example,
> LMOTS_SHA256_N24_W1 and LMS_SHA256_M24_H5 are the same, and RFC
> 8554 avoided overlaps between LMS and LMOTS code points.

They're not a collision; they are in different spaces  The fact that RFC 8554 happened to avoid collisions is just an accident of history (originally, that draft defined 128 bit hashes as well, and the LMSOT code points for 128 bits hashes came after the 256 bit hashes, and the LMS code points for 128 bit hashes came first.  We dropped the 128 bit hashes, but left the 256 bit code points unchanged, resulting in the current assignments.

---

From: Russ Housley <[email-masked]>
Date: Thu, 23 Apr 2020 17:23:35 -0400

Thanks for the prompt reply Scott.

> On Apr 23, 2020, at 5:18 PM, Scott Fluhrer (sfluhrer) <[email-masked]> wrote:
> 

Thanks.  This is as I expected.

> On the other hand, SHAKE256 and SHA3-256 are almost the same (differing only in the end-of-message padding), and so I don't believe it really matters.

Yes, you are obviously correct about the extra suffix bits, and I look forward to hearing from Quynh.

> They're not a collision; they are in different spaces  The fact that RFC 8554 happened to avoid collisions is just an accident of history (originally, that draft defined 128 bit hashes as well, and…

Okay.

Russ

---

From: "Blumenthal, Uri - 0553 - MITLL" <[email-masked]>
Date: Thu, 23 Apr 2020 22:05:35 +0000

On 4/23/20, 16:22, "Russ Housley" <[email-masked]> wrote:
    >> Because it's pseudorandom by provable design rather than 
    >> conjecture (like in case of SHA-1 and SHA-2)?
    >

Yes it is, for sure. 

Remind me, please - are they equivalent performance-wise?
    
    > FIPS 202, Appendix A seems to offer some warning in this direction.
    
I didn't see any relevant reason there. What did you have in mind? The possibility of different-length outputs matching in prefix?

---

From: "Dang, Quynh H. (Fed)" <[email-masked]>
Date: Fri, 24 Apr 2020 10:52:31 +0000

Hi Russ and all,

The reasons for specifying SHAKE256/256 and SHAKE256/192 are followings:

1) SHA3-256 and SHAKE256/256 are the same except different paddings to make them different functions.

2) If we use SHA3-256, then we would use SHA3-256/192 or SHAKE256/192 for the 192-bit version. SHA3-256 (or SHA3-512 etc...) is intended to be used as a fixed output length hash function. Therefore, it makes more sense to use SHAKE256/192 than to use SHA3-256/192.

So, it makes more sense to use SHAKE256/256 and SHAKE256/192 than to use SHA3-256 and SHAKE256/192.

3) SHAKE256 has already been adopted for CMS and PKIX. So, it makes more sense to continue to use SHAKE256 than to use another variant of it such as SHA3-256.

Regards,
Quynh.
________________________________
From: Russ Housley <[email-masked]>
Sent: Thursday, April 23, 2020 5:23 PM
To: Scott Fluhrer <[email-masked]>
Cc: Dang, Quynh H. (Fed) <[email-masked]>; IRTF CFRG <[email-masked]>
Subject: Re: draft-fluhrer-lms-more-parm-sets-01

Okay.

Russ

---

From: Russ Housley <[email-masked]>
Date: Fri, 24 Apr 2020 10:17:29 -0400

Quynh:

I do not understand number 2.  Can you please say more?  I think it makes sense if the output is greater than the size of the hash function, but exactly the same or less.

The difference it primarily the padding at the end of the message:

	SHA3-256(M) = KECCAK[512](M || 01, 256)
	SHAKE256(M, d) = KECCAK[512](M || 1111, d)

This answers Uri's question about the performance.  They are essentially the same.

Russ

> On Apr 24, 2020, at 6:52 AM, Dang, Quynh H. (Fed) <quynh.dang=[email-masked]> wrote:
> 
> Hi Russ and all,
> 
> From: Russ Housley <[email-masked] <mailto:[email-masked]>>
> To: Scott Fluhrer <[email-masked] <mailto:[email-masked]>>
> Cc: Dang, Quynh H. (Fed) <[email-masked] <mailto:[email-masked]>>; IRTF CFRG <[email-masked] <mailto:[email-masked]>>
> > On Apr 23, 2020, at 5:18 PM, Scott Fluhrer (sfluhrer) <[email-masked] <mailto:[email-masked]>> wrote:
> > 
> >> From: Russ Housley <[email-masked] <mailto:[email-masked]>>
> >> To: Scott Fluhrer (sfluhrer) <[email-masked] <mailto:[email-masked]>>
> >> Cc: IRTF CFRG <[email-masked] <mailto:[email-masked]>>
> _______________________________________________
> Cfrg mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.irtf.org/mailman/listinfo/cfrg <https://www.irtf.org/mailman/listinfo/cfrg>

---

From: "Dang, Quynh H. (Fed)" <[email-masked]>
Date: Fri, 24 Apr 2020 16:44:30 +0000

Hi Russ,

If you use SHA3-256 to get a 192-bit version, you will need to run SHA3-256 (output is 256 bits), then do a truncation step to get a 192-bit value. With SHAKE256/192, you just run SHAKE256 with the output being 192 bits; there is no extra truncation step needed.

SHA3-256 is intended for being used as a fixed output length hash function.

Therefore, SHAKE256/192 makes more sense than SHA3-256 with an additional truncation step to get a 192-bit output.

So, (SHAKE256/192 + SHAKE256/256) makes more sense than both of these options: (SHA3-256 + SHA3-256/192) and (SHA3-256 + SHAKE256/192).

Regards,
Quynh.

Regards,
Quynh.

________________________________
From: Russ Housley <[email-masked]>
Sent: Friday, April 24, 2020 10:17 AM
To: Dang, Quynh H. (Fed) <[email-masked]>
Cc: Scott Fluhrer <[email-masked]>; IRTF CFRG <[email-masked]>
Subject: Re: [Cfrg] draft-fluhrer-lms-more-parm-sets-01

Quynh:

Russ

On Apr 24, 2020, at 6:52 AM, Dang, Quynh H. (Fed) <quynh.dang=[email-masked]<mailto:quynh.dang=[email-masked]>> wrote:

Hi Russ and all,

Regards,
Quynh.
________________________________
From: Russ Housley <[email-masked]<mailto:[email-masked]>>
Sent: Thursday, April 23, 2020 5:23 PM
To: Scott Fluhrer <[email-masked]<mailto:[email-masked]>>
Cc: Dang, Quynh H. (Fed) <[email-masked]<mailto:[email-masked]>>; IRTF CFRG <[email-masked]<mailto:[email-masked]>>
Subject: Re: draft-fluhrer-lms-more-parm-sets-01

> On Apr 23, 2020, at 5:18 PM, Scott Fluhrer (sfluhrer) <[email-masked]<mailto:[email-masked]>> wrote:
>
>> From: Russ Housley <[email-masked]<mailto:[email-masked]>>
>> To: Scott Fluhrer (sfluhrer) <[email-masked]<mailto:[email-masked]>>
>> Cc: IRTF CFRG <[email-masked]<mailto:[email-masked]>>

Okay.

Russ

_______________________________________________
Cfrg mailing list
[email-masked]<mailto:[email-masked]>
https://www.irtf.org/mailman/listinfo/cfrg<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.irtf.org%2Fmailman%2Flistinfo%2Fcfrg&data=02%7C01%7Cquynh.dang%40nist.gov%7C6ac7ab538a714decc34308d7e85a421f%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637233346677116474&sdata=y%2Blji5zAiSvjacp5HUpFWxHNG9PTX4RN%2F2w0Q0t53A8%3D&reserved=0>

---

From: Russ Housley <[email-masked]>
Date: Fri, 24 Apr 2020 14:24:34 -0400

Thanks.  I understand your argument, but I do not see truncation as a step.  At most, it is a memory copy.

Russ

> On Apr 24, 2020, at 12:44 PM, Dang, Quynh H. (Fed) <[email-masked]> wrote:
> 
> Hi Russ,
> 
> To: Dang, Quynh H. (Fed) <[email-masked] <mailto:[email-masked]>>
> Cc: Scott Fluhrer <[email-masked] <mailto:[email-masked]>>; IRTF CFRG <[email-masked] <mailto:[email-masked]>>
>> On Apr 24, 2020, at 6:52 AM, Dang, Quynh H. (Fed) <quynh.dang=[email-masked] <mailto:quynh.dang=[email-masked]>> wrote:
>> 
>> Hi Russ and all,
>> 
>> https://www.irtf.org/mailman/listinfo/cfrg <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.irtf.org%2Fmailman%2Flistinfo%2Fcfrg&data=02%7C01%7Cquynh.dang%40nist.gov%7C6ac7ab538a714decc34308d7e85a421f%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637233346677116474&sdata=y%2Blji5zAiSvjacp5HUpFWxHNG9PTX4RN%2F2w0Q0t53A8%3D&reserved=0>

---

From: Russ Housley <[email-masked]>
Date: Mon, 27 Apr 2020 06:35:47 -0400

Scott:

I have an additional question.  The analysis in Section 8 (Security Considerations) seems to assume the same hash algorithm is used throughout the LMS tree.  However, the LMS typecode could indicate one hash algorithm and the LMOTS typecode could indicate another.  Would it be an error if different hash algorithms are used in this manner?

Russ

> On Apr 23, 2020, at 3:01 PM, Russ Housley <[email-masked]> wrote:
> 
> Scott:
>