|
12 | 12 | //! |
13 | 13 | //! Simple usage (allocating, no associated data): |
14 | 14 | //! |
15 | | -#![cfg_attr(feature = "os_rng", doc = "```")] |
16 | | -#![cfg_attr(not(feature = "os_rng"), doc = "```ignore")] |
| 15 | +#![cfg_attr(feature = "getrandom", doc = "```")] |
| 16 | +#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")] |
17 | 17 | //! use aes_gcm::{ |
18 | 18 | //! aead::{Aead, AeadCore, KeyInit, rand_core::OsRng}, |
19 | 19 | //! Aes256Gcm, Nonce, Key // Or `Aes128Gcm` |
20 | 20 | //! }; |
21 | 21 | //! |
22 | 22 | //! # fn gen_key() -> Result<(), core::array::TryFromSliceError> { |
23 | 23 | //! // The encryption key can be generated randomly: |
24 | | -//! # #[cfg(feature = "os_rng")] { |
| 24 | +//! # #[cfg(feature = "getrandom")] { |
25 | 25 | //! let key = Aes256Gcm::generate_key().expect("generate key"); |
26 | 26 | //! # } |
27 | 27 | //! |
|
67 | 67 | //! It can then be passed as the `buffer` parameter to the in-place encrypt |
68 | 68 | //! and decrypt methods: |
69 | 69 | //! |
70 | | -#![cfg_attr(all(feature = "os_rng", feature = "arrayvec"), doc = "```")] |
71 | | -#![cfg_attr(not(all(feature = "os_rng", feature = "arrayvec")), doc = "```ignore")] |
| 70 | +#![cfg_attr(all(feature = "getrandom", feature = "arrayvec"), doc = "```")] |
| 71 | +#![cfg_attr( |
| 72 | + not(all(feature = "getrandom", feature = "arrayvec")), |
| 73 | + doc = "```ignore" |
| 74 | +)] |
72 | 75 | //! # fn main() -> Result<(), Box<dyn core::error::Error>> { |
73 | 76 | //! use aes_gcm::{ |
74 | 77 | //! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, arrayvec::ArrayVec}, |
|
0 commit comments