This shift rule does not correctly handle cases where the usize index into the vector will overflow negative upon subtraction.
Example code that replicates the issue:
extern crate cipher_crypt;
use cipher_crypt::{Cipher, Playfair};
fn main() {
let c = Playfair::new("APT".to_string()).unwrap();
let pt = "Hello World";
let ct = c.encrypt(pt).unwrap();
let _d = c.decrypt(&ct).unwrap();
}
The patch to fix this is ready. It includes a unit test for this condition. I can push to the same cipher/playfair branch and increment to 0.14.1 if that works, @arosspope .
https://github.com/arosspope/cipher-crypt/blob/aab6174944abe95ce9259aafaf74d901680bc562/src/playfair.rs#L115
This shift rule does not correctly handle cases where the
usize
index into the vector will overflow negative upon subtraction.Example code that replicates the issue:
The patch to fix this is ready. It includes a unit test for this condition. I can push to the same
cipher/playfair
branch and increment to0.14.1
if that works, @arosspope .