chromium/components/web_package/test_support/signed_web_bundles/ecdsa_p256_key_pair.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/web_package/test_support/signed_web_bundles/ecdsa_p256_key_pair.h"

#include "base/check_is_test.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "crypto/sha2.h"
#include "third_party/boringssl/src/include/openssl/ec_key.h"
#include "third_party/boringssl/src/include/openssl/ecdsa.h"
#include "third_party/boringssl/src/include/openssl/mem.h"

namespace web_package::test {
namespace {
// Nonce for obtaining deterministic ECDSA P-256 SHA-256 signatures. Taken from
// third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt.
constexpr std::string_view kEcdsaP256SHA256NonceForTestingOnly =;
}  // namespace

// static
EcdsaP256KeyPair EcdsaP256KeyPair::CreateRandom(
    bool produce_invalid_signature) {}

EcdsaP256KeyPair::EcdsaP256KeyPair(
    base::span<const uint8_t, EcdsaP256PublicKey::kLength> public_key_bytes,
    base::span<const uint8_t, 32> private_key_bytes,
    bool produce_invalid_signature)
    :{}

EcdsaP256KeyPair::EcdsaP256KeyPair(const EcdsaP256KeyPair&) = default;
EcdsaP256KeyPair& EcdsaP256KeyPair::operator=(const EcdsaP256KeyPair&) =
    default;

EcdsaP256KeyPair::EcdsaP256KeyPair(EcdsaP256KeyPair&&) noexcept = default;
EcdsaP256KeyPair& EcdsaP256KeyPair::operator=(EcdsaP256KeyPair&&) noexcept =
    default;

EcdsaP256KeyPair::~EcdsaP256KeyPair() = default;

std::vector<uint8_t> SignMessage(base::span<const uint8_t> message,
                                 const EcdsaP256KeyPair& key_pair) {}
}  // namespace web_package::test