chacha20poly1305-0.10.1/.cargo_vcs_info.json0000644000000001560000000000100137030ustar { "git": { "sha1": "746f70a5f6c7371e723dc64e04f2115b56f24d27" }, "path_in_vcs": "chacha20poly1305" }chacha20poly1305-0.10.1/CHANGELOG.md000064400000000000000000000126400072674642500143350ustar 00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## 0.10.1 (2022-08-09) ### Added - `rand_core` feature ([#467]) [#467]: https://github.com/RustCrypto/AEADs/pull/467 ## 0.10.0 (2022-07-31) ### Added - `getrandom` feature ([#446]) - Impl `ZeroizeOnDrop` for `ChaChaPoly1305` ([#447]) ### Changed - Bump `chacha20` dependency to v0.9 ([#402]) - Rust 2021 edition upgrade; MSRV 1.56+ ([#435]) - Bump `aead` dependency to v0.5 ([#444]) - Bump `poly1305` dependency to v0.8 ([#454]) [#402]: https://github.com/RustCrypto/AEADs/pull/402 [#435]: https://github.com/RustCrypto/AEADs/pull/435 [#444]: https://github.com/RustCrypto/AEADs/pull/444 [#446]: https://github.com/RustCrypto/AEADs/pull/446 [#447]: https://github.com/RustCrypto/AEADs/pull/447 [#454]: https://github.com/RustCrypto/AEADs/pull/454 ## 0.9.1 (2022-07-07) ### Changed - Unpin `zeroize` dependency ([#438]) [#438]: https://github.com/RustCrypto/AEADs/pull/438 ## 0.9.0 (2021-08-29) ### Changed - Bump `chacha20` to v0.8: now a hard dependency ([#365]) - MSRV 1.51+ ([#365]) ### Removed - `chacha20` feature: now a hard dependency ([#365]) - `xchacha20` feature: now always-on ([#365]) - `chacha20-reduced-round` and `xchacha20-reduced-round` have been coalesced into the `reduced-round` feature ([#365]) [#365]: https://github.com/RustCrypto/AEADs/pull/365 ## 0.8.2 (2021-08-28) ### Added - `XChaCha*` reduced-round variants ([#355]) ### Changed - Relax `subtle` and `zeroize` requirements ([#360]) [#355]: https://github.com/RustCrypto/AEADs/pull/355 [#360]: https://github.com/RustCrypto/AEADs/pull/360 ## 0.8.1 (2021-07-20) ### Changed - Pin `zeroize` dependency to v1.3 ([#349]) [#349]: https://github.com/RustCrypto/AEADs/pull/349 ## 0.8.0 (2021-04-29) ### Added - Wycheproof test vectors ([#274]) ### Changed - Bump `aead` crate dependency to v0.4 ([#270]) - `xchacha` feature name ([#257]) - MSRV 1.49+ ([#286], [#289]) - Bump `chacha20` crate dependency to v0.7 ([#286]) - Bump `poly1305` crate dependency to v0.7 ([#289]) [#257]: https://github.com/RustCrypto/AEADs/pull/257 [#270]: https://github.com/RustCrypto/AEADs/pull/270 [#274]: https://github.com/RustCrypto/AEADs/pull/274 [#286]: https://github.com/RustCrypto/AEADs/pull/286 [#289]: https://github.com/RustCrypto/AEADs/pull/289 ## 0.7.1 (2020-10-25) ### Changed - Expand README.md ([#233]) [#233]: https://github.com/RustCrypto/AEADs/pull/233 ## 0.7.0 (2020-10-16) ### Changed - Replace `block-cipher`/`stream-cipher` with `cipher` crate ([#229]) - Bump `chacha20` dependency to v0.6 ([#229]) [#229]: https://github.com/RustCrypto/AEADs/pull/229 ## 0.6.0 (2020-09-17) ### Added - Optional `std` feature; disabled by default ([#217]) ### Changed - Upgrade `chacha20` to v0.5; `stream-cipher` to v0.7 ([#209]) [#217]: https://github.com/RustCrypto/AEADs/pull/217 [#209]: https://github.com/RustCrypto/AEADs/pull/209 ## 0.5.1 (2020-06-11) ### Added - `Key`, `Nonce`, and `XNonce` type aliases ([#168]) [#168]: https://github.com/RustCrypto/AEADs/pull/168 ## 0.5.0 (2020-06-06) ### Changed - Bump `aead` crate dependency to v0.3; MSRV 1.41+ ([#144]) - Bump `chacha20` crate dependency to v0.4 ([#159]) - Bump `poly1305` crate dependency to v0.6 ([#158]) [#159]: https://github.com/RustCrypto/AEADs/pull/159 [#158]: https://github.com/RustCrypto/AEADs/pull/158 [#144]: https://github.com/RustCrypto/AEADs/pull/144 ## 0.4.1 (2020-03-09) ### Fixed - `Clone` impl on `ChaChaPoly1305` ([#103]) [#103]: https://github.com/RustCrypto/AEADs/pull/103 ## 0.4.0 (2020-03-07) ### Added - `chacha20` cargo feature; ; replace macros with generics ([#99]) [#99]: https://github.com/RustCrypto/AEADs/pull/99 ## 0.3.3 (2020-02-27) ### Fixed - Wording in documentation about security audit ([#84]) [#84]: https://github.com/RustCrypto/AEADs/pull/84 ## 0.3.2 (2020-02-26) ### Added - Notes about NCC audit to documentation ([#80]) [#80]: https://github.com/RustCrypto/AEADs/pull/80 ## 0.3.1 (2020-01-16) ### Added - `ChaCha8Poly1305`/`ChaCha12Poly1305` reduced round variants ([#69]) - `criterion`-based benchmark ([#66]) ### Changed - Upgrade to `chacha20` v0.3; adds AVX2 backend w\ +60% perf ([#67]) [#66]: https://github.com/RustCrypto/AEADs/pull/66 [#67]: https://github.com/RustCrypto/AEADs/pull/67 [#69]: https://github.com/RustCrypto/AEADs/pull/69 ## 0.3.0 (2019-11-26) ### Added - `heapless` feature ([#51]) ### Changed - Upgrade `aead` crate to v0.2; `alloc` now optional ([#43]) [#51]: https://github.com/RustCrypto/AEADs/pull/51 [#43]: https://github.com/RustCrypto/AEADs/pull/43 ## 0.2.2 (2019-11-14) ### Changed - Upgrade to `zeroize` 1.0 ([#36]) [#36]: https://github.com/RustCrypto/AEADs/pull/36 ## 0.2.1 (2019-10-15) ### Changed - Documentation improvements ([#34]) [#34]: https://github.com/RustCrypto/AEADs/pull/34 ## 0.2.0 (2019-10-06) ### Added - Expose "detached" in-place encryption/decryption APIs ([#21]) ### Changed - Upgrade to `poly1305` crate v0.5 ([#20]) [#21]: https://github.com/RustCrypto/AEADs/pull/21 [#20]: https://github.com/RustCrypto/AEADs/pull/20 ## 0.1.2 (2019-10-01) ### Changed - Update to `zeroize` 1.0.0-pre ([#17]) [#17]: https://github.com/RustCrypto/AEADs/pull/17 ## 0.1.1 (2019-09-19) ### Changed - Update to `poly1305` v0.4 ([#8]) [#8]: https://github.com/RustCrypto/AEADs/pull/8 ## 0.1.0 (2019-08-30) - Initial release chacha20poly1305-0.10.1/Cargo.toml0000644000000037320000000000100117040ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "chacha20poly1305" version = "0.10.1" authors = ["RustCrypto Developers"] description = """ Pure Rust implementation of the ChaCha20Poly1305 Authenticated Encryption with Additional Data Cipher (RFC 8439) with optional architecture-specific hardware acceleration. Also contains implementations of the XChaCha20Poly1305 extended nonce variant of ChaCha20Poly1305, and the reduced-round ChaCha8Poly1305 and ChaCha12Poly1305 lightweight variants. """ documentation = "https://docs.rs/chacha20poly1305" readme = "README.md" keywords = [ "aead", "chacha20", "poly1305", "xchacha20", "xchacha20poly1305", ] categories = [ "cryptography", "no-std", ] license = "Apache-2.0 OR MIT" repository = "https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305" [package.metadata.docs.rs] all-features = true rustdoc-args = [ "--cfg", "docsrs", ] [dependencies.aead] version = "0.5" default-features = false [dependencies.chacha20] version = "0.9" features = ["zeroize"] [dependencies.cipher] version = "0.4" [dependencies.poly1305] version = "0.8" [dependencies.zeroize] version = "1.5" default-features = false [dev-dependencies.aead] version = "0.5" features = ["dev"] default-features = false [features] alloc = ["aead/alloc"] default = [ "alloc", "getrandom", ] getrandom = [ "aead/getrandom", "rand_core", ] heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] reduced-round = [] std = [ "aead/std", "alloc", ] stream = ["aead/stream"] chacha20poly1305-0.10.1/Cargo.toml.orig000064400000000000000000000026620072674642500154160ustar 00000000000000[package] name = "chacha20poly1305" version = "0.10.1" description = """ Pure Rust implementation of the ChaCha20Poly1305 Authenticated Encryption with Additional Data Cipher (RFC 8439) with optional architecture-specific hardware acceleration. Also contains implementations of the XChaCha20Poly1305 extended nonce variant of ChaCha20Poly1305, and the reduced-round ChaCha8Poly1305 and ChaCha12Poly1305 lightweight variants. """ authors = ["RustCrypto Developers"] edition = "2021" license = "Apache-2.0 OR MIT" readme = "README.md" documentation = "https://docs.rs/chacha20poly1305" repository = "https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305" keywords = ["aead", "chacha20", "poly1305", "xchacha20", "xchacha20poly1305"] categories = ["cryptography", "no-std"] [dependencies] aead = { version = "0.5", default-features = false } chacha20 = { version = "0.9", features = ["zeroize"] } cipher = "0.4" poly1305 = "0.8" zeroize = { version = "1.5", default-features = false } [dev-dependencies] aead = { version = "0.5", features = ["dev"], default-features = false } [features] default = ["alloc", "getrandom"] std = ["aead/std", "alloc"] alloc = ["aead/alloc"] getrandom = ["aead/getrandom", "rand_core"] heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] reduced-round = [] stream = ["aead/stream"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] chacha20poly1305-0.10.1/LICENSE-APACHE000064400000000000000000000251410072674642500144500ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. chacha20poly1305-0.10.1/LICENSE-MIT000064400000000000000000000020650072674642500141600ustar 00000000000000Copyright (c) 2019 The RustCrypto Project Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. chacha20poly1305-0.10.1/README.md000064400000000000000000000070740072674642500140100ustar 00000000000000# RustCrypto: ChaCha20Poly1305 [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] Pure Rust implementation of **ChaCha20Poly1305** ([RFC 8439][1]): an [Authenticated Encryption with Associated Data (AEAD)][2] cipher amenable to fast, constant-time implementations in software, based on the [ChaCha20][3] stream cipher and [Poly1305][4] universal hash function. This crate also contains an implementation of **XChaCha20Poly1305**: a variant of ChaCha20Poly1305 with an extended 192-bit (24-byte) nonce. [Documentation][docs-link] ## About ChaCha20Poly1305 is notable for being simple and fast when implemented in pure software. The underlying ChaCha20 stream cipher uses a simple combination of add, rotate, and XOR instructions (a.k.a. "ARX"), and the Poly1305 hash function is likewise extremely simple. While it hasn't received approval from certain standards bodies (i.e. NIST) the algorithm is widely used and deployed. Notably it's mandatory to implement in the Transport Layer Security (TLS) protocol. The underlying ChaCha20 cipher is also widely used as a cryptographically secure random number generator, including internal use by the Rust standard library. ## Security Notes This crate has received one [security audit by NCC Group][5], with no significant findings. We would like to thank [MobileCoin][6] for funding the audit. All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (i.e. AVX2 on x86/x86_64), or using a portable implementation which is only constant time on processors which implement constant-time multiplication. It is not suitable for use on processors with a variable-time multiplication operation (e.g. short circuit on multiply-by-zero / multiply-by-one, such as certain 32-bit PowerPC CPUs and some non-ARM microcontrollers). ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://buildstats.info/crate/chacha20poly1305 [crate-link]: https://crates.io/crates/chacha20poly1305 [docs-image]: https://docs.rs/chacha20poly1305/badge.svg [docs-link]: https://docs.rs/chacha20poly1305/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260038-AEADs [downloads-image]: https://img.shields.io/crates/d/chacha20poly1305.svg [build-image]: https://github.com/RustCrypto/AEADs/workflows/chacha20poly1305/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/AEADs/actions [//]: # (general links) [1]: https://tools.ietf.org/html/rfc8439 [2]: https://en.wikipedia.org/wiki/Authenticated_encryption [3]: https://github.com/RustCrypto/stream-ciphers/tree/master/chacha20 [4]: https://github.com/RustCrypto/universal-hashes/tree/master/poly1305 [5]: https://research.nccgroup.com/2020/02/26/public-report-rustcrypto-aes-gcm-and-chacha20poly1305-implementation-review/ [6]: https://www.mobilecoin.com/ chacha20poly1305-0.10.1/src/cipher.rs000064400000000000000000000065670072674642500151460ustar 00000000000000//! Core AEAD cipher implementation for (X)ChaCha20Poly1305. use ::cipher::{StreamCipher, StreamCipherSeek}; use aead::generic_array::GenericArray; use aead::Error; use poly1305::{ universal_hash::{KeyInit, UniversalHash}, Poly1305, }; use zeroize::Zeroize; use super::Tag; /// Size of a ChaCha20 block in bytes const BLOCK_SIZE: usize = 64; /// Maximum number of blocks that can be encrypted with ChaCha20 before the /// counter overflows. const MAX_BLOCKS: usize = core::u32::MAX as usize; /// ChaCha20Poly1305 instantiated with a particular nonce pub(crate) struct Cipher where C: StreamCipher + StreamCipherSeek, { cipher: C, mac: Poly1305, } impl Cipher where C: StreamCipher + StreamCipherSeek, { /// Instantiate the underlying cipher with a particular nonce pub(crate) fn new(mut cipher: C) -> Self { // Derive Poly1305 key from the first 32-bytes of the ChaCha20 keystream let mut mac_key = poly1305::Key::default(); cipher.apply_keystream(&mut *mac_key); let mac = Poly1305::new(GenericArray::from_slice(&*mac_key)); mac_key.zeroize(); // Set ChaCha20 counter to 1 cipher.seek(BLOCK_SIZE as u64); Self { cipher, mac } } /// Encrypt the given message in-place, returning the authentication tag pub(crate) fn encrypt_in_place_detached( mut self, associated_data: &[u8], buffer: &mut [u8], ) -> Result { if buffer.len() / BLOCK_SIZE >= MAX_BLOCKS { return Err(Error); } self.mac.update_padded(associated_data); // TODO(tarcieri): interleave encryption with Poly1305 // See: self.cipher.apply_keystream(buffer); self.mac.update_padded(buffer); self.authenticate_lengths(associated_data, buffer)?; Ok(self.mac.finalize()) } /// Decrypt the given message, first authenticating ciphertext integrity /// and returning an error if it's been tampered with. pub(crate) fn decrypt_in_place_detached( mut self, associated_data: &[u8], buffer: &mut [u8], tag: &Tag, ) -> Result<(), Error> { if buffer.len() / BLOCK_SIZE >= MAX_BLOCKS { return Err(Error); } self.mac.update_padded(associated_data); self.mac.update_padded(buffer); self.authenticate_lengths(associated_data, buffer)?; // This performs a constant-time comparison using the `subtle` crate if self.mac.verify(tag).is_ok() { // TODO(tarcieri): interleave decryption with Poly1305 // See: self.cipher.apply_keystream(buffer); Ok(()) } else { Err(Error) } } /// Authenticate the lengths of the associated data and message fn authenticate_lengths(&mut self, associated_data: &[u8], buffer: &[u8]) -> Result<(), Error> { let associated_data_len: u64 = associated_data.len().try_into().map_err(|_| Error)?; let buffer_len: u64 = buffer.len().try_into().map_err(|_| Error)?; let mut block = GenericArray::default(); block[..8].copy_from_slice(&associated_data_len.to_le_bytes()); block[8..].copy_from_slice(&buffer_len.to_le_bytes()); self.mac.update(&[block]); Ok(()) } } chacha20poly1305-0.10.1/src/lib.rs000064400000000000000000000241220072674642500144250ustar 00000000000000#![no_std] #![cfg_attr(docsrs, feature(doc_cfg))] #![doc = include_str!("../README.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] #![warn(missing_docs, rust_2018_idioms)] //! ## Supported Algorithms //! //! This crate contains pure Rust implementations of [`ChaCha20Poly1305`] //! (with optional AVX2 acceleration) as well as the following variants thereof: //! //! - [`XChaCha20Poly1305`] - ChaCha20Poly1305 variant with an extended 192-bit (24-byte) nonce. //! - [`ChaCha8Poly1305`] / [`ChaCha12Poly1305`] - non-standard, reduced-round variants //! (gated under the `reduced-round` Cargo feature). See the [Too Much Crypto][5] //! paper for background and rationale on when these constructions could be used. //! When in doubt, prefer [`ChaCha20Poly1305`]. //! - [`XChaCha8Poly1305`] / [`XChaCha12Poly1305`] - same as above, //! but with an extended 192-bit (24-byte) nonce. //! //! # Usage //! #![cfg_attr(all(feature = "getrandom", feature = "std"), doc = "```")] #![cfg_attr(not(all(feature = "getrandom", feature = "std")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use chacha20poly1305::{ //! aead::{Aead, AeadCore, KeyInit, OsRng}, //! ChaCha20Poly1305, Nonce //! }; //! //! let key = ChaCha20Poly1305::generate_key(&mut OsRng); //! let cipher = ChaCha20Poly1305::new(&key); //! let nonce = ChaCha20Poly1305::generate_nonce(&mut OsRng); // 96-bits; unique per message //! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?; //! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?; //! assert_eq!(&plaintext, b"plaintext message"); //! # Ok(()) //! # } //! ``` //! //! ## In-place Usage (eliminates `alloc` requirement) //! //! This crate has an optional `alloc` feature which can be disabled in e.g. //! microcontroller environments that don't have a heap. //! //! The [`AeadInPlace::encrypt_in_place`] and [`AeadInPlace::decrypt_in_place`] //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! //! Note that if you enable the `heapless` feature of this crate, //! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` //! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), //! which can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! #![cfg_attr( all(feature = "getrandom", feature = "heapless", feature = "std"), doc = "```" )] #![cfg_attr( not(all(feature = "getrandom", feature = "heapless", feature = "std")), doc = "```ignore" )] //! # fn main() -> Result<(), Box> { //! use chacha20poly1305::{ //! aead::{AeadCore, AeadInPlace, KeyInit, OsRng, heapless::Vec}, //! ChaCha20Poly1305, Nonce, //! }; //! //! let key = ChaCha20Poly1305::generate_key(&mut OsRng); //! let cipher = ChaCha20Poly1305::new(&key); //! let nonce = ChaCha20Poly1305::generate_nonce(&mut OsRng); // 96-bits; unique per message //! //! let mut buffer: Vec = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag //! buffer.extend_from_slice(b"plaintext message"); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer)?; //! //! // `buffer` now contains the message ciphertext //! assert_ne!(&buffer, b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?; //! assert_eq!(&buffer, b"plaintext message"); //! # Ok(()) //! # } //! ``` //! //! ## [`XChaCha20Poly1305`] //! //! ChaCha20Poly1305 variant with an extended 192-bit (24-byte) nonce. //! //! The construction is an adaptation of the same techniques used by //! XSalsa20 as described in the paper "Extending the Salsa20 Nonce" //! to the 96-bit nonce variant of ChaCha20, which derive a //! separate subkey/nonce for each extended nonce: //! //! //! //! No authoritative specification exists for XChaCha20Poly1305, however the //! construction has "rough consensus and running code" in the form of //! several interoperable libraries and protocols (e.g. libsodium, WireGuard) //! and is documented in an (expired) IETF draft, which also applies the //! proof from the XSalsa20 paper to the construction in order to demonstrate //! that XChaCha20 is secure if ChaCha20 is secure (see Section 3.1): //! //! //! //! It is worth noting that NaCl/libsodium's default "secretbox" algorithm is //! XSalsa20Poly1305, not XChaCha20Poly1305, and thus not compatible with //! this library. If you are interested in that construction, please see the //! `xsalsa20poly1305` crate: //! //! //! //! # Usage //! #![cfg_attr(all(feature = "getrandom", feature = "std"), doc = "```")] #![cfg_attr(not(all(feature = "getrandom", feature = "std")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use chacha20poly1305::{ //! aead::{Aead, AeadCore, KeyInit, OsRng}, //! XChaCha20Poly1305, XNonce //! }; //! //! let key = XChaCha20Poly1305::generate_key(&mut OsRng); //! let cipher = XChaCha20Poly1305::new(&key); //! let nonce = XChaCha20Poly1305::generate_nonce(&mut OsRng); // 192-bits; unique per message //! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?; //! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?; //! assert_eq!(&plaintext, b"plaintext message"); //! # Ok(()) //! # } //! ``` mod cipher; pub use aead::{self, consts, AeadCore, AeadInPlace, Error, KeyInit, KeySizeUser}; use self::cipher::Cipher; use ::cipher::{KeyIvInit, StreamCipher, StreamCipherSeek}; use aead::{ consts::{U0, U12, U16, U24, U32}, generic_array::{ArrayLength, GenericArray}, }; use core::marker::PhantomData; use zeroize::{Zeroize, ZeroizeOnDrop}; use chacha20::{ChaCha20, XChaCha20}; #[cfg(feature = "reduced-round")] use chacha20::{ChaCha12, ChaCha8, XChaCha12, XChaCha8}; /// Key type (256-bits/32-bytes). /// /// Implemented as an alias for [`GenericArray`]. /// /// All [`ChaChaPoly1305`] variants (including `XChaCha20Poly1305`) use this /// key type. pub type Key = GenericArray; /// Nonce type (96-bits/12-bytes). /// /// Implemented as an alias for [`GenericArray`]. pub type Nonce = GenericArray; /// XNonce type (192-bits/24-bytes). /// /// Implemented as an alias for [`GenericArray`]. pub type XNonce = GenericArray; /// Poly1305 tag. /// /// Implemented as an alias for [`GenericArray`]. pub type Tag = GenericArray; /// ChaCha20Poly1305 Authenticated Encryption with Additional Data (AEAD). pub type ChaCha20Poly1305 = ChaChaPoly1305; /// XChaCha20Poly1305 Authenticated Encryption with Additional Data (AEAD). pub type XChaCha20Poly1305 = ChaChaPoly1305; /// ChaCha8Poly1305 (reduced round variant) Authenticated Encryption with Additional Data (AEAD). #[cfg(feature = "reduced-round")] #[cfg_attr(docsrs, doc(cfg(feature = "reduced-round")))] pub type ChaCha8Poly1305 = ChaChaPoly1305; /// ChaCha12Poly1305 (reduced round variant) Authenticated Encryption with Additional Data (AEAD). #[cfg(feature = "reduced-round")] #[cfg_attr(docsrs, doc(cfg(feature = "reduced-round")))] pub type ChaCha12Poly1305 = ChaChaPoly1305; /// XChaCha8Poly1305 (reduced round variant) Authenticated Encryption with Additional Data (AEAD). #[cfg(feature = "reduced-round")] #[cfg_attr(docsrs, doc(cfg(feature = "reduced-round")))] pub type XChaCha8Poly1305 = ChaChaPoly1305; /// XChaCha12Poly1305 (reduced round variant) Authenticated Encryption with Additional Data (AEAD). #[cfg(feature = "reduced-round")] #[cfg_attr(docsrs, doc(cfg(feature = "reduced-round")))] pub type XChaCha12Poly1305 = ChaChaPoly1305; /// Generic ChaCha+Poly1305 Authenticated Encryption with Additional Data (AEAD) construction. /// /// See the [toplevel documentation](index.html) for a usage example. pub struct ChaChaPoly1305 = U12> { /// Secret key. key: Key, /// ChaCha stream cipher. stream_cipher: PhantomData, /// Nonce size. nonce_size: PhantomData, } impl KeySizeUser for ChaChaPoly1305 where N: ArrayLength, { type KeySize = U32; } impl KeyInit for ChaChaPoly1305 where N: ArrayLength, { #[inline] fn new(key: &Key) -> Self { Self { key: *key, stream_cipher: PhantomData, nonce_size: PhantomData, } } } impl AeadCore for ChaChaPoly1305 where N: ArrayLength, { type NonceSize = N; type TagSize = U16; type CiphertextOverhead = U0; } impl AeadInPlace for ChaChaPoly1305 where C: KeyIvInit + StreamCipher + StreamCipherSeek, N: ArrayLength, { fn encrypt_in_place_detached( &self, nonce: &aead::Nonce, associated_data: &[u8], buffer: &mut [u8], ) -> Result { Cipher::new(C::new(&self.key, nonce)).encrypt_in_place_detached(associated_data, buffer) } fn decrypt_in_place_detached( &self, nonce: &aead::Nonce, associated_data: &[u8], buffer: &mut [u8], tag: &Tag, ) -> Result<(), Error> { Cipher::new(C::new(&self.key, nonce)).decrypt_in_place_detached( associated_data, buffer, tag, ) } } impl Clone for ChaChaPoly1305 where N: ArrayLength, { fn clone(&self) -> Self { Self { key: self.key, stream_cipher: PhantomData, nonce_size: PhantomData, } } } impl Drop for ChaChaPoly1305 where N: ArrayLength, { fn drop(&mut self) { self.key.as_mut_slice().zeroize(); } } impl> ZeroizeOnDrop for ChaChaPoly1305 {} chacha20poly1305-0.10.1/tests/data/wycheproof_chacha20poly1305.blb000064400000000000000000001212300072674642500223070ustar 00000000000000     !"#$%&'()*+,-./0123456789:;<=>? -@ e oo @!    6W3 |@68Q1P_@䌯v3'VFQ|,BfԼ MY; B.w\dbGCx p ߃M @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_@ABCDEFGPQRSǀdLadies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.4d`{S~¤Q)nⵧ6b=^giڒrq  )֥~;6ݽ-w( X$uUH1׼?KzveKa YO j~.`@1Ζ^q<;j*vBn@ MXR7 vB1f< 8<@zLY. MF"}Ec۹Wz%B.Pgd o(KR{sY˪uc @VU.PHKLPcjjvbs>ĉ`*":} hn֝u"@F%Iei+JpCR  ^Kp  qnQx/DlY,SQ"ElN?r@/~OY+It5>i_%F"4~\`$M9"TS{"@ȃ=^H 0+b y3Dq׫XaTkr 6O$ F.UX#w$7@ `u"M ,W ź$=p."Zҫ PT) !&ȕz*mX+Z.El8 E?&a %> .Y"@,Zt4_Esf`dxKNz%GbiL(hI%}T@Ww=}*E+T\f .yUr&qW :ũ(qQWƣ{jLl!;+@LO9#EG|.3\ ~5Gչ}Q ZY;*d"-Ì)L$%@$y`6i[-Wÿԝ!=k؀쎢pC"H5a x+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/wycheproof_xchacha20poly1305.blb000064400000000000000000001145760072674642500225160ustar 00000000000000   !"#$%&'()*+,-./0123456789:;<=>? R 6  r!   @ `abcdefghijklmnopqrstuvwxyz{|}~@f62Ul%9l }Y?֛ۊ<tdS S13tczx{6ny @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_0@ABCDEFGHIJKLMNOPQRSTUVWPQRSǀdLadies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.m>;vW9W*%+̾Ґ,!9ls JD /N~9dpT˖.R/ Ei??+iHv85e!fLc}vƋ.Y$ǘyGޯx I@bG:0#UX^h}u^q|!XH @] l"Uc&O@0<.g)2*%gOg1808J 8> OzAb"EW4I?P C@i||#-,FqCeam|L0xSG:l0p-7{1j0 smM˺J/B@W$^,SgvNx@'4d3p&[Y},0Ol'8uFdN}@n2/~)$j,2'*4Gg@u?* H!' b;',l0s~>vi8ShN_ٍ*j&1a+tPT;@ü@ ߅?EܷLւx06df3zsi5S1kҪ>=G&G> 9 @pNPX&J)54N9m \T0|9Itf'm0N(-ۗaz{tl$@Y% #~xls$' j0N67ѐ®rϺU_eĶ y4`PR'8(!kx  @*^6N>ܸkኃ&vV#0{0IU6Ԕjf_Y ,L85**Џ✾_>x/W:En@H8"&]- fRyABG0̵C^`!9q9Yl\ԂB' Z@*]nWI<.Xעy@s|ڢG@Z`{އ$R(Eb9S0ɀjS[Ps_pU X1P,l0 목^B &J@|2^Y dUqV!N650\GrOt^7׵Ǐq0JW- S:,d89"@ үqUͪ[ֽ_%J-{`0 R="k>9hE 0}}x.?9SٚͫT쑧V3@7eqvr{. ǩucvEH0[m)A/jUoT E$Wi ̗ĞjJ=&ܗW.? 5n`6s0);@θe,Lچ)JJB ju0HL|Jy j5S`~n5 0[Yk(nGM $ !@Gynβ9BpwY5zSt_LH0GDU蜃ot3&wo]5v|:y~wjI0,Λb`Z@W׼?2#|RJ1VCpȅ0 0' ;uT1=pM:1727֖&Ox8_ݯtCYf{^@ ;k_ F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EdzúDB|[FúDB|[FqJ-G[ss! @i׀< \^Q56b)w0H2(@V?n /gg:ȃJ>TzqF|YuΤIk a ܴ#>h` F=[EwɷuBþZɷuBþZ)_2+Cs @i׀< \^Q56b)w0H^2(@V?}8u'LQZ{TzqF|YuΤ/QN>`hx`F=[Ewp<['Дʈp<['Дʈus>f̹0#1G ?\[{fNJ &l2)6<4JlS[K2(@V?աߞ/~0r)YXnTzqF|YuΤJv)9 Kt`iu-)ޗrdKyb7ҕ2b^FKyb7ҕ2b^Fa,x2Nl,6 @`׀< \^Q5UhEl7%H2(@V?g'uB^>TzqF|YuΤ5 :sy ?|K`o%hq𙃹h'Pp74`Lm0N74`Lm0Nĭ:LO3{% ׀< \^Q5: Ley*8٬}I 㕽,X 9rW#y8Yz9ؤH9~dH9~dDT%ҐB{ `"x3)FI3S'U_ky+^oN=1=VI!b$ #Z g=*fPg=*fPFudQO @]׀< \^Q5Ko"> 2(@V? ڴbS [.TzqF|YuΤ-nd-Ao`;VCwPúzl]zl]xr(ȫafw` @N׀< \^Q5ˤUޫpnx2(@V?氯$+w[;TzqF|YuΤ/2S`>@ ld4:o5 ld4:o5p[*";pdnG @q׀< \^Q5 LבG\ڠ^h I2(@V?wJƧc=_lTzqF|YuΤPgo#Z)bj`TzqF|YuΤ8<6hJX\`h2a*+BUٛ69t/(f -nv69t/(f -nvJfb?PjK l@ WV)9}NJ &]y]?r aS { #[test] fn encrypt() { let key = GenericArray::from_slice($key); let nonce = GenericArray::from_slice($nonce); let payload = Payload { msg: $plaintext, aad: $aad, }; let ciphertext = <$cipher>::new(key).encrypt(nonce, payload).unwrap(); let tag_begins = ciphertext.len() - 16; assert_eq!($ciphertext, &ciphertext[..tag_begins]); assert_eq!($tag, &ciphertext[tag_begins..]); } #[test] fn decrypt() { let key = GenericArray::from_slice($key); let nonce = GenericArray::from_slice($nonce); let mut ciphertext = Vec::from($ciphertext); ciphertext.extend_from_slice($tag); let payload = Payload { msg: &ciphertext, aad: $aad, }; let plaintext = <$cipher>::new(key).decrypt(nonce, payload).unwrap(); assert_eq!($plaintext, plaintext.as_slice()); } #[test] fn decrypt_modified() { let key = GenericArray::from_slice($key); let nonce = GenericArray::from_slice($nonce); let mut ciphertext = Vec::from($ciphertext); ciphertext.extend_from_slice($tag); // Tweak the first byte ciphertext[0] ^= 0xaa; let payload = Payload { msg: &ciphertext, aad: $aad, }; let cipher = <$cipher>::new(key); assert!(cipher.decrypt(nonce, payload).is_err()); } }; } // // Test vectors common to RFC 8439 and `draft-arciszewski-xchacha` // const KEY: &[u8; 32] = &[ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, ]; const AAD: &[u8; 12] = &[ 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, ]; const PLAINTEXT: &[u8] = b"Ladies and Gentlemen of the class of '99: \ If I could offer you only one tip for the future, sunscreen would be it."; /// ChaCha20Poly1305 test vectors. /// /// From RFC 8439 Section 2.8.2: /// mod chacha20 { use super::{AAD, KEY, PLAINTEXT}; use chacha20poly1305::aead::generic_array::GenericArray; use chacha20poly1305::aead::{Aead, KeyInit, Payload}; use chacha20poly1305::ChaCha20Poly1305; const NONCE: &[u8; 12] = &[ 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, ]; const CIPHERTEXT: &[u8] = &[ 0xd3, 0x1a, 0x8d, 0x34, 0x64, 0x8e, 0x60, 0xdb, 0x7b, 0x86, 0xaf, 0xbc, 0x53, 0xef, 0x7e, 0xc2, 0xa4, 0xad, 0xed, 0x51, 0x29, 0x6e, 0x08, 0xfe, 0xa9, 0xe2, 0xb5, 0xa7, 0x36, 0xee, 0x62, 0xd6, 0x3d, 0xbe, 0xa4, 0x5e, 0x8c, 0xa9, 0x67, 0x12, 0x82, 0xfa, 0xfb, 0x69, 0xda, 0x92, 0x72, 0x8b, 0x1a, 0x71, 0xde, 0x0a, 0x9e, 0x06, 0x0b, 0x29, 0x05, 0xd6, 0xa5, 0xb6, 0x7e, 0xcd, 0x3b, 0x36, 0x92, 0xdd, 0xbd, 0x7f, 0x2d, 0x77, 0x8b, 0x8c, 0x98, 0x03, 0xae, 0xe3, 0x28, 0x09, 0x1b, 0x58, 0xfa, 0xb3, 0x24, 0xe4, 0xfa, 0xd6, 0x75, 0x94, 0x55, 0x85, 0x80, 0x8b, 0x48, 0x31, 0xd7, 0xbc, 0x3f, 0xf4, 0xde, 0xf0, 0x8e, 0x4b, 0x7a, 0x9d, 0xe5, 0x76, 0xd2, 0x65, 0x86, 0xce, 0xc6, 0x4b, 0x61, 0x16, ]; const TAG: &[u8] = &[ 0x1a, 0xe1, 0x0b, 0x59, 0x4f, 0x09, 0xe2, 0x6a, 0x7e, 0x90, 0x2e, 0xcb, 0xd0, 0x60, 0x06, 0x91, ]; impl_tests!( ChaCha20Poly1305, KEY, NONCE, AAD, PLAINTEXT, CIPHERTEXT, TAG ); #[test] fn clone_impl() { let _ = ChaCha20Poly1305::new(GenericArray::from_slice(KEY)).clone(); } } /// XChaCha20Poly1305 test vectors. /// /// From mod xchacha20 { use super::{AAD, KEY, PLAINTEXT}; use chacha20poly1305::aead::generic_array::GenericArray; use chacha20poly1305::aead::{Aead, KeyInit, Payload}; use chacha20poly1305::XChaCha20Poly1305; const NONCE: &[u8; 24] = &[ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, ]; const CIPHERTEXT: &[u8] = &[ 0xbd, 0x6d, 0x17, 0x9d, 0x3e, 0x83, 0xd4, 0x3b, 0x95, 0x76, 0x57, 0x94, 0x93, 0xc0, 0xe9, 0x39, 0x57, 0x2a, 0x17, 0x00, 0x25, 0x2b, 0xfa, 0xcc, 0xbe, 0xd2, 0x90, 0x2c, 0x21, 0x39, 0x6c, 0xbb, 0x73, 0x1c, 0x7f, 0x1b, 0x0b, 0x4a, 0xa6, 0x44, 0x0b, 0xf3, 0xa8, 0x2f, 0x4e, 0xda, 0x7e, 0x39, 0xae, 0x64, 0xc6, 0x70, 0x8c, 0x54, 0xc2, 0x16, 0xcb, 0x96, 0xb7, 0x2e, 0x12, 0x13, 0xb4, 0x52, 0x2f, 0x8c, 0x9b, 0xa4, 0x0d, 0xb5, 0xd9, 0x45, 0xb1, 0x1b, 0x69, 0xb9, 0x82, 0xc1, 0xbb, 0x9e, 0x3f, 0x3f, 0xac, 0x2b, 0xc3, 0x69, 0x48, 0x8f, 0x76, 0xb2, 0x38, 0x35, 0x65, 0xd3, 0xff, 0xf9, 0x21, 0xf9, 0x66, 0x4c, 0x97, 0x63, 0x7d, 0xa9, 0x76, 0x88, 0x12, 0xf6, 0x15, 0xc6, 0x8b, 0x13, 0xb5, 0x2e, ]; const TAG: &[u8] = &[ 0xc0, 0x87, 0x59, 0x24, 0xc1, 0xc7, 0x98, 0x79, 0x47, 0xde, 0xaf, 0xd8, 0x78, 0x0a, 0xcf, 0x49, ]; impl_tests!( XChaCha20Poly1305, KEY, NONCE, AAD, PLAINTEXT, CIPHERTEXT, TAG ); }