Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-std-ify hpke-rs-rust-crypto (some more) #58

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rust_crypto_provider/src/aead.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use alloc::{format, vec::Vec};

use aes_gcm::{Aes128Gcm as RC_Aes128Gcm, Aes256Gcm as RC_Aes256Gcm};
use chacha20poly1305::{
aead::{Aead, KeyInit, Payload},
Expand Down
2 changes: 2 additions & 0 deletions rust_crypto_provider/src/hkdf.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use alloc::{vec, vec::Vec};

use hkdf::Hkdf;
use hpke_rs_crypto::error::Error;
use sha2::{Sha256, Sha384, Sha512};
Expand Down
6 changes: 5 additions & 1 deletion rust_crypto_provider/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#![doc = include_str!("../Readme.md")]
#![cfg_attr(not(test), no_std)]

extern crate alloc;

use alloc::{string::String, vec::Vec};
use core::fmt::Display;

use hpke_rs_crypto::{
Expand Down Expand Up @@ -161,7 +165,7 @@ impl HpkeCrypto for HpkeRustCrypto {
fn prng() -> Self::HpkePrng {
#[cfg(feature = "deterministic-prng")]
{
let mut fake_rng = vec![0u8; 256];
let mut fake_rng = alloc::vec![0u8; 256];
rand_chacha::ChaCha20Rng::from_entropy().fill_bytes(&mut fake_rng);
HpkeRustCryptoPrng {
fake_rng,
Expand Down
Loading