You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #7693, ed448 verification doesn't check that s is less than the group order, allowing malleability for some signatures. Wycheproof doesn't have vectors for this yet, but I generated an example:
Hmmm. Something doesn't quite look right with this test. Either that or I'm doing something stupid (which is entirely possible). An ed448 signature is composed of a 57 byte point R and a 57 byte integer s. R comes first followed by s. So in your test code the value of s is:
ed448 encodes integers in little-endian order, so the most significant byte here is 0x00. s needs to be in the range 0 <= s < L. Where L is the group order and is a 57 byte integer with the most significat byte set to 0x3F. Therefore if s >= L as you claim then the most significant byte of s would have to be 0x3F or greater - and not 0x00 as in this test case.
Apparently even though s is defined to be 57 bytes long by the standard, the order L is in fact only 56 bytes long! So a valid value for s always ends in 0x00, and if s >=L then the two most significant bytes must be 0x003F or greater. Which it is in your test case (0x0075)
Activity
mattcaswell commentedon Dec 3, 2018
Hmmm. Something doesn't quite look right with this test. Either that or I'm doing something stupid (which is entirely possible). An ed448 signature is composed of a 57 byte point
Rand a 57 byte integers. R comes first followed bys. So in your test code the value ofsis:f30db6e54d5d1406d23378ffde11b1fb81b2b438a3b8e8aa7f7f4e1befcc905023fab5a5465053844f04cf0c1b51d84760f869588687f57500ed448 encodes integers in little-endian order, so the most significant byte here is
0x00.sneeds to be in the range 0 <= s < L. WhereLis the group order and is a 57 byte integer with the most significat byte set to0x3F. Therefore ifs >= Las you claim then the most significant byte ofswould have to be0x3For greater - and not0x00as in this test case.mattcaswell commentedon Dec 3, 2018
Yep. Me being stupid.
Apparently even though
sis defined to be 57 bytes long by the standard, the orderLis in fact only 56 bytes long! So a valid value forsalways ends in0x00, and ifs >=Lthen the two most significant bytes must be0x003For greater. Which it is in your test case (0x0075)mattcaswell commentedon Dec 3, 2018
Can you provide the equivalent valid sig?
mattcaswell commentedon Dec 3, 2018
Forget that...no longer needed.
mattcaswell commentedon Dec 3, 2018
Fix in #7748.
Disallow Ed448 signature malleability