#include <stddef.h>
#include <stdint.h>
#include "base/strings/string_number_conversions.h"
#include "components/webcrypto/algorithm_dispatch.h"
#include "components/webcrypto/algorithms/test_helpers.h"
#include "components/webcrypto/jwk.h"
#include "components/webcrypto/status.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/web_crypto_algorithm_params.h"
#include "third_party/blink/public/platform/web_crypto_key.h"
#include "third_party/blink/public/platform/web_crypto_key_algorithm.h"
namespace webcrypto {
namespace {
blink::WebCryptoAlgorithm CreateRsaPssAlgorithm(
unsigned int salt_length_bytes) { … }
class WebCryptoRsaPssTest : public WebCryptoTestBase { … };
TEST_F(WebCryptoRsaPssTest, SignIsRandom) { … }
TEST_F(WebCryptoRsaPssTest, SignVerifyNoSalt) { … }
TEST_F(WebCryptoRsaPssTest, SignEmptyMessage) { … }
const char kKey1[] = …;
const char kKey2[] = …;
const char kNistTestMessage[] = …;
struct RsaPssKnownAnswer { … };
const RsaPssKnownAnswer kRsaPssKnownAnswers[] = …;
blink::WebCryptoKey RsaPssKeyFromBytes(blink::WebCryptoAlgorithmId hash,
const char* key) { … }
bool VerifySignature(size_t salt_length,
blink::WebCryptoKey pubkey,
const std::vector<uint8_t>& signature,
const std::vector<uint8_t>& message) { … }
TEST_F(WebCryptoRsaPssTest, VerifyKnownAnswer) { … }
}
}