#include "dpf/internal/evaluate_prg_hwy.h"
#include <algorithm>
#include <cstdint>
#include <memory>
#include <vector>
#include "absl/base/config.h"
#include "absl/base/optimization.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/absl_check.h"
#include "absl/numeric/int128.h"
#include "absl/status/status.h"
#include "absl/types/span.h"
#include "dpf/aes_128_fixed_key_hash.h"
#include "dpf/status_macros.h"
#include "hwy/aligned_allocator.h"
#include "openssl/aes.h"
#undef HWY_TARGET_INCLUDE
#define HWY_TARGET_INCLUDE …
#include "hwy/foreach_target.h"
#include "dpf/internal/aes_128_fixed_key_hash_hwy.h"
#include "hwy/highway.h"
HWY_BEFORE_NAMESPACE(…);
namespace distributed_point_functions {
namespace dpf_internal {
namespace HWY_NAMESPACE {
hn;
#if HWY_TARGET == HWY_SCALAR
absl::Status EvaluateSeedsHwy(
int64_t num_seeds, int num_levels, const absl::uint128* seeds_in,
const bool* control_bits_in, const absl::uint128* paths,
const absl::uint128* correction_seeds, const bool* correction_controls_left,
const bool* correction_controls_right, const Aes128FixedKeyHash& prg_left,
const Aes128FixedKeyHash& prg_right, absl::uint128* seeds_out,
bool* control_bits_out) {
return EvaluateSeedsNoHwy(num_seeds, num_levels, seeds_in, control_bits_in,
paths, correction_seeds, correction_controls_left,
correction_controls_right, prg_left, prg_right,
seeds_out, control_bits_out);
}
#else
template <typename D>
auto MaskFromBools(D d, const bool* input, int max_blocks = 0) { … }
template <typename D, typename M>
void BoolsFromMask(D d, M mask, bool* output, int max_blocks = 0) { … }
template <typename M>
M IfThenElseMask(M condition, M true_value, M false_value) { … }
template <typename V, typename D>
auto IsBitSet(D d, const V input, int index) { … }
struct HWY_ALIGN Aligned128 { … };
absl::Status EvaluateSeedsHwy(
int64_t num_seeds, int num_levels, int num_correction_words,
const absl::uint128* seeds_in, const bool* control_bits_in,
const absl::uint128* paths, int paths_rightshift,
const absl::uint128* correction_seeds, const bool* correction_controls_left,
const bool* correction_controls_right, const Aes128FixedKeyHash& prg_left,
const Aes128FixedKeyHash& prg_right, absl::uint128* seeds_out,
bool* control_bits_out) { … }
#endif
}
}
}
HWY_AFTER_NAMESPACE(…);
#if HWY_ONCE || HWY_IDE
namespace distributed_point_functions {
dpf_internal
}
#endif