Skip to content

Commit 8f66bf3

Browse files
Merge pull request #58 from japaric/no-std-rust-crypto
no-std-ify hpke-rs-rust-crypto (some more)
2 parents 2af956e + 8dc6ad6 commit 8f66bf3

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::{
@@ -163,7 +167,7 @@ impl HpkeCrypto for HpkeRustCrypto {
163167
fn prng() -> Self::HpkePrng {
164168
#[cfg(feature = "deterministic-prng")]
165169
{
166-
let mut fake_rng = vec![0u8; 256];
170+
let mut fake_rng = alloc::vec![0u8; 256];
167171
rand_chacha::ChaCha20Rng::from_entropy().fill_bytes(&mut fake_rng);
168172
HpkeRustCryptoPrng {
169173
fake_rng,

0 commit comments

Comments
 (0)