Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_utils.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/mls/tests/test_utils.html


<!DOCTYPE HTML>
<html>

<head>
  <title>Test for Messaging Layer Security</title>
  <!-- SimpleTest Helpers -->
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <!-- Local Helpers -->
  <script src="head_mls.js"></script>
</head>

<body>
  <pre id="test">
<script class="testbody" type="text/javascript">

  async function test_utils_get_group_identifier_and_epoch() {

    const mls = new MLS();

    // Generate Identities for Alice and Bob
    let alice = await mls.generateIdentity();
    let bob = await mls.generateIdentity();

    // Generate Credentials for Alice and Bob
    let credential_alice = await mls.generateCredential("alice");
    let credential_bob = await mls.generateCredential("bob");

    // Generate a KeyPackage for Bob
    let kp_bob = await mls.generateKeyPackage(bob, credential_bob);

    // Creation of a Group by Alice
    let group_alice = await mls.groupCreate(alice, credential_alice);

    // Test: compare the group identifier to the invalid value
    info("Group Id:", byteArrayToHexString(group_alice.groupId));
    isnot(byteArrayToHexString(group_alice.groupId), """Group Identifier != ''");

    // Alice adds Bob to a group
    let commit_output = await group_alice.add(kp_bob);

    // Test: compare the commit output to the invalid value
    info("Commit Output:", byteArrayToHexString(commit_output.commit));
    isnot(byteArrayToHexString(commit_output.commit), """Commit != ''");

    // Get the group details
    let details = await group_alice.details();
    info("Group Id:", byteArrayToHexString(details.groupId));
    info("Group Epoch:", byteArrayToHexString(details.groupEpoch));

    // Get the group identifier from the commit
    let gid_commit = await mls.getGroupIdFromMessage(commit_output.commit);
    info("Group Id from Commit Message:", byteArrayToHexString(gid_commit.content));

    // Get the group identifier from the commit
    let epoch_commit = await mls.getGroupEpochFromMessage(commit_output.commit);
    info("Group Epoch from Commit Message:", byteArrayToHexString(epoch_commit.content));

    // Note: the following is forbidden because Welcome is not an MLSMessage
    // let gid_welcome = await mls.getGroupIdFromMessage(commit_output.welcome);
    // info("Group Id from Welcome Message:", byteArrayToHexString(gid_welcome.content));

    // Test: compare the group id of the commit to the current group id
    is(byteArrayToHexString(details.groupId), byteArrayToHexString(gid_commit.content));
    // Test: compare the group epoch of the commit to the current group epoch
    is(byteArrayToHexString(details.groupEpoch), byteArrayToHexString(epoch_commit.content));

    // Alice: process her Add commit
    await group_alice.receive(commit_output.commit);

    // Get the group details after processing the commit
    let details2 = await group_alice.details();
    info("Group Epoch 2:", byteArrayToHexString(details2.groupEpoch));

    // Alice: removed Bob
    let commit_output2 = await group_alice.remove(bob);

    // Get the group identifier from the commit
    let gid_commit2 = await mls.getGroupIdFromMessage(commit_output2.commit);
    info("Group Id 2 from Commit Message 2:", byteArrayToHexString(gid_commit2.content));

    // Get the group identifier from the commit2
    let epoch_commit2 = await mls.getGroupEpochFromMessage(commit_output2.commit);
    info("Group Epoch 2 from Commit Message 2:", byteArrayToHexString(epoch_commit2.content));

    // Test: compare the group id of the commit to the current group id
    is(byteArrayToHexString(details2.groupId), byteArrayToHexString(gid_commit2.content));
    // Test: compare the group epoch of the commit to the current group epoch
    is(byteArrayToHexString(details2.groupEpoch), byteArrayToHexString(epoch_commit2.content));

    SimpleTest.finish();
  }

  SimpleTest.waitForExplicitFinish();
  test_utils_get_group_identifier_and_epoch();

</script>
</pre>
</body>

</html>

Messung V0.5 in Prozent
C=89 H=99 G=94

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