s2n_quic_core/crypto/
one_rtt.rs

1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::crypto::{HeaderKey, Key};
5
6/// Types for which are able to perform 1-RTT cryptography.
7///
8/// This trait ensures only 1-RTT-level keys
9/// are used with Short packets. Any key misuses are
10/// caught by the type system.
11pub trait OneRttKey: Key {
12    #[must_use]
13    fn derive_next_key(&self) -> Self;
14}
15
16/// Types for which are able to perform 1-RTT header cryptography.
17///
18/// This trait ensures only 1-RTT-level header keys
19/// are used with Short packets. Any key misuses are
20/// caught by the type system.
21pub trait OneRttHeaderKey: HeaderKey {}