Closed chris-wood closed 2 years ago
@armfazh @bytemare: reference implementation and test vectors updated!
We can avoid the counter overflows by using an iterated hashing instead. what about something like this?
1. T = 000000
2. contextString = CreateContextString(mode, suiteID)
3. deriveInput = seed || I2OSP(len(info), 2) || info
4. MSG = deriveInput || T
5. DST = "DeriveKeyPair" || contextString
6. skS = GG.HashToScalar(MSG, DST)
7. if skS == 0
8. T = Hash(T)
9. return to Step 4.
A. pks = ScalarBaseMult(skS)
B. return (skS,pkS).
We can avoid the counter overflows by using an iterated hashing instead.
Probability of counter overflow is negligible, so I don't think we need to be overly clever with the construction here. It seems best to match key generation routines used for other algorithms like HPKE. I suggest we stick with what's here in this PR, and file this iterated hash variant as an issue to possibly do later on.
Closes #306.
Rendered version of this PR
cc @bytemare, @kevinlewi, @tomrist