Closed Nothing4You closed 2 years ago
Good catch. Thanks for opening the issue. I've open a PR to fix this. Let me know if that would work for you, or if you have any questions.
Looks fine, thanks.
I'm curious though, is there a reason why you're not returning a std::result::Result
?
Thanks! I didn't use Result
for a couple of reasons:
1) even when the method returns Ok
, it does not mean the msg decrypted correctly.
2) I felt sometimes returning an empty value is simpler in API than returning a Result
. No unwrap()
, no a new Error
type, etc. When I used it at first myself, I felt it's easier, so I kept as is.
Hi,
according to the documentation,
Cipher::cbc_decrypt
should only panic wheniv
is less than 16 bytes. Other "unexpected errors" are supposed to return an emptyVec
instead.When providing an invalid input that is not aligned to 16 bytes it also panics: