Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ea_code.h #228

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions yacl/crypto/primitives/code/ea_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ class ExAccCode : public ExAccCodeInterface {

explicit ExAccCode(uint32_t n, uint32_t m) : n_(n), m_(m) {
YACL_ENFORCE(m >= n);
YACL_ENFORCE(n > d,
"ExAccCode: Dimension should be much greater than Weight");
YACL_ENFORCE(n > d, "ExAccCode: Length should be much greater than Weight");
};

uint32_t GetDimention() const override { return m_; }
Expand All @@ -94,7 +93,7 @@ class ExAccCode : public ExAccCodeInterface {

// Expand Accumulate Code
// dual LPN problem --> G = A * B
// thus, dual encode would be xG = (xA) * B = y * B, y[i] = sum_{j<i} x[i]s
// thus, dual encode would be xG = (xA) * B = y * B, y[i] = sum_{j<=i} x[j]
void DualEncode(absl::Span<uint128_t> in,
absl::Span<uint128_t> out) const override {
DualEncodeImpl<uint128_t>(in, out);
Expand Down Expand Up @@ -134,7 +133,7 @@ class ExAccCode : public ExAccCodeInterface {
YACL_ENFORCE(in.size() >= m_);
YACL_ENFORCE(out.size() >= n_);

// y[i] = sum_{j<=i} x[i]
// y[i] = sum_{j<=i} x[j]
Accumulate<T>(in);
// d-Local Linear Code
Expand<T>(absl::MakeConstSpan(in), out);
Expand All @@ -149,7 +148,7 @@ class ExAccCode : public ExAccCodeInterface {
YACL_ENFORCE(out0.size() >= n_);
YACL_ENFORCE(out1.size() >= n_);

// y[i] = sum_{j<i} x[i]
// y[i] = sum_{j<=i} x[j]
Accumulate<T>(in0);
Accumulate<K>(in1);
// d-Local Linear Code
Expand Down