#include <stddef.h>
#include "base/numerics/safe_math.h"
#include "components/webcrypto/algorithms/rsa_sign.h"
#include "components/webcrypto/algorithms/util.h"
#include "components/webcrypto/blink_key_handle.h"
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
#include "third_party/blink/public/platform/web_crypto_key_algorithm.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/rsa.h"
namespace webcrypto {
namespace {
Status GetPKeyAndDigest(const blink::WebCryptoKey& key,
EVP_PKEY** pkey,
const EVP_MD** digest) { … }
Status ApplyRsaPssOptions(const blink::WebCryptoKey& key,
const EVP_MD* const mgf_digest,
unsigned int salt_length_bytes,
EVP_PKEY_CTX* pctx) { … }
}
Status RsaSign(const blink::WebCryptoKey& key,
unsigned int pss_salt_length_bytes,
base::span<const uint8_t> data,
std::vector<uint8_t>* buffer) { … }
Status RsaVerify(const blink::WebCryptoKey& key,
unsigned int pss_salt_length_bytes,
base::span<const uint8_t> signature,
base::span<const uint8_t> data,
bool* signature_match) { … }
}