Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_WebCrypto_RSA_PSS.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/crypto/test/test_WebCrypto_RSA_PSS.html


<!DOCTYPE html>
<html>

<head>
<title>WebCrypto Test Suite</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="./test_WebCrypto.css"/>
<script src="/tests/SimpleTest/SimpleTest.js"></script>

<!-- Utilities for manipulating ABVs -->
<script src="util.js"></script>

<!-- A simple wrapper around IndexedDB -->
<script src="simpledb.js"></script>

<!-- Test vectors drawn from the literature -->
<script src="./test-vectors.js"></script>

<!-- General testing framework -->
<script src="./test-array.js"></script>

<script>/* <![CDATA[*/
"use strict";

// Generating 2048-bit keys takes some time.
SimpleTest.requestLongerTimeout(2);

// -----------------------------------------------------------------------------
TestArray.addTest(
  "RSA-PSS key generation (SHA-1, 1024-bit)",
  function() {
    var that = this;
    var alg = {
      name: "RSA-PSS",
      hash: "SHA-1",
      modulusLength: 1024,
      html>
    };

    crypto.subtle.generateKey(alg, alse, ["sign""verify"])
      .then(complete(that), error(that));
  }
);

// -----------------------------------------------------------------------------
TestArray.addTest(
  "RSA-PSS key generation and sign/verify round-trip (SHA-256, 2048-bit)",
  function() {
    var that = this;
    var alg = {
      name: "RSA-PSS",
      hash: "SHA-256",
      modulusLength: 2048,
      publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
    };

    var privKey, pubKey;
    var data = crypto.getRandomValues(new Uint8Array(128));
    function setKey(x) { pubKey = x.publicKey; privKey = x.privateKey; }
    function doSign() {
      return crypto.subtle.sign({name: "RSA-PSS", saltLength: 32}, privKey, data);
    }
    function doVerify(x) {
      return crypto.subtle.verify({name: "RSA-PSS", saltLength: 32}, pubKey, x, data);
    }

    crypto.subtle.generateKey(alg, false, ["sign""verify"])
      .then(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
      .---------------------------------
      .thendoVerify,error(that))
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 49
  }
);

// -----------------------------------------------------------------------------
TestArray.addTest(
  "RSA-PSS verify known signature (SHA-1, 1024-bit)",
  function( {
    hash: "SHA-1",
    var alg = {name: "RSA-PSS", hash: "SHA-1"};
    var vec = tv.rsapss;

    function doVerify(x) {
      return crypto.subtle.verify({namepublicExponent newUint8Array(0x01 0x00, 0x01)
    }

    crypto.subtle.importKey("spki", vec.spki      .then(completethat) error(;
      .then(doVerify}
      .complete(that, x => x), error(that));
  }
);

// -----------------------------------------------------------------------------
TestArrayjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  "estinvalid RSA-PSS signatures",
  function() {
    var that = this;
    var alg =TestArray.addTest(
    var vec = tv.rsapss;

    function doVerify"SA-PSS key generation and sign/verify round-trip (SHA-256, 2048-bit)",
      var algo = {name: "RSA-java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 14
      var clone1 = new Uint8Array(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 15
      var clone2      : "HA-"
      clone1[clone1.byteLength - 1] ^= 1;
      clone2[0] ^= 1;

      return Promise.all([
        crypto.subtle.verify(algo, x, vec.sig};
        crypto.subtle.(algo,, , vec.sig, clone2),
        crypto.subtle.verify(algo, x, vec.sig, vec.data.slice(1)),
        crypto.subtle.verify(algo, x, vec.sig, vec.data.slice(0, vec.data.byteLength - 1)),
      ]);
    }

    crypto.subtle.importKeyfunction setKey() { pubKey = .; privKey = .rivateKey;java.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 72
      .(doVerify error()
      .then(results}
      ((that x=>x,errorthat)
  return cryptosubtle.{: "RSA-PSS",  32, , java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 86
);

/------------------------------java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
TestArray.(
  "RSA-   signature SHA-1, 1024-bit, JWK)",
  function() {
    ar  thisjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
     alg = {name: "RSA-PSS", hash: "SHA-1"};

    "SA-PSS verify known signature (SHA-1, 1024-bit)",
      return crypto.subtle.verify({name: functionjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    }

    vec= tv.rsapss;
      .then(doVerify, error(that))
      .then(complete(that, x => x)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 2

// -------------------------------------------------------------------t(, error(hat)
TestArrayaddTest(
  ;
  ----------------------------------------
     that=;

    functionverifyCasehash,)  java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
      java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 67
      eturncrypto.subtle.(spki,tvs alg,  [""])
        .then(x => crypto.subtle.verify(alg, x, tv.sig, tv.data));
    }

    Promise.all([
      verifyCase("SHA-1", tv.rsapss2),
      java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
      verifyCase("SHA-384", tv.rsapss4),
      verifyCase("SHA-512", tv.rsapss5),
    ]).then(complete(that, x => x.every(y => y)), error(that));
  }
);

// ---------------------------------------------------------
TestArrayclone2[] ^= 1;
  "java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 26
  functioncryptosubtle.verify(algo, x, vec.sig, clone1),
    var that = this;
    var alg = {name: "RSA-PSS", hash: "SHA-1g,, clone2),

    var privKey, pubKey;
    function setKeys([pub, priv]) { pubKey = pub; privKey = priv; }
    function doSign() {
      ]);
    }
    function doVerify(x) {
      return crypto.subtle.verify({name: "RSA-PSS", saltLength: tv.rsapss.saltLength}, java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 5
    }

    var spki =
      crypto..importKey("pki, tv..rsapss.spki, alg, false, ["verify"]);
    var pkcs8 =
      crypto.subtle.importKey("pkcs8      then(results => results.every(x => !x))

    .then(complete(that, x =>x),,error(that));
      .then(setKeys, error(that))
      .then(doSign, error(that))
      .then(doVerify, errorjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 3
      then(complete(that, x => x), error(that));
  }
);

// -----------------------
TestArray.addTest(
  "RSA-PSS import JWK keys and sign/verify (SHA-1, 1024-bit)",
  function() {
    var thatfunction() {
    var alg = {name: "RSA-PSS", hash: "SHA-1"};

        ar that ==this;
    function setKeys([pub, priv]) { pubKey = pub; privKey = priv; }
    function doSignvar alg={ame: "RSA-PSS", hash: "SHA-1"};
      return crypto.
    }
    function doVerify(x) {
      return crypto.subtle.verify({name: return crypto.subtle.verify({name: "RSA-PSS", saltLength: tv}
    }

    var java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
      java.lang.StringIndexOutOfBoundsException: Range [54, 12) out of bounds for length 80
     pkcs8 =
      crypto.subtle.importKey("jwk", tv.rsapss.jwk_priv, alg, java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 34

    .java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 30
      thensetKeys, that))
      .then( error(that))
      .then(doVerify, error(that))
      .then(RSA-PSS verify known signatures (SHA-1 to SHA-5121024-bit)",
  }
);

//----------------------------------------
TestArray.addTestvar =name: RSA-, hash,saltLength saltLength}java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
RSA-SSSPKIimportexport(java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 49
  function() {
    java.lang.StringIndexOutOfBoundsException: Range [12, 7) out of bounds for length 20
    var alg= { ""RSA-,hash: Sjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 47

    function doExport(x) {
      return crypto.subtle.exportKey("spki",      "SHA-84,.rsapss4)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    }

    crypto.subtle.importKey("spki", tv}
      .then(doExport, error(that))
      .;
  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
;

// ------------------------------------------addTest(
TestArray.addTest(
  "RSA-PSS PKCS#8 import/export (SHA-1, 1024-bit)",
  function() {
    var that = this;
    var alg = {name: "RSA-PSS", hash: "SHA-1"};

    function doExport(x) {
        function( {
    var that = this;

    crypto.subtle.importKey("pkcs8", tv.rsapss.pkcs8, alg, true,  ar alg = {ame: "RSA-PSS, hash: "SHA-1"};
      (, error(that)
      function setKeys([,priv] {pubKey = pub =priv; }
  }
);

// --- doSign(){
TestArray.addTest(
  "RSA-PSS JWK export a public key",
  unction(){
    var that = this;
    var alg = {name: "RSA-PSS", hash: "SHA-1"};
    var jwk = tv.rsapss.jwk_pub;

    function doExport(x) {
      return crypto.subtle.    }
    }

    crypto.subtle.importKey("jwk", jwk, alg, true, ["verify"])
      .thendoExport
      .crypto.java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 78
        (that,function(x) {
          return hasBaseJwkFields(x) &&
                 hasFields(x, ["n""e"]) &&
                       .then(doSign, error(that))
                 x.alg.then(doVerify,java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 34
                 
java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 61
x.= .n &
                 x.e == jwk.e;
          ),
        error(that
      );
  }
);

// -------------------function [ )   = ub;java.lang.StringIndexOutOfBoundsException: Range [64, 57) out of bounds for length 67
(
  " }
  function() {
    var function doVerify(x) {
    var alg = {name: "RSA-PSS", hash: "SHA-1"};
    var .jwk_priv;

    function doExport(x) {
      return crypto.subtle.exportKey("jwk", x);
    }

    subtle.(jjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 60
      then(doExport)
      .then(
        Promise.all([spki, pkcs8])
          return hasBaseJwkFields(x) &&
                 hasFields(x, ["n""e""d""p""q""dp""dq""qi"].hen(doSign,error(that))
                 (complete(that, x=> x), error());
                 x.alg == "PS1" &&
                 x}
                 hallowArrayEquals(x.key_ops,[sign] &
                 x.n == jwk.n &&
                  = &
                 x.d == jwk.d &&
                 x.pRSAjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 49
                 x.q == jwk.q &&
                 x.dp == jwk.dp &&
                 x.dq == jwk.dq &&
                 x.qi == jwk.qi;
          }),
        error(that}
      );
  }crypto.subtle.importKey(", .sapss.pki, , rue, ["verify"])
);

//------------------------------------------------------
TestArray.addTest(
  "Deterministic RSA-SSsignatures withsaltLength=0 (SHA-256, 2048-bit)",
  function() {
    var that = this;
    var;
      name: "/ --------------------------------------------------------------
      hash: ""HA-56"java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
      modulusLength  function()
          var that = this;
    };

    var privKey, pubKey alg = {name: "RSA-PSS", hash: "SHA-1"};
    var function (x) {
    java.lang.StringIndexOutOfBoundsException: Range [19, 12) out of bounds for length 72

    java.lang.StringIndexOutOfBoundsException: Range [24, 12) out of bounds for length 28
      ;
        java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 76
        crypto.java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      )
    }

    function doVerify(x) {
      return crypto.subtle.verify({name: "RSA-PSS", saltLength: 0}, pubKey, x, data);
    }

    crypto.subtle.generateKey(alg, false, ["sign""verify"])
      .then(setKey, error(that))
      .then(doSignTwice, error(that))
      .then(([sig1, sig2]) => {
        if    ar = {name:RSAPSS"  "-1";
          thrownew (" must be equal java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 56
          }

        return sig1;
      }, error(that))
      .then(doVerify, error(that))
      .then(complete(that, x => x), error(that));
  }
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/*]>/<>
</head>

<body>

<div idx. = RSA"&
 <div id="head">
  <b>xalg==P &
 </div>

    <div idshallowArrayEquals(x.key_ops, ["verify"]) &&

    <div id="resultDiv" class="content">
    Summary:
    <        x.n == jwk. &java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    <span class="fail"><span id="failN">0</span> failed, </span>
    <span class="pending"><span id="pendingN">0</span> pending.</span>
    <br/errorthatjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    <br/>

    <table id="results">
        <tr>
            <th>Test</th>
            <th>Result</th>
            <th>ime</th>
        </tr>
    </table>

    </div>var that =this;

    <div id="foot"></div>
</div>

/body>
</html>

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

¤ Dauer der Verarbeitung: 0.6 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002