Skip to content

Commit 8dc6ad6

Browse files
committed
switch from the core prelude to the std prelude
in preparation for no-std support
1 parent aae8d0a commit 8dc6ad6

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

rust_crypto_provider/src/aead.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use alloc::{format, vec::Vec};
2+
13
use aes_gcm::{Aes128Gcm as RC_Aes128Gcm, Aes256Gcm as RC_Aes256Gcm};
24
use chacha20poly1305::{
35
aead::{Aead, KeyInit, Payload},

rust_crypto_provider/src/hkdf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use alloc::{vec, vec::Vec};
2+
13
use hkdf::Hkdf;
24
use hpke_rs_crypto::error::Error;
35
use sha2::{Sha256, Sha384, Sha512};

rust_crypto_provider/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#![doc = include_str!("../Readme.md")]
2+
#![cfg_attr(not(test), no_std)]
23

4+
extern crate alloc;
5+
6+
use alloc::{string::String, vec::Vec};
37
use core::fmt::Display;
48

59
use hpke_rs_crypto::{
@@ -161,7 +165,7 @@ impl HpkeCrypto for HpkeRustCrypto {
161165
fn prng() -> Self::HpkePrng {
162166
#[cfg(feature = "deterministic-prng")]
163167
{
164-
let mut fake_rng = vec![0u8; 256];
168+
let mut fake_rng = alloc::vec![0u8; 256];
165169
rand_chacha::ChaCha20Rng::from_entropy().fill_bytes(&mut fake_rng);
166170
HpkeRustCryptoPrng {
167171
fake_rng,

0 commit comments

Comments
 (0)