-
Notifications
You must be signed in to change notification settings - Fork 0
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
make secretbox methods return nullable #102
Conversation
this matches the actual api contract of the underlying tweetnacl java implementation
TweetNaclFast.SecretBox(secretKey).box(message, nonce) | ||
|
||
override fun open(box: ByteArray, nonce: ByteArray): ByteArray = | ||
override fun open(box: ByteArray, nonce: ByteArray): ByteArray? = | ||
TweetNaclFast.SecretBox(secretKey).open(box, nonce) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this throw instead of returning null ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can runCatching getOrNull here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally with some logger 👀 :¯_(ツ)_/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. It was throwing nullpointer exception with the result being null 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry the nope was at the throw comment 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a library, I think the functionality should be minimal. I'm doing all those things in the app
this matches the actual api contract of the underlying tweetnacl java implementation