@@ -57,16 +57,20 @@ static ::Crypto::UnsignedBigInteger big_integer_from_api_big_integer(JS::GCPtr<J
57
57
return result;
58
58
}
59
59
60
+ AlgorithmParams::~AlgorithmParams () = default ;
61
+
60
62
JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> AlgorithmParams::from_value (JS::VM& vm, JS::Value value)
61
63
{
62
64
auto & object = value.as_object ();
63
65
64
66
auto name = TRY (object.get (" name" ));
65
67
auto name_string = TRY (name.to_string (vm));
66
68
67
- return adopt_own (*new AlgorithmParams { . name = name_string });
69
+ return adopt_own (*new AlgorithmParams { name_string });
68
70
}
69
71
72
+ PBKDF2Params::~PBKDF2Params () = default ;
73
+
70
74
JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> PBKDF2Params::from_value (JS::VM& vm, JS::Value value)
71
75
{
72
76
auto & realm = *vm.current_realm ();
@@ -96,9 +100,11 @@ JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> PBKDF2Params::from_value(J
96
100
hash = HashAlgorithmIdentifier { hash_object };
97
101
}
98
102
99
- return adopt_own<AlgorithmParams>(*new PBKDF2Params { { name } , salt, iterations, hash.downcast <HashAlgorithmIdentifier>() });
103
+ return adopt_own<AlgorithmParams>(*new PBKDF2Params { name, salt, iterations, hash.downcast <HashAlgorithmIdentifier>() });
100
104
}
101
105
106
+ RsaKeyGenParams::~RsaKeyGenParams () = default ;
107
+
102
108
JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> RsaKeyGenParams::from_value (JS::VM& vm, JS::Value value)
103
109
{
104
110
auto & object = value.as_object ();
@@ -117,9 +123,11 @@ JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> RsaKeyGenParams::from_valu
117
123
118
124
public_exponent = static_cast <JS::Uint8Array&>(public_exponent_value.as_object ());
119
125
120
- return adopt_own<AlgorithmParams>(*new RsaKeyGenParams { { name } , modulus_length, big_integer_from_api_big_integer (public_exponent) });
126
+ return adopt_own<AlgorithmParams>(*new RsaKeyGenParams { name, modulus_length, big_integer_from_api_big_integer (public_exponent) });
121
127
}
122
128
129
+ RsaHashedKeyGenParams::~RsaHashedKeyGenParams () = default ;
130
+
123
131
JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> RsaHashedKeyGenParams::from_value (JS::VM& vm, JS::Value value)
124
132
{
125
133
auto & object = value.as_object ();
@@ -148,7 +156,7 @@ JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> RsaHashedKeyGenParams::fro
148
156
hash = HashAlgorithmIdentifier { hash_object };
149
157
}
150
158
151
- return adopt_own<AlgorithmParams>(*new RsaHashedKeyGenParams { { { name } , modulus_length, big_integer_from_api_big_integer (public_exponent) } , hash.get <HashAlgorithmIdentifier>() });
159
+ return adopt_own<AlgorithmParams>(*new RsaHashedKeyGenParams { name, modulus_length, big_integer_from_api_big_integer (public_exponent), hash.get <HashAlgorithmIdentifier>() });
152
160
}
153
161
154
162
// https://w3c.github.io/webcrypto/#rsa-oaep-operations
0 commit comments