• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 use crypto_provider::elliptic_curve::*;
16 
17 /// Trait for an ephemeral secret for functions used in testing.
18 pub trait EphemeralSecretForTesting<C: Curve>: EphemeralSecret<C> {
19     /// Creates an ephemeral secret from the given private and public components.
from_private_components( _private_bytes: &[u8; 32], _public_key: &<Self::Impl as EcdhProvider<C>>::PublicKey, ) -> Result<Self, Self::Error> where Self: Sized20     fn from_private_components(
21         _private_bytes: &[u8; 32],
22         _public_key: &<Self::Impl as EcdhProvider<C>>::PublicKey,
23     ) -> Result<Self, Self::Error>
24     where
25         Self: Sized;
26 }
27