Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/mls-rs-crypto-hpke/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  kem_combiner.rs   Sprache: Rust

 

use mls_rs_core::error::{AnyError, IntoAnyError};
use mls_rs_crypto_traits::KemType;

#[cfg(not(mls_build_async))]
pub mod byte_vec_codecs;
#[cfg(not(mls_build_async))]
pub mod ghp;
#[cfg(not(mls_build_async))]
pub mod prgs;
pub mod xwing;

#[derive(Debug)]
#[cfg_attr(feature = "std", derive(thiserror::Error))]
pub enum Error {
    #[cfg_attr(feature = "std", error(transparent))]
    KemError(AnyError),
    #[cfg_attr(feature = "std", error(transparent))]
    KdfError(AnyError),
    #[cfg_attr(feature = "std", error(transparent))]
    PrgError(AnyError),
    #[cfg_attr(feature = "std", error(transparent))]
    ByteVecCodecError(AnyError),
    #[cfg_attr(feature = "std", error(transparent))]
    RandomOracleError(AnyError),
    #[cfg_attr(feature = "std", error("invalid key data"))]
    InvalidKeyData,
    #[cfg_attr(feature = "std", error(transparent))]
    MlsCodecError(mls_rs_core::mls_rs_codec::Error),
    #[cfg_attr(feature = "std", error("invalid prg output length"))]
    InvalidPrgOutputLength,
    #[cfg_attr(feature = "std", error("invalid prg output length {0}"))]
    InvalidInputLength(usize),
}

impl IntoAnyError for Error {}

fn kem_error<E: IntoAnyError>(e: E) -> Error {
    Error::KemError(e.into_any_error())
}

fn prg_error<E: IntoAnyError>(e: E) -> Error {
    Error::PrgError(e.into_any_error())
}

fn codec_error<E: IntoAnyError>(e: E) -> Error {
    Error::ByteVecCodecError(e.into_any_error())
}

fn ro_error<E: IntoAnyError>(e: E) -> Error {
    Error::RandomOracleError(e.into_any_error())
}

impl From<mls_rs_core::mls_rs_codec::Error> for Error {
    #[inline]
    fn from(e: mls_rs_core::mls_rs_codec::Error) -> Self {
        Error::MlsCodecError(e)
    }
}

pub trait FixedLengthKemType: KemType {
    fn public_key_size(&self) -> usize;
    fn secret_key_size(&self) -> usize;

    fn enc_size(&self) -> usize {
        self.public_key_size()
    }
}

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.9 Sekunden  (vorverarbeitet am  2026-10-03) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.