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

Fix typos in ferret_ote #253

Merged
merged 13 commits into from
Feb 1, 2024
17 changes: 8 additions & 9 deletions yacl/crypto/primitives/ot/ferret_ote_un.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ inline std::unique_ptr<FerretSimpleMap> MakeSimpleMap(
// Multi-Point Correlated OT ("length") Extension Implementation
//
// This implementation bases on Ferret, for more theoretical details, see
// https://eprint.iacr.org/2020/924.pdf, section 4, figure 6.
// https://eprint.iacr.org/2020/924.pdf, section 4, figure 7.
//
// +---------+ +------------+
// | COT | => | MP-COT |
Expand Down Expand Up @@ -122,10 +122,9 @@ inline void MpCotUNSend(const std::shared_ptr<link::Context>& ctx,
const auto spot_option = math::Log2Ceil(spcot_range_n);

s[i].resize(spcot_range_n);
auto cot_slice =
cot.Slice(slice_begin, slice_begin + math::Log2Ceil(spcot_range_n));
GywzOtExtSend(ctx, cot_slice, spot_option, absl::MakeSpan(s[i]));
slice_begin += math::Log2Ceil(spcot_range_n);
auto cot_slice = cot.Slice(slice_begin, slice_begin + spot_option);
GywzOtExtSend(ctx, cot_slice, spcot_range_n, absl::MakeSpan(s[i]));
slice_begin += spot_option;
}

// calculate the final result for each bin
Expand Down Expand Up @@ -173,10 +172,10 @@ inline void MpCotUNRecv(const std::shared_ptr<link::Context>& ctx,

r[i].resize(spcot_range_n);

auto cot_slice =
cot.Slice(slice_begin, slice_begin + math::Log2Ceil(spcot_range_n));
GywzOtExtRecv(ctx, cot_slice, spot_option, spcot_idx, absl::MakeSpan(r[i]));
slice_begin += math::Log2Ceil(spcot_range_n);
auto cot_slice = cot.Slice(slice_begin, slice_begin + spot_option);
GywzOtExtRecv(ctx, cot_slice, spcot_range_n, spcot_idx,
absl::MakeSpan(r[i]));
slice_begin += spot_option;
}

// calculate the final result for each (non-empty) bin
Expand Down
Loading