Add no_std flag to the chacha20-poly1205 crate
This commit is contained in:
parent
3c16ed05c9
commit
26ed97877b
|
@ -326,6 +326,7 @@ fn keystream_at_slice(key: Key, nonce: Nonce, count: u32, seek: usize) -> [u8; 6
|
|||
#[cfg(test)]
|
||||
#[cfg(feature = "alloc")]
|
||||
mod tests {
|
||||
use alloc::vec::Vec;
|
||||
use hex::prelude::*;
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
//! Combine the ChaCha20 stream cipher with the Poly1305 message authentication code
|
||||
//! 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 poly1305;
|
||||
|
@ -143,6 +149,7 @@ fn encode_lengths(aad_len: u64, content_len: u64) -> [u8; 16] {
|
|||
#[cfg(test)]
|
||||
#[cfg(feature = "alloc")]
|
||||
mod tests {
|
||||
use alloc::vec::Vec;
|
||||
use hex::prelude::*;
|
||||
|
||||
use super::*;
|
||||
|
|
|
@ -223,6 +223,7 @@ fn _print_acc(num: &[u32; 5]) {
|
|||
#[cfg(test)]
|
||||
#[cfg(feature = "alloc")]
|
||||
mod tests {
|
||||
use alloc::vec::Vec;
|
||||
use hex::prelude::*;
|
||||
|
||||
use super::*;
|
||||
|
|
Loading…
Reference in New Issue