Add no_std flag to the chacha20-poly1205 crate

This commit is contained in:
Nick Johnson 2024-10-30 20:48:21 -07:00
parent 3c16ed05c9
commit 26ed97877b
3 changed files with 9 additions and 0 deletions

View File

@ -326,6 +326,7 @@ fn keystream_at_slice(key: Key, nonce: Nonce, count: u32, seek: usize) -> [u8; 6
#[cfg(test)] #[cfg(test)]
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
mod tests { mod tests {
use alloc::vec::Vec;
use hex::prelude::*; use hex::prelude::*;
use super::*; use super::*;

View File

@ -2,6 +2,12 @@
//! Combine the ChaCha20 stream cipher with the Poly1305 message authentication code //! Combine the ChaCha20 stream cipher with the Poly1305 message authentication code
//! to form an authenticated encryption with additional data (AEAD) algorithm. //! to form an authenticated encryption with additional data (AEAD) algorithm.
#![no_std]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
pub mod chacha20; pub mod chacha20;
pub mod poly1305; pub mod poly1305;
@ -143,6 +149,7 @@ fn encode_lengths(aad_len: u64, content_len: u64) -> [u8; 16] {
#[cfg(test)] #[cfg(test)]
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
mod tests { mod tests {
use alloc::vec::Vec;
use hex::prelude::*; use hex::prelude::*;
use super::*; use super::*;

View File

@ -223,6 +223,7 @@ fn _print_acc(num: &[u32; 5]) {
#[cfg(test)] #[cfg(test)]
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
mod tests { mod tests {
use alloc::vec::Vec;
use hex::prelude::*; use hex::prelude::*;
use super::*; use super::*;