miscreant.rb
miscreant.rb copied to clipboard
Better error message for wrong encoding
Hi, thanks for this neat library! This improves the error message when the ciphertext has the wrong encoding. The current message is IV must be Encoding::BINARY
, which makes it seem like the nonce instead of the ciphertext.
3: from /Users/andrew/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/aead.rb:90:in `open'
2: from /Users/andrew/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/aes/siv.rb:71:in `open'
1: from /Users/andrew/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/internals/aes/ctr.rb:31:in `encrypt'
/Users/user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/internals/util.rb:64:in `validate_bytestring': IV must be Encoding::BINARY (ArgumentError)