Closed Sai-Anudeep47 closed 1 year ago
The L2 value is also currently written as Little Endian and the bytes need to be reversed for Big Endian. This is in addition to the loop start with 1 vs 0.
func Sp800108CounterKDF(sizeBytes int, hmacAlg HashType, key []byte, contextRand []byte) ([]byte, error) { //this should be 1 vs 0 per spec for i := 1; i < n; i += 1 { mac.Write([]byte{byte(i)}) mac.Write([]byte(CONST_KDF_LABEL)) mac.Write([]byte{byte(0x00)}) // Separator mac.Write([]byte(CONST_KDF_CONTEXT)) mac.Write(contextRand)
Lbigend := []byte{byte((l & 0xff)), byte((l >> 8) & 0xff)}
// this should be reversed for big endian Lbigend := []byte{ byte((l >> 8) & 0xff),byte((l & 0xff))} mac.Write(Lbigend)
result = append(result, mac.Sum(nil)...)
mac.Reset()
}
return result[0:sizeBytes], nil
}
256 in Big endian to array is [1,0] 256 in Little endian to array is [0,1] (current output)
yes, you are correct @rftemple @Sai-Anudeep47!
To simplify issue resolution process, please provide network logs, and or test voucher.
What part of the spec are you testing?
What protocol are having issue with?
Issue description