chromium/third_party/distributed_point_functions/code/dpf/internal/proto_validator.cc

// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "dpf/internal/proto_validator.h"

#include <algorithm>
#include <cmath>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "absl/container/flat_hash_map.h"
#include "absl/log/absl_check.h"
#include "absl/memory/memory.h"
#include "absl/numeric/int128.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/types/span.h"
#include "dpf/distributed_point_function.pb.h"
#include "dpf/internal/value_type_helpers.h"
#include "dpf/status_macros.h"
#include "google/protobuf/repeated_field.h"

namespace distributed_point_functions {
namespace dpf_internal {

namespace {

inline double GetDefaultSecurityParameter(const DpfParameters& parameters) {}

inline bool AlmostEqual(double a, double b) {}

absl::StatusOr<bool> ParametersAreEqual(const DpfParameters& lhs,
                                        const DpfParameters& rhs) {}

absl::Status ValidateIntegerType(const ValueType::Integer& type) {}

absl::Status ValidateIntegerValue(const Value::Integer& value,
                                  const ValueType::Integer& type) {}

}  // namespace

ProtoValidator::ProtoValidator(std::vector<DpfParameters> parameters,
                               int tree_levels_needed,
                               absl::flat_hash_map<int, int> tree_to_hierarchy,
                               std::vector<int> hierarchy_to_tree)
    :{}

absl::StatusOr<std::unique_ptr<ProtoValidator>> ProtoValidator::Create(
    absl::Span<const DpfParameters> parameters_in) {}

absl::Status ProtoValidator::ValidateParameters(
    absl::Span<const DpfParameters> parameters) {}

absl::Status ProtoValidator::ValidateDpfKey(const DpfKey& key) const {}

absl::Status ProtoValidator::ValidateEvaluationContext(
    const EvaluationContext& ctx) const {}

absl::Status ProtoValidator::ValidateValueType(const ValueType& value_type) {}

absl::Status ProtoValidator::ValidateValue(const Value& value,
                                           const ValueType& type) {}

}  // namespace dpf_internal
}  // namespace distributed_point_functions