#include "content/browser/interest_group/additional_bids_util.h"
#include <stdint.h>
#include <array>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include "base/base64.h"
#include "base/containers/flat_set.h"
#include "base/json/json_writer.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "base/types/optional_ref.h"
#include "base/uuid.h"
#include "base/values.h"
#include "content/browser/interest_group/auction_metrics_recorder.h"
#include "content/browser/interest_group/interest_group_auction.h"
#include "content/common/content_export.h"
#include "content/services/auction_worklet/public/mojom/bidder_worklet.mojom-forward.h"
#include "third_party/blink/public/common/interest_group/ad_auction_constants.h"
#include "third_party/blink/public/common/interest_group/ad_display_size.h"
#include "third_party/boringssl/src/include/openssl/curve25519.h"
#include "url/origin.h"
namespace content {
namespace {
template <size_t N>
std::optional<std::string> DecodeBase64Fixed(std::string_view field,
const std::string& in,
std::array<uint8_t, N>& out) { … }
bool AdditionalBidKeyHasMatchingValidSignature(
const std::vector<SignedAdditionalBidSignature>& signatures,
const std::vector<size_t>& valid_signatures,
const blink::InterestGroup::AdditionalBidKey& key) { … }
}
AdditionalBidDecodeResult::AdditionalBidDecodeResult() = default;
AdditionalBidDecodeResult::AdditionalBidDecodeResult(
AdditionalBidDecodeResult&& other) = default;
AdditionalBidDecodeResult::~AdditionalBidDecodeResult() = default;
AdditionalBidDecodeResult& AdditionalBidDecodeResult::operator=(
AdditionalBidDecodeResult&&) = default;
base::expected<AdditionalBidDecodeResult, std::string> DecodeAdditionalBid(
InterestGroupAuction* auction,
const base::Value& bid_in,
const base::Uuid& auction_nonce,
const base::flat_set<url::Origin>& interest_group_buyers,
const url::Origin& seller,
base::optional_ref<const url::Origin> top_level_seller) { … }
SignedAdditionalBid::SignedAdditionalBid() = default;
SignedAdditionalBid::SignedAdditionalBid(SignedAdditionalBid&& other) = default;
SignedAdditionalBid::~SignedAdditionalBid() = default;
SignedAdditionalBid& SignedAdditionalBid::operator=(SignedAdditionalBid&&) =
default;
std::vector<size_t> SignedAdditionalBid::VerifySignatures() { … }
base::expected<SignedAdditionalBid, std::string> DecodeSignedAdditionalBid(
base::Value signed_additional_bid_in) { … }
AdAuctionNegativeTargeter::AdAuctionNegativeTargeter() = default;
AdAuctionNegativeTargeter::~AdAuctionNegativeTargeter() = default;
void AdAuctionNegativeTargeter::AddInterestGroupInfo(
const url::Origin& buyer,
const std::string& name,
const url::Origin& joining_origin,
const blink::InterestGroup::AdditionalBidKey& key) { … }
size_t AdAuctionNegativeTargeter::GetNumNegativeInterestGroups() { … }
bool AdAuctionNegativeTargeter::ShouldDropDueToNegativeTargeting(
const url::Origin& buyer,
const std::optional<url::Origin>& negative_target_joining_origin,
const std::vector<std::string>& negative_target_interest_group_names,
const std::vector<SignedAdditionalBidSignature>& signatures,
const std::vector<size_t>& valid_signatures,
const url::Origin& seller,
AuctionMetricsRecorder& auction_metrics_recorder,
std::vector<std::string>& errors_out) { … }
AdAuctionNegativeTargeter::NegativeInfo::NegativeInfo() = default;
AdAuctionNegativeTargeter::NegativeInfo::~NegativeInfo() = default;
}