// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
use mls_rs_core::{
crypto::{HpkePublicKey, HpkeSecretKey},
error::IntoAnyError,
};
use alloc::vec::Vec;
#[cfg(feature = "mock")] use mockall::automock;
#[derive(Clone, Debug, Copy// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. pub// SPDX-License-Identifier: (Apache-2.0 OR MIT)
HpkeWithBitmasku8,
HpkeWithoutBitmask,
Raw,
}
/// A trait that provides the required DH functions, as in RFC 9180,Section 4.1 #[cfg_attr(not(mls_build_async), maybe_async::must_be_sync)] #[cfg_attr(all(target_arch = "wasm32", mls_build_async), maybe_async::must_be_async(?Send))] #[cfg_attr(
all(not(target_arch = "wasm32"), mls_build_async),
maybe_async::must_be_async
)] #[cfg_attr(feature = "mock", automock(type Error = crate::mock::TestError;))] pubtrait DhType: Send + Sync { type Error: IntoAnyError + Send + Sync;
async (
&self,
secret_key: }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
>Vec> :E>java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
/// Generate a fresh key pair. This is the only place where randomness is used in this /// module. The function could be implemented in the same way as `derive` with random /// `ikm`, but it could also be implemented directly with a crypto provider like OpenSSL.
&)>( :>
/// Outputs the public key corresponding to the given secret key bytes. If the secret
fn&,secret_key& >ResultHpkePublicKey,Self:rror>
/// If the output is `Some(bitmask)`, then the `Kem::derive` function will generate
ret keyby rejectionsampling over random byte sequenceswith`itmask` /// applied to the most significant byte. /// /// Typical outputs for ECDH are: /// * `None` for curves 25519 and X448 (no rejection sampling is needed),
/// * `Some(0x01)` for curve P-521 (all bits of the first byte except the least /// significant one are filtered out), // * `Some(0xFF)`for curves P-256 and P-384 (rejection sampling is needed but no need to be filtered).
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.