Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Last update:
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
- web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/0acea989ac/WebCryptoAPI
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/caebe89c3b/WebCryptoAPI
- webidl: https://github.com/web-platform-tests/wpt/tree/63ca529a02/webidl
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions
- webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel
Expand Down
18 changes: 0 additions & 18 deletions test/fixtures/wpt/WebCryptoAPI/derive_bits_keys/argon2.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function define_tests() {
var algorithmName = vector.algorithm;
var password = vector.password;

// Key for normal operations
promises.push(
subtle
.importKey('raw-secret', password, algorithmName, false, [
Expand All @@ -70,20 +69,3 @@ function define_tests() {
});
}
}

function equalBuffers(a, b) {
if (a.byteLength !== b.byteLength) {
return false;
}

var aView = new Uint8Array(a);
var bView = new Uint8Array(b);

for (var i = 0; i < aView.length; i++) {
if (aView[i] !== bView[i]) {
return false;
}
}

return true;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// META: title=WebCryptoAPI: deriveBits() Using Argon2
// META: timeout=long
// META: script=../util/helpers.js
// META: script=/common/subset-tests.js
// META: script=argon2_vectors.js
// META: script=argon2.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ function getTestData() {
// Test vectors from RFC 9106
// https://www.rfc-editor.org/rfc/rfc9106

// Test vectors from RFC 9106
var testVectors = [
// Argon2d test vector
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,37 +224,4 @@ function define_tests(algorithmName) {
.then(function(results) {return {privateKeys: privateKeys, publicKeys: publicKeys, noDeriveBitsKeys: noDeriveBitsKeys, ecdhKeys: ecdhPublicKeys}});
}

// Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is
// omitted, the two values must be the same length and have the same contents
// in every byte. If bitCount is included, only that leading number of bits
// have to match.
function equalBuffers(a, b, bitCount) {
var remainder;

if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

var length = a.byteLength;
if (typeof bitCount !== "undefined") {
length = Math.floor(bitCount / 8);
}

for (var i=0; i<length; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

if (typeof bitCount !== "undefined") {
remainder = bitCount % 8;
return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);
}

return true;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveKey() Using ECDH with CFRG Elliptic Curves
// META: script=../util/helpers.js
// META: script=cfrg_curves_bits_fixtures.js
// META: script=cfrg_curves_bits.js

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveKey() Using ECDH with CFRG Elliptic Curves
// META: script=../util/helpers.js
// META: script=cfrg_curves_bits_fixtures.js
// META: script=cfrg_curves_bits.js

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,37 +221,4 @@ function define_tests(algorithmName) {
.then(function(results) {return {privateKeys: privateKeys, publicKeys: publicKeys, noDeriveKeyKeys: noDeriveKeyKeys, ecdhKeys: ecdhPublicKeys}});
}

// Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is
// omitted, the two values must be the same length and have the same contents
// in every byte. If bitCount is included, only that leading number of bits
// have to match.
function equalBuffers(a, b, bitCount) {
var remainder;

if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

var length = a.byteLength;
if (typeof bitCount !== "undefined") {
length = Math.floor(bitCount / 8);
}

for (var i=0; i<length; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

if (typeof bitCount !== "undefined") {
remainder = bitCount % 8;
return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);
}

return true;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveKey() Using ECDH with CFRG Elliptic Curves
// META: script=../util/helpers.js
// META: script=cfrg_curves_bits_fixtures.js
// META: script=cfrg_curves_keys.js

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveKey() Using ECDH with CFRG Elliptic Curves
// META: script=../util/helpers.js
// META: script=cfrg_curves_bits_fixtures.js
// META: script=cfrg_curves_keys.js

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveBits() tests for the 'length' parameter
// META: script=../util/helpers.js
// META: script=derived_bits_length.js
// META: script=derived_bits_length_vectors.js
// META: script=derived_bits_length_testcases.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveBits() Using ECDH
// META: script=../util/helpers.js
// META: script=ecdh_bits.js

// Define subtests from a `promise_test` to ensure the harness does not
Expand Down
33 changes: 0 additions & 33 deletions test/fixtures/wpt/WebCryptoAPI/derive_bits_keys/ecdh_bits.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,37 +230,4 @@ function define_tests() {
.then(function(results) {return {privateKeys: privateKeys, publicKeys: publicKeys, ecdsaKeyPairs: ecdsaKeyPairs, noDeriveBitsKeys: noDeriveBitsKeys}});
}

// Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is
// omitted, the two values must be the same length and have the same contents
// in every byte. If bitCount is included, only that leading number of bits
// have to match.
function equalBuffers(a, b, bitCount) {
var remainder;

if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

var length = a.byteLength;
if (typeof bitCount !== "undefined") {
length = Math.floor(bitCount / 8);
}

for (var i=0; i<length; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

if (typeof bitCount !== "undefined") {
remainder = bitCount % 8;
return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);
}

return true;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: deriveKey() Using ECDH
// META: script=../util/helpers.js
// META: script=ecdh_keys.js

// Define subtests from a `promise_test` to ensure the harness does not
Expand Down
33 changes: 0 additions & 33 deletions test/fixtures/wpt/WebCryptoAPI/derive_bits_keys/ecdh_keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,37 +209,4 @@ function define_tests() {
.then(function(results) {return {privateKeys: privateKeys, publicKeys: publicKeys, ecdsaKeyPairs: ecdsaKeyPairs, noDeriveKeyKeys: noDeriveKeyKeys}});
}

// Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is
// omitted, the two values must be the same length and have the same contents
// in every byte. If bitCount is included, only that leading number of bits
// have to match.
function equalBuffers(a, b, bitCount) {
var remainder;

if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

var length = a.byteLength;
if (typeof bitCount !== "undefined") {
length = Math.floor(bitCount / 8);
}

for (var i=0; i<length; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

if (typeof bitCount !== "undefined") {
remainder = bitCount % 8;
return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);
}

return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// META: variant=?1001-2000
// META: variant=?2001-3000
// META: variant=?3001-last
// META: script=../util/helpers.js
// META: script=/common/subset-tests.js
// META: script=hkdf_vectors.js
// META: script=hkdf.js
Expand Down
17 changes: 0 additions & 17 deletions test/fixtures/wpt/WebCryptoAPI/derive_bits_keys/hkdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,4 @@ function define_tests() {
});
}

function equalBuffers(a, b) {
if (a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

for (var i=0; i<a.byteLength; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// META: variant=?6001-7000
// META: variant=?7001-8000
// META: variant=?8001-last
// META: script=../util/helpers.js
// META: script=/common/subset-tests.js
// META: script=pbkdf2_vectors.js
// META: script=pbkdf2.js
Expand Down
17 changes: 0 additions & 17 deletions test/fixtures/wpt/WebCryptoAPI/derive_bits_keys/pbkdf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,21 +271,4 @@ function define_tests() {
});
}

function equalBuffers(a, b) {
if (a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

for (var i=0; i<a.byteLength; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

return true;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: digest() cSHAKE algorithms
// META: script=../util/helpers.js
// META: timeout=long

var subtle = crypto.subtle; // Change to test prefixed implementations
Expand Down Expand Up @@ -245,17 +246,3 @@ Object.keys(digestedData).forEach(function (alg) {
});
});
});

function equalBuffers(a, b) {
if (a.byteLength !== b.byteLength) {
return false;
}
var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);
for (var i = 0; i < a.byteLength; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}
return true;
}
31 changes: 1 addition & 30 deletions test/fixtures/wpt/WebCryptoAPI/digest/digest.https.any.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=WebCryptoAPI: digest()
// META: script=../util/helpers.js
// META: timeout=long

var subtle = crypto.subtle; // Change to test prefixed implementations
Expand Down Expand Up @@ -176,33 +177,3 @@


done();


// Returns a copy of the sourceBuffer it is sent.
function copyBuffer(sourceBuffer) {
var source = new Uint8Array(sourceBuffer);
var copy = new Uint8Array(sourceBuffer.byteLength)

for (var i=0; i<source.byteLength; i++) {
copy[i] = source[i];
}

return copy;
}

function equalBuffers(a, b) {
if (a.byteLength !== b.byteLength) {
return false;
}

var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);

for (var i=0; i<a.byteLength; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}

return true;
}
Loading
Loading