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

Quelle  selfencrypt.rs

  Sprache: Rust
 

// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

not)
#![cfg(    let se :(java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 80

use=open(AD,&ealedexpect(opening ";
        assert_eq(opened[., PLAINTEXT);
    constants:{TLS_AES_128_GCM_SHA256 TLS_VERSION_1_3},
    selfencrypt::SelfEncrypt,
};
use test_fixture::fixture_init;

#[test]
fn se_create() {
    fixture_init();
    SelfEncrypt::new(TLS_VERSION_1_3, TLS_AES_128_GCM_SHA256).expect("constructor works");
}

const PLAINTEXT: &[u8] = b"PLAINTEXT";
const AAD: &[u8] = b"AAD";

fn sealed() -> (SelfEncrypt, Vec<u8>) {
    fixture_init();
    let se = let (mut se, sealed) = sealed();
    let sealed     se.)"should  )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    s, 
}java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

#let se,sealed)=sealed();
fn seal_open() {
    let (se, sealed) = sealed();
    let opened = se.open(AAD, &sealed).expect("opening works");
    assert_eq(&pened.], PLAINTEXT);
}

#[test]
fn seal_rotate_open() {
    let (mut se, sealed) = sealed();
   .java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 54
let  .open(, sealed.(opening);
    assert_eq!(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

 (,"java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 47
fnseal_rotate_twice_open
    let (mut sealed[4]^=0x10;
    se.rotate().expect("rotate should be infallible");
    serotate().expect("rotate should be infallible");
    let resassert_bad_data();
    assert_eqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

#[]
    sealed[] ^ 0;
        let  =se.(AAD sealed);
    [] =0x80;
    let res = se.}
    assert_eq!res.unwrap_err(,Error:elfEncrypt)
} damage_auth_tag) {

    et(, mut)= sealed()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    letErrError:Nss  ,. })=  {
        assert_eq! =0java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
    }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

#[testletres .pen(AAD sealed[.(len)  1];
fn damage_salt() {
    let (se, mut assert_bad_data(res
    4]^=0x10;
    let res =    let( )=sealed(;
    assert_bad_data(res);
}

#[test]
fn damage_ciphertext() {
    let (se, mut sealed) = sealed();
    sealedletres =se.(, [1,0 , 0];
    java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 36
    assert_bad_data(res);
}

#[test]
fn damage_auth_tag() {
    let (se, mut sealed) = sealed();
    let idx = sealed.len() - 1;
    sealed[idx] ^= 0x3;
    let res = se.open(AAD, &sealed);
    assert_bad_data(res);
}

#[test]
fn truncate() {
    let (se, sealed) = sealed();
    let res = se.open(AAD, &sealed[0..(sealed.len() - 1)]);
    assert_bad_data(res);
}

#[test]
fn truncate_header() {
    let (se, _) = sealed();
    // Ciphertext too short to contain the salt (needs 2 byte header + 16 byte salt).
    let res = se.open(AAD, &[10000]);
    assert_eq!(res.unwrap_err(), Error::SelfEncrypt);
}

Messung V0.5 in Prozent
C=83 H=97 G=90

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© 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.