Sfoglia il codice sorgente

LibWeb: Rename `EcdhKeyDerivePrams` to `EcdhKeyDeriveParams`

devgianlu 8 mesi fa
parent
commit
6ebc812035

+ 6 - 6
Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp

@@ -588,9 +588,9 @@ JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> AesDerivedKeyParams::from_
     return adopt_own<AlgorithmParams>(*new AesDerivedKeyParams { name, length });
 }
 
-EcdhKeyDerivePrams::~EcdhKeyDerivePrams() = default;
+EcdhKeyDeriveParams::~EcdhKeyDeriveParams() = default;
 
-JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> EcdhKeyDerivePrams::from_value(JS::VM& vm, JS::Value value)
+JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> EcdhKeyDeriveParams::from_value(JS::VM& vm, JS::Value value)
 {
     auto& object = value.as_object();
 
@@ -606,7 +606,7 @@ JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> EcdhKeyDerivePrams::from_v
 
     auto& key = verify_cast<CryptoKey>(*key_object);
 
-    return adopt_own<AlgorithmParams>(*new EcdhKeyDerivePrams { name, key });
+    return adopt_own<AlgorithmParams>(*new EcdhKeyDeriveParams { name, key });
 }
 
 EcKeyImportParams::~EcKeyImportParams() = default;
@@ -2648,7 +2648,7 @@ WebIDL::ExceptionOr<Variant<GC::Ref<CryptoKey>, GC::Ref<CryptoKeyPair>>> ECDH::g
 WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> ECDH::derive_bits(AlgorithmParams const& params, GC::Ref<CryptoKey> key, Optional<u32> length_optional)
 {
     auto& realm = *m_realm;
-    auto const& normalized_algorithm = static_cast<EcdhKeyDerivePrams const&>(params);
+    auto const& normalized_algorithm = static_cast<EcdhKeyDeriveParams const&>(params);
 
     // 1. If the [[type]] internal slot of key is not "private", then throw an InvalidAccessError.
     if (key->type() != Bindings::KeyType::Private)
@@ -4121,7 +4121,7 @@ WebIDL::ExceptionOr<GC::Ref<CryptoKey>> PBKDF2::import_key(AlgorithmParams const
 WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> X25519::derive_bits(AlgorithmParams const& params, GC::Ref<CryptoKey> key, Optional<u32> length_optional)
 {
     auto& realm = *m_realm;
-    auto const& normalized_algorithm = static_cast<EcdhKeyDerivePrams const&>(params);
+    auto const& normalized_algorithm = static_cast<EcdhKeyDeriveParams const&>(params);
 
     // 1. If the [[type]] internal slot of key is not "private", then throw an InvalidAccessError.
     if (key->type() != Bindings::KeyType::Private)
@@ -4620,7 +4620,7 @@ WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> X448::derive_bits(
         return WebIDL::InvalidAccessError::create(m_realm, "Key is not a private key"_string);
 
     // 2. Let publicKey be the public member of normalizedAlgorithm.
-    auto& public_key = static_cast<EcdhKeyDerivePrams const&>(params).public_key;
+    auto& public_key = static_cast<EcdhKeyDeriveParams const&>(params).public_key;
 
     // 3. If the [[type]] internal slot of publicKey is not "public", then throw an InvalidAccessError.
     if (public_key->type() != Bindings::KeyType::Public)

+ 3 - 3
Libraries/LibWeb/Crypto/CryptoAlgorithms.h

@@ -577,10 +577,10 @@ private:
     }
 };
 
-struct EcdhKeyDerivePrams : public AlgorithmParams {
-    virtual ~EcdhKeyDerivePrams() override;
+struct EcdhKeyDeriveParams : public AlgorithmParams {
+    virtual ~EcdhKeyDeriveParams() override;
 
-    EcdhKeyDerivePrams(String name, CryptoKey& public_key)
+    EcdhKeyDeriveParams(String name, CryptoKey& public_key)
         : AlgorithmParams(move(name))
         , public_key(public_key)
     {

+ 3 - 3
Libraries/LibWeb/Crypto/SubtleCrypto.cpp

@@ -807,7 +807,7 @@ SupportedAlgorithmsMap const& supported_algorithms()
     // https://w3c.github.io/webcrypto/#ecdh-registration
     define_an_algorithm<ECDH, EcKeyImportParams>("importKey"_string, "ECDH"_string);
     define_an_algorithm<ECDH>("exportKey"_string, "ECDH"_string);
-    define_an_algorithm<ECDH, EcdhKeyDerivePrams>("deriveBits"_string, "ECDH"_string);
+    define_an_algorithm<ECDH, EcdhKeyDeriveParams>("deriveBits"_string, "ECDH"_string);
     define_an_algorithm<ECDH, EcKeyGenParams>("generateKey"_string, "ECDH"_string);
 
     // https://w3c.github.io/webcrypto/#aes-ctr-registration
@@ -867,13 +867,13 @@ SupportedAlgorithmsMap const& supported_algorithms()
     define_an_algorithm<PBKDF2>("get key length"_string, "PBKDF2"_string);
 
     // https://wicg.github.io/webcrypto-secure-curves/#x25519-registration
-    define_an_algorithm<X25519, EcdhKeyDerivePrams>("deriveBits"_string, "X25519"_string);
+    define_an_algorithm<X25519, EcdhKeyDeriveParams>("deriveBits"_string, "X25519"_string);
     define_an_algorithm<X25519>("generateKey"_string, "X25519"_string);
     define_an_algorithm<X25519>("importKey"_string, "X25519"_string);
     define_an_algorithm<X25519>("exportKey"_string, "X25519"_string);
 
     // https://wicg.github.io/webcrypto-secure-curves/#x448-registration
-    define_an_algorithm<X448, EcdhKeyDerivePrams>("deriveBits"_string, "X448"_string);
+    define_an_algorithm<X448, EcdhKeyDeriveParams>("deriveBits"_string, "X448"_string);
     define_an_algorithm<X448>("generateKey"_string, "X448"_string);
     define_an_algorithm<X448>("importKey"_string, "X448"_string);
     define_an_algorithm<X448>("exportKey"_string, "X448"_string);