Closed mratsim closed 4 years ago
This PR changes 2 things:
it uses a DBIG_384 (double BIG_384) in to hold the raw bytes coming from HKDF-expand. Some of the raw outputs require more than 381-bit With a BIG the fromBytes procedure doesn't fail, the resulting BIG can be printed but calling norm or mod on it gives incorrect result and this creates an invalid secret key that causes stack smashing issues: https://github.com/status-im/nim-blscurve/issues/40#issuecomment-597573079, https://github.com/status-im/nim-beacon-chain/pull/780
In the process of debugging, I changed HKDF to use openarray thinking that the rootcause was hidden in some raw pointers
This PR changes 2 things:
it uses a DBIG_384 (double BIG_384) in to hold the raw bytes coming from HKDF-expand. Some of the raw outputs require more than 381-bit With a BIG the fromBytes procedure doesn't fail, the resulting BIG can be printed but calling norm or mod on it gives incorrect result and this creates an invalid secret key that causes stack smashing issues: https://github.com/status-im/nim-blscurve/issues/40#issuecomment-597573079, https://github.com/status-im/nim-beacon-chain/pull/780
In the process of debugging, I changed HKDF to use openarray thinking that the rootcause was hidden in some raw pointers