fix: verify frame output size before sending to VDF verifier (#60)

This commit is contained in:
Cassandra Heart 2024-02-20 23:02:14 -06:00 committed by GitHub
parent a441e5455f
commit b681d489e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,6 +103,13 @@ func (w *WesolowskiFrameProver) VerifyMasterClockFrame(
) )
} }
if len(frame.Output) != 516 {
return errors.Wrap(
errors.New("invalid output"),
"verify clock frame",
)
}
b := sha3.Sum256(input) b := sha3.Sum256(input)
v := vdf.New(frame.Difficulty, b) v := vdf.New(frame.Difficulty, b)
proof := [516]byte{} proof := [516]byte{}
@ -421,6 +428,13 @@ func (w *WesolowskiFrameProver) VerifyDataClockFrame(
) )
} }
if len(frame.Output) != 516 {
return errors.Wrap(
errors.New("invalid output"),
"verify clock frame",
)
}
b := sha3.Sum256(input) b := sha3.Sum256(input)
v := vdf.New(frame.Difficulty, b) v := vdf.New(frame.Difficulty, b)
proof := [516]byte{} proof := [516]byte{}