#include <stddef.h>
#include <stdint.h>
#include "base/containers/span.h"
#include "components/webcrypto/algorithm_dispatch.h"
#include "components/webcrypto/algorithms/test_helpers.h"
#include "components/webcrypto/status.h"
#include "third_party/blink/public/platform/web_crypto_algorithm_params.h"
#include "third_party/blink/public/platform/web_crypto_key_algorithm.h"
namespace webcrypto {
namespace {
blink::WebCryptoAlgorithm CreateAesCtrAlgorithm(
const std::vector<uint8_t>& counter,
uint8_t length_bits) { … }
blink::WebCryptoKey AesCtrKeyFromBytes(const std::vector<uint8_t>& bytes) { … }
class WebCryptoAesCtrTest : public WebCryptoTestBase { … };
struct AesCtrKnownAnswer { … };
const char k128BitTestKey[] = …;
const char k256BitTestKey[] = …;
const AesCtrKnownAnswer kAesCtrKnownAnswers[] = …;
TEST_F(WebCryptoAesCtrTest, EncryptDecryptKnownAnswer) { … }
TEST_F(WebCryptoAesCtrTest, InvalidCounterBlockLength) { … }
TEST_F(WebCryptoAesCtrTest, InvalidCounterLength) { … }
TEST_F(WebCryptoAesCtrTest, OverflowAndRepeatCounter) { … }
}
}