-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
Line 115 in aab6174
| (v[(first - 1) % 5], v[(second - 1) % 5]) |
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 .
Reactions are currently unavailable