Skip to content

Commit

Permalink
small fix in imports in the examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Khayam authored and Adam Khayam committed Apr 9, 2024
1 parent 9616715 commit 59beb8d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/encrypt.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use cosmian_cover_crypt::{
abe_policy::{AccessPolicy, Policy},
api::{Covercrypt, EncryptedHeader},
api::{Covercrypt, CovercryptKEM, EncryptedHeader, EncryptedHeaderEnc},
test_utils::policy,
MasterPublicKey, MasterSecretKey,
};
use cosmian_crypto_core::Aes256Gcm;

/// Generates a new USK and encrypted header and prints them.
fn generate_new(
Expand All @@ -13,10 +14,11 @@ fn generate_new(
mpk: &MasterPublicKey,
) {
let access_policy =
AccessPolicy::parse("Department::FIN && Security Level::Top Secret").unwrap();
"Department::FIN && Security Level::Top Secret";

let (_, _header) = EncryptedHeader::generate(cc, policy, mpk, &access_policy, None, None)
.expect("cannot encrypt header");
let (_, _header) =
EncryptedHeader::<Aes256Gcm>::generate(cc, policy, mpk, access_policy, None, None)
.expect("cannot encrypt header");

#[cfg(feature = "serialization")]
{
Expand Down Expand Up @@ -60,7 +62,7 @@ fn main() {

// Encrypt header, use loop to increase its wight in the flame graph.
for _ in 0..1000 {
EncryptedHeader::generate(&cc, &policy, &mpk, &ap, None, None)
EncryptedHeader::<Aes256Gcm>::generate(&cc, &policy, &mpk, &ap, None, None)
.expect("cannot encrypt header");
}
}

0 comments on commit 59beb8d

Please sign in to comment.