Skip to content

Commit

Permalink
repo-sync-2024-01-18T11:14:24+0800 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
usafchn authored Jan 18, 2024
1 parent 1de1811 commit f8664b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

SECRETFLOW_GIT = "https://github.com/secretflow"

YACL_COMMIT_ID = "2d4adb41ed1fb0ce4c0d22c6a1cd6a72fd5b3c5e"
YACL_COMMIT_ID = "7d2f70a34947e25906a2ea4da29708f07eeb8e3a"

git_repository(
name = "yacl",
Expand Down
14 changes: 10 additions & 4 deletions heu/library/spi/poly/poly_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,35 @@ class ElementWisePolyOperator {
virtual void SubModInplace(Polys *polys_1, const Polys &polys_2,
const Moduli &coeff_modulus) const = 0;

// Sub with broadcast
virtual Polys SubMod(const Polys &polys_in,
const std::vector<uint64_t> &scalar_in,
const Moduli &coeff_modulus) const = 0;
virtual void SubModInplace(Polys *polys,
const std::vector<uint64_t> &scalar_in,
const Moduli &coeff_modulus) const = 0;

// Element-wise mul
virtual Polys MulMod(const Polys &in1, const Polys &in2,
const Moduli &coeff_modulus) const = 0;
virtual void MulModInplace(Polys *polys_1, const Polys &polys_2,
const Moduli &coeff_modulus) const = 0;

// Element-wise mul with broadcast
virtual Polys MulMod(const Polys &polys_in,
const std::vector<uint64_t> &scalar_in,
const Moduli &coeff_modulus) const = 0;
virtual void MulModInplace(Polys *polys,
const std::vector<uint64_t> &scalar_in,
const Moduli &coeff_modulus) const = 0;

// move coeff[0] to coeff[offset],
// if offset > 0 do negacyclic shift, otherwise do cyclic shift
virtual Polys Shift(const Polys &in, int64_t offset) const = 0;
virtual void ShiftInplace(Polys *polys, int64_t offset) const = 0;
// permute coefficients
// coeff[offset * i] = sign * coeff[i].
// if offset * i >= N, then sign is -1, otherwise 1
virtual Polys Automorphism(const Polys &in, size_t offset,
const Moduli &coeff_modulus) const = 0;
virtual void AutomorphismInplace(Polys *polys, size_t offset,
const Moduli &coeff_modulus) const = 0;
};

} // namespace heu::lib::spi

0 comments on commit f8664b1

Please sign in to comment.