Skip to content

Commit

Permalink
repo-sync-2023-08-03T13:39:51+0800 (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinxc authored Aug 4, 2023
1 parent e108959 commit a1627a6
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# YACL (Yet Another Crypto Library)
# YACL (Yet Another Common crypto Library)

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/secretflow/yacl/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/secretflow/yacl/tree/main)

A C++ library that contains cryptgraphy, network and io modules which other SecretFlow code depends on.
A C++ library that contains common cryptgraphy, network and io modules which other SecretFlow code depends on.

Repo layout:

Expand Down
4 changes: 2 additions & 2 deletions bazel/blake3.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ cc_library(
"c/blake3_neon.c",
],
"//conditions:default": [
"c/blake3_sse2_x86-64_unix.S",
"c/blake3_sse41_x86-64_unix.S",
"c/blake3_avx2_x86-64_unix.S",
"c/blake3_avx512_x86-64_unix.S",
"c/blake3_sse2_x86-64_unix.S",
"c/blake3_sse41_x86-64_unix.S",
],
}),
hdrs = [
Expand Down
5 changes: 4 additions & 1 deletion bazel/libsodium.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ cc_library(
include = ["src/**/*.c"],
) + [":version_h"],
hdrs = glob(["src/**/*.h"] + [":version_h"]),
copts = ["-DCONFIGURED", "-DHAVE_TI_MODE"],
copts = [
"-DCONFIGURED",
"-DHAVE_TI_MODE",
],
includes = [
"src/libsodium/crypto_core/curve25519/ref10",
"src/libsodium/crypto_generichash/blake2b/ref",
Expand Down
4 changes: 2 additions & 2 deletions yacl/crypto/base/aes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ yacl_cc_binary(
srcs = ["aes_bench.cc"],
copts = AES_COPT_FLAGS,
deps = [
"//yacl/crypto/tools:prg",
":aes_opt",
"@com_github_google_benchmark//:benchmark_main",
"//yacl/crypto/tools:prg",
"//yacl/crypto/utils:rand",
"@com_github_google_benchmark//:benchmark_main",
] + select({
"@platforms//cpu:x86_64": [
"@com_github_intel_ipp//:ipp",
Expand Down
4 changes: 2 additions & 2 deletions yacl/crypto/primitives/ot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ yacl_cc_library(
srcs = ["base_ot.cc"],
hdrs = ["base_ot.h"],
deps = [
":portable_ot_interface",
"//yacl/base:exception",
"//yacl/link",
"//yacl/crypto/primitives/ot:ot_store",
"//yacl/link",
"@com_google_absl//absl/types:span",
":portable_ot_interface",
] + select({
"@bazel_tools//src/conditions:linux_x86_64": [
":x86_asm_ot_interface",
Expand Down
8 changes: 4 additions & 4 deletions yacl/crypto/primitives/ot/ferret_ote_rn.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void MpCotRNSend(const std::shared_ptr<link::Context>& ctx,
for (uint64_t i = 0; i < batch_num; ++i) {
const uint64_t this_size =
(i == batch_size - 1) ? full_size - i * batch_size : batch_size;
const auto& cot_slice =
cot.Slice(i * math::Log2Ceil(this_size), (i + 1) * math::Log2Ceil(this_size));
const auto& cot_slice = cot.Slice(i * math::Log2Ceil(this_size),
(i + 1) * math::Log2Ceil(this_size));

FerretGywzOtExtSend(ctx, cot_slice, this_size,
out.subspan(i * batch_size, this_size));
Expand All @@ -59,8 +59,8 @@ void MpCotRNRecv(const std::shared_ptr<link::Context>& ctx,
for (uint64_t i = 0; i < batch_num; ++i) {
const uint64_t this_size =
(i == batch_size - 1) ? full_size - i * batch_size : batch_size;
const auto cot_slice =
cot.Slice(i * math::Log2Ceil(this_size), (i + 1) * math::Log2Ceil(this_size));
const auto cot_slice = cot.Slice(i * math::Log2Ceil(this_size),
(i + 1) * math::Log2Ceil(this_size));
FerretGywzOtExtRecv(ctx, cot_slice, this_size,
out.subspan(i * batch_size, this_size));
}
Expand Down
2 changes: 1 addition & 1 deletion yacl/crypto/primitives/ot/sgrr_ote_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include "yacl/base/exception.h"
#include "yacl/crypto/primitives/ot/ot_store.h"
#include "yacl/math/gadget.h"
#include "yacl/link/test_util.h"
#include "yacl/math/gadget.h"

namespace yacl::crypto {

Expand Down
2 changes: 1 addition & 1 deletion yacl/math/mpint/mp_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

#include "yacl/base/byte_container_view.h"
#include "yacl/base/int128.h"
#include "yacl/math/mpint/tommath_ext_features.h"
#include "yacl/math/mpint/mp_int_enforce.h"
#include "yacl/math/mpint/tommath_ext_features.h"

namespace yacl::math {

Expand Down
2 changes: 1 addition & 1 deletion yacl/math/mpint/mp_int_enforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace fmt {
template <>
struct formatter<mp_err> : ostream_formatter {};
}
} // namespace fmt

#define MPINT_ENFORCE_OK(MP_ERR, ...) \
YACL_ENFORCE_EQ((MP_ERR), MP_OKAY, __VA_ARGS__)
3 changes: 1 addition & 2 deletions yacl/math/mpint/tommath_ext_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ extern "C" {

#include "yacl/base/buffer.h"
#include "yacl/base/exception.h"
#include "yacl/utils/scope_guard.h"

#include "yacl/math/mpint/mp_int_enforce.h"
#include "yacl/utils/scope_guard.h"

namespace yacl::math {

Expand Down
2 changes: 1 addition & 1 deletion yacl/utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ yacl_cc_library(
"matrix_utils.h",
],
deps = [
"//yacl/base:block",
"//yacl/base:byte_container_view",
"//yacl/base:int128",
"//yacl/base:block",
"@com_github_google_cpu_features//:cpu_features",
"@com_google_absl//absl/types:span",
] + select({
Expand Down

0 comments on commit a1627a6

Please sign in to comment.