hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

`decrypt_should_fail` spurious failure #4994

Closed mversic closed 1 month ago

mversic commented 2 months ago

This test seems to fail spuriously:

---- encryption::chacha20poly1305::tests::decrypt_should_fail stdout ----
thread 'encryption::chacha20poly1305::tests::decrypt_should_fail' panicked at crypto/src/encryption/chacha20poly1305.rs:111:48:
called `Result::unwrap_err()` on an `Ok` value: [72, 101, 108, 108, 111, 32, 97, 110, 100, 32, 71, 111, 111, 100, 98, 121, 101, 33]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
DCNick3 commented 1 month ago

The problematic code is here. When ciphertext[1] is 0 the XOR doesn't do anything to the ciphertext[0] and the message turns out to be unexpectedly not corrupted.