-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PolicyTypeHash validation requires size check #206
Comments
Exact size check of ie,
|
Is 32 the recommended length because, in practice, these preimages are always 32-byte randomly-generated secrets? (Is there any atomic swap protocol that uses a different length secret?) I suppose there's little point in making in variable-size, since you can always hash the preimage twice -- that is, you can always hash a preimage to get an exactly-32-byte preimage for use with |
Yes, exactly. Thanks for the prompt fix. |
core/types/policy.go
Line 155 in 0f61e58
An additional check on the size of the preimage must be performed in this case.
I recommend checking that the preimage is 32 bytes. Technically you can support preimages less than 32 bytes, but there is no practical use for this.
See:
https://gist.github.com/markblundeberg/7a932c98179de2190049f5823907c016
The text was updated successfully, but these errors were encountered: