Skip to content

Commit

Permalink
fix(errors): use correct error variant for data encryption (#323)
Browse files Browse the repository at this point in the history
Based on #322

---------

Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan authored Oct 9, 2024
1 parent c03ca81 commit 460865b
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 98 deletions.
2 changes: 1 addition & 1 deletion crates/core/src/crypto/aespoly1305.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl CryptoKey for Key {
res.extend_from_slice(data);
let tag = Aes256CtrPoly1305Aes::new(&self.0)
.encrypt_in_place_detached(&nonce, &[], &mut res[16..])
.map_err(CryptoErrorKind::DataDecryptionFailed)?;
.map_err(CryptoErrorKind::DataEncryptionFailed)?;
res.extend_from_slice(&tag);
Ok(res)
}
Expand Down
Loading

0 comments on commit 460865b

Please sign in to comment.