changes
All checks were successful
CI / ci (push) Successful in 19m38s

This commit is contained in:
2026-08-26 20:55:30 +02:00
parent a557c183e9
commit 23d052278a
523 changed files with 24448 additions and 2005 deletions

View File

@@ -0,0 +1,18 @@
use crate::errors::DomainError;
use crate::provider::{CredentialCipher, EncryptedCredential};
const MASK: u8 = 0x5a;
pub struct FakeCredentialCipher;
impl CredentialCipher for FakeCredentialCipher {
fn encrypt(&self, plaintext: &[u8]) -> Result<EncryptedCredential, DomainError> {
Ok(EncryptedCredential::from_persistence(
plaintext.iter().map(|byte| byte ^ MASK).collect(),
))
}
fn decrypt(&self, credential: &EncryptedCredential) -> Result<Vec<u8>, DomainError> {
Ok(credential.value().iter().map(|byte| byte ^ MASK).collect())
}
}