Skip to content
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

One downside of a verify that returns a bool is that you can forget to call it. One way to mitigate this (until we get Linear Haskell 😄) is to fuse deserialization of the message with verification, something like #24

Open
arianvp opened this issue Jun 28, 2020 · 0 comments

Comments

@arianvp
Copy link
Owner

arianvp commented Jun 28, 2020

One downside of a verify that returns a bool is that you can forget to call it. One way to mitigate this (until we get Linear Haskell 😄) is to fuse deserialization of the message with verification, something like

verifyAndDecode :: PublicKey -> Message ByteString -> Signature -> Maybe DecodedMessage

is there a sensible decode operation for the message to do this with?

A different option would be to return some kind of validity token of which the constructor is not exposed, and to have remaining functions take such a token as input.

Originally posted by @ruuda in #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant