|
11 | 11 | //! |
12 | 12 | //! Simple usage (allocating, no associated data): |
13 | 13 | //! |
14 | | -#![cfg_attr(all(feature = "getrandom", feature = "std"), doc = "```")] |
15 | | -#![cfg_attr(not(all(feature = "getrandom", feature = "std")), doc = "```ignore")] |
| 14 | +#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] |
| 15 | +#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] |
16 | 16 | //! # fn main() -> Result<(), Box<dyn std::error::Error>> { |
17 | 17 | //! use belt_dwp::{ |
18 | 18 | //! aead::{Aead, AeadCore, KeyInit, OsRng}, |
|
44 | 44 | //! which can then be passed as the `buffer` parameter to the in-place encrypt |
45 | 45 | //! and decrypt methods: |
46 | 46 | //! |
47 | | -#![cfg_attr( |
48 | | - all(feature = "getrandom", feature = "heapless", feature = "std"), |
49 | | - doc = "```" |
50 | | -)] |
51 | | -#![cfg_attr( |
52 | | - not(all(feature = "getrandom", feature = "heapless", feature = "std")), |
53 | | - doc = "```ignore" |
54 | | -)] |
| 47 | +#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] |
| 48 | +#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] |
55 | 49 | //! # fn main() -> Result<(), Box<dyn std::error::Error>> { |
56 | 50 | //! use belt_dwp::{ |
57 | | -//! aead::{AeadInPlace, KeyInit, OsRng, heapless::Vec}, |
| 51 | +//! aead::{AeadInPlaceDetached, KeyInit, OsRng, heapless::Vec}, |
58 | 52 | //! BeltDwp, Nonce |
59 | 53 | //! }; |
60 | 54 | //! |
|
82 | 76 | //! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as |
83 | 77 | //! [`aead::arrayvec::ArrayVec`]). |
84 | 78 |
|
85 | | -use aead::consts::{U0, U16, U32, U8}; |
| 79 | +use aead::consts::{U16, U32, U8}; |
| 80 | +use aead::AeadInPlaceDetached; |
86 | 81 | pub use aead::{self, AeadCore, AeadInPlace, Error, Key, KeyInit, KeySizeUser}; |
87 | | - |
88 | 82 | use belt_block::cipher::{Block, BlockCipherEncrypt, KeyIvInit, StreamCipher}; |
89 | 83 | use belt_block::{belt_block_raw, BeltBlock}; |
90 | 84 | use belt_ctr::BeltCtr; |
@@ -118,7 +112,7 @@ impl KeySizeUser for BeltDwp { |
118 | 112 | type KeySize = U32; |
119 | 113 | } |
120 | 114 |
|
121 | | -impl AeadInPlace for BeltDwp { |
| 115 | +impl AeadInPlaceDetached for BeltDwp { |
122 | 116 | fn encrypt_in_place_detached( |
123 | 117 | &self, |
124 | 118 | nonce: &Nonce, |
@@ -254,7 +248,6 @@ impl KeyInit for BeltDwp { |
254 | 248 | impl AeadCore for BeltDwp { |
255 | 249 | type NonceSize = U16; |
256 | 250 | type TagSize = U8; |
257 | | - type CiphertextOverhead = U0; |
258 | 251 | } |
259 | 252 |
|
260 | 253 | /// Get the sizes block for the GHASH |
|
0 commit comments