API change: pass the data after the context

This commit is contained in:
Rodolphe Bréard 2024-03-24 09:25:27 +01:00
parent c62029ee91
commit 90c8a2aa87
3 changed files with 15 additions and 15 deletions

View file

@ -13,7 +13,7 @@ fn decrypt_coffio(ikml: &str, input: &str) {
let key_ctx = KeyContext::from(KEY_CTX);
let data_ctx = DataContext::from(DATA_CTX);
let cb = CipherBox::new(&ikm);
if let Err(e) = cb.decrypt(&key_ctx, input, &data_ctx) {
if let Err(e) = cb.decrypt(&key_ctx, &data_ctx, input) {
assert!(false, "{e}");
}
}

View file

@ -10,7 +10,7 @@ fn encrypt_coffio(ikml: &str, input: &str) {
let key_ctx = KeyContext::from(KEY_CTX);
let data_ctx = DataContext::from(DATA_CTX);
let cb = CipherBox::new(&ikm);
if let Err(e) = cb.encrypt(&key_ctx, input, &data_ctx) {
if let Err(e) = cb.encrypt(&key_ctx, &data_ctx, input) {
assert!(false, "{e}");
}
}