LibWeb: Implement WebCrypto AES-CBC generateKey operation

This is progress towards passing more WPT tests, although none of them
gets green due to this commit.
This commit is contained in:
Ben Wiederhake 2024-10-25 10:38:33 +02:00 committed by Andreas Kling
parent 9255a1ac2e
commit d86dcac4f7
Notes: github-actions[bot] 2024-10-26 15:51:32 +00:00
3 changed files with 126 additions and 6 deletions

View file

@ -180,6 +180,36 @@ struct EcKeyGenParams : public AlgorithmParams {
static JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> from_value(JS::VM&, JS::Value);
};
// https://w3c.github.io/webcrypto/#dfn-AesKeyGenParams
struct AesKeyGenParams : public AlgorithmParams {
virtual ~AesKeyGenParams() override;
AesKeyGenParams(String name, u16 length)
: AlgorithmParams(move(name))
, length(length)
{
}
u16 length;
static JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> from_value(JS::VM&, JS::Value);
};
// https://w3c.github.io/webcrypto/#dfn-AesDerivedKeyParams
struct AesDerivedKeyParams : public AlgorithmParams {
virtual ~AesDerivedKeyParams() override;
AesDerivedKeyParams(String name, u16 length)
: AlgorithmParams(move(name))
, length(length)
{
}
u16 length;
static JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> from_value(JS::VM&, JS::Value);
};
class AlgorithmMethods {
public:
virtual ~AlgorithmMethods();