|
@@ -201,51 +201,18 @@ struct RDPFTriple {
|
|
|
node descend(const node &parent, nbits_t parentdepth,
|
|
|
bit_t whichchild, size_t &op_counter) const;
|
|
|
|
|
|
- // Additive share of the scaling value M_as such that the high words
|
|
|
- // of the leaf values for P0 and P1 add to M_as * e_{target}
|
|
|
- inline std::tuple<RegAS,RegAS,RegAS> scaled_sum() const {
|
|
|
- return std::make_tuple(dpf[0].scaled_sum, dpf[1].scaled_sum,
|
|
|
- dpf[2].scaled_sum);
|
|
|
- }
|
|
|
+ // Templated versions of functions to get DPF components and outputs
|
|
|
+ // so that the appropriate one can be selected with a template
|
|
|
+ // parameter
|
|
|
|
|
|
- // XOR share of the scaling value M_xs such that the high words
|
|
|
- // of the leaf values for P0 and P1 XOR to M_xs * e_{target}
|
|
|
- inline std::tuple<RegXS,RegXS,RegXS> scaled_xor() const {
|
|
|
- return std::make_tuple(dpf[0].scaled_xor, dpf[1].scaled_xor,
|
|
|
- dpf[2].scaled_xor);
|
|
|
- }
|
|
|
+ template <typename T>
|
|
|
+ inline std::tuple<T,T,T> scaled_value() const;
|
|
|
|
|
|
- // Get the bit-shared unit vector entry from the leaf node
|
|
|
- inline std::tuple<RegBS,RegBS,RegBS> unit_bs(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].unit_bs(std::get<0>(leaf)),
|
|
|
- dpf[1].unit_bs(std::get<1>(leaf)),
|
|
|
- dpf[2].unit_bs(std::get<2>(leaf)));
|
|
|
- }
|
|
|
+ template <typename T>
|
|
|
+ inline std::tuple<T,T,T> unit(node leaf) const;
|
|
|
|
|
|
- // Get the additive-shared unit vector entry from the leaf node
|
|
|
- inline std::tuple<RegAS,RegAS,RegAS> unit_as(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].unit_as(std::get<0>(leaf)),
|
|
|
- dpf[1].unit_as(std::get<1>(leaf)),
|
|
|
- dpf[2].unit_as(std::get<2>(leaf)));
|
|
|
- }
|
|
|
-
|
|
|
- // Get the XOR-shared scaled vector entry from the leaf ndoe
|
|
|
- inline std::tuple<RegXS,RegXS,RegXS> scaled_xs(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].scaled_xs(std::get<0>(leaf)),
|
|
|
- dpf[1].scaled_xs(std::get<1>(leaf)),
|
|
|
- dpf[2].scaled_xs(std::get<2>(leaf)));
|
|
|
- }
|
|
|
-
|
|
|
- // Get the additive-shared scaled vector entry from the leaf node
|
|
|
- inline std::tuple<RegAS,RegAS,RegAS> scaled_as(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].scaled_as(std::get<0>(leaf)),
|
|
|
- dpf[1].scaled_as(std::get<1>(leaf)),
|
|
|
- dpf[2].scaled_as(std::get<2>(leaf)));
|
|
|
- }
|
|
|
+ template <typename T>
|
|
|
+ inline std::tuple<T,T,T> scaled(node leaf) const;
|
|
|
};
|
|
|
|
|
|
struct RDPFPair {
|
|
@@ -288,45 +255,19 @@ struct RDPFPair {
|
|
|
node descend(const node &parent, nbits_t parentdepth,
|
|
|
bit_t whichchild, size_t &op_counter) const;
|
|
|
|
|
|
- // Additive share of the scaling value M_as such that the high words
|
|
|
- // of the leaf values for P0 and P1 add to M_as * e_{target}
|
|
|
- inline std::tuple<RegAS,RegAS> scaled_sum() const {
|
|
|
- return std::make_tuple(dpf[0].scaled_sum, dpf[1].scaled_sum);
|
|
|
- }
|
|
|
-
|
|
|
- // XOR share of the scaling value M_xs such that the high words
|
|
|
- // of the leaf values for P0 and P1 XOR to M_xs * e_{target}
|
|
|
- inline std::tuple<RegXS,RegXS> scaled_xor() const {
|
|
|
- return std::make_tuple(dpf[0].scaled_xor, dpf[1].scaled_xor);
|
|
|
- }
|
|
|
+ // Templated versions of functions to get DPF components and outputs
|
|
|
+ // so that the appropriate one can be selected with a template
|
|
|
+ // parameter
|
|
|
|
|
|
- // Get the bit-shared unit vector entry from the leaf node
|
|
|
- inline std::tuple<RegBS,RegBS> unit_bs(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].unit_bs(std::get<0>(leaf)),
|
|
|
- dpf[1].unit_bs(std::get<1>(leaf)));
|
|
|
- }
|
|
|
+ template <typename T>
|
|
|
+ inline std::tuple<T,T> scaled_value() const;
|
|
|
|
|
|
- // Get the additive-shared unit vector entry from the leaf node
|
|
|
- inline std::tuple<RegAS,RegAS> unit_as(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].unit_as(std::get<0>(leaf)),
|
|
|
- dpf[1].unit_as(std::get<1>(leaf)));
|
|
|
- }
|
|
|
+ template <typename T>
|
|
|
+ inline std::tuple<T,T> unit(node leaf) const;
|
|
|
|
|
|
- // Get the XOR-shared scaled vector entry from the leaf ndoe
|
|
|
- inline std::tuple<RegXS,RegXS> scaled_xs(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].scaled_xs(std::get<0>(leaf)),
|
|
|
- dpf[1].scaled_xs(std::get<1>(leaf)));
|
|
|
- }
|
|
|
+ template <typename T>
|
|
|
+ inline std::tuple<T,T> scaled(node leaf) const;
|
|
|
|
|
|
- // Get the additive-shared scaled vector entry from the leaf node
|
|
|
- inline std::tuple<RegAS,RegAS> scaled_as(node leaf) const {
|
|
|
- return std::make_tuple(
|
|
|
- dpf[0].scaled_as(std::get<0>(leaf)),
|
|
|
- dpf[1].scaled_as(std::get<1>(leaf)));
|
|
|
- }
|
|
|
};
|
|
|
|
|
|
#include "rdpf.tcc"
|