Skip to content

Commit ed51ad3

Browse files
authored
build: switch yacl examples to bzlmod (#495)
* bzlmod: switch examples to bzlmod * update po * fix path in hesm2 readme
1 parent 635541f commit ed51ad3

File tree

15 files changed

+1460
-148
lines changed

15 files changed

+1460
-148
lines changed

.bazeliskrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
USE_BAZEL_VERSION=7.4.1
1+
USE_BAZEL_VERSION=7.5.0
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2022-2024 Ant Group Co., Ltd
3+
# This file is distributed under the same license as the YACL package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: YACL \n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2025-03-11 10:28+0800\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language: zh_CN\n"
15+
"Language-Team: zh_CN <[email protected]>\n"
16+
"Plural-Forms: nplurals=1; plural=0;\n"
17+
"MIME-Version: 1.0\n"
18+
"Content-Type: text/plain; charset=utf-8\n"
19+
"Content-Transfer-Encoding: 8bit\n"
20+
"Generated-By: Babel 2.17.0\n"
21+
22+
#: ../../index.rst:18
23+
msgid "Contents"
24+
msgstr ""
25+
26+
#: ../../index.rst:2
27+
msgid "YACL Documentation"
28+
msgstr ""
29+
30+
#: ../../index.rst:4
31+
msgid ""
32+
"YACL (Yet Another Common Cryptography Library) is a sub-project of "
33+
"`SecretFlow <https://github.com/secretflow/>`_, it is a C++ library that "
34+
"provides cryptography, network and io modules for other SecretFlow "
35+
"repositories. Yacl is designed to be a **low-level** library that could "
36+
"be either integrated into a big **secure system**, or used in a "
37+
"standalone way for a **quick POC** (see: `Develop "
38+
"<src/develop/index.html>`_), or even help with your "
39+
"**security/cryptography research** (see: `Research "
40+
"<src/research/index.html>`_)."
41+
msgstr ""
42+
43+
#: ../../index.rst:6
44+
msgid ""
45+
"**About Cryptography Modules:** The crypto modules in Yacl implement many"
46+
" state-of-art secure computation protocols, including primitives like OT,"
47+
" VOLE, TPRE, and tools like PRG, RO. Check the full list of Yacl's "
48+
"`supported algorithms list <src/algorithms.html>`_."
49+
msgstr ""
50+
51+
#: ../../index.rst:7
52+
msgid ""
53+
"**About Network (\"link\") Modules:** The network (\"link\") module in "
54+
"Yacl uses `BRPC <https://brpc.apache.org/>`_ to handle network. And we "
55+
"also provide a \"mocked\" in-memory link."
56+
msgstr ""
57+
58+
#: ../../index.rst:8
59+
msgid ""
60+
"**About IO Modules:** Yacl also provides many io modules for kv storage, "
61+
"file io, `bristol circuits <https://nigelsmart.github.io/MPC-"
62+
"Circuits/>`_, and so on."
63+
msgstr ""
64+
65+
#: ../../index.rst:10
66+
msgid "The following parts describes the top-level folders of Yacl repository."
67+
msgstr ""
68+
69+
#: ../../index.rst:12
70+
msgid ""
71+
"`yacl/base/ <https://github.com/secretflow/yacl/tree/main/yacl/base>`_: "
72+
"some basic types and utils in yacl."
73+
msgstr ""
74+
75+
#: ../../index.rst:13
76+
msgid ""
77+
"`yacl/crypto/ "
78+
"<https://github.com/secretflow/yacl/tree/main/yacl/crypto>`_: crypto "
79+
"algorithm without link."
80+
msgstr ""
81+
82+
#: ../../index.rst:14
83+
msgid ""
84+
"`yacl/kernel/ "
85+
"<https://github.com/secretflow/yacl/tree/main/yacl/kernel>`_: crypto "
86+
"kernel that includes link with (WIP) multi-thread support, i.e. OT, DPF."
87+
msgstr ""
88+
89+
#: ../../index.rst:15
90+
msgid ""
91+
"`yacl/io/ <https://github.com/secretflow/yacl/tree/main/yacl/io>`_: a "
92+
"simple streaming-based io library."
93+
msgstr ""
94+
95+
#: ../../index.rst:16
96+
msgid ""
97+
"`yacl/link/ <https://github.com/secretflow/yacl/tree/main/yacl/link>`_: a"
98+
" simple rpc-based MPI framework, providing the `SPMD "
99+
"<https://en.wikipedia.org/wiki/SPMD>`_ parallel programming capability."
100+
msgstr ""
101+
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Translations template for PROJECT.
2+
# Copyright (C) 2025 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2025-03-11 10:28+0800\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <[email protected]>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 2.17.0\n"
19+
20+
#: ../../src/develop/example_psi.rst:2
21+
msgid "Example: Build a PSI Protocol"
22+
msgstr ""
23+
24+
#: ../../src/develop/example_psi.rst:4
25+
msgid ""
26+
"This is an example of how to use Yacl's ECC api and link to build up a "
27+
"`PSI (Private Set Intersection) "
28+
"<https://en.wikipedia.org/wiki/Private_set_intersection>`_ protocol. The "
29+
"code of this example is avaliable at `link "
30+
"<https://github.com/secretflow/yacl/tree/main/examples/psi/cpp>`_."
31+
msgstr ""
32+
33+
#: ../../src/develop/example_psi.rst:7
34+
msgid ""
35+
"This example is merely designed for demonstration only, please do not use"
36+
" this example in production."
37+
msgstr ""
38+
39+
#: ../../src/develop/example_psi.rst:10
40+
msgid "Step 1: Understand ECDH-PSI"
41+
msgstr ""
42+
43+
#: ../../src/develop/example_psi.rst:12
44+
msgid ""
45+
"Before we start, the ECDH-PSI protocols are formally designed as the "
46+
"following, where lambda indicates the computational security parameter, "
47+
"and H() indicates a cryptographically secure (collision-free) hash "
48+
"function."
49+
msgstr ""
50+
51+
#: ../../src/develop/example_psi.rst:-1
52+
msgid "Alternative text"
53+
msgstr ""
54+
55+
#: ../../src/develop/example_psi.rst:23
56+
msgid "Step 2: Implement Protocol"
57+
msgstr ""
58+
59+
#: ../../src/develop/example_psi.rst:25
60+
msgid ""
61+
"We provide the implementation in the following codes. Note that it's "
62+
"almost always a good idea to separate the definitions and implementations"
63+
" into ``*.h`` and ``*.cc`` files."
64+
msgstr ""
65+
66+
#: ../../src/develop/example_psi.rst:33
67+
msgid ""
68+
"Besides the two files, you also need to write a `BUILD.bazel` file to "
69+
"tell `bazel` how to compile your files together."
70+
msgstr ""
71+
72+
#: ../../src/develop/example_psi.rst:62
73+
msgid "Step 2: Write and Run Tests"
74+
msgstr ""
75+
76+
#: ../../src/develop/example_psi.rst:64
77+
msgid ""
78+
"Also, we recommend all users to write unit tests for implementations. In "
79+
"oder to run the following tests, you can ``cd examples && bazel test "
80+
"//psi/cpp:ecdh_psi_test``."
81+
msgstr ""
82+
83+
#: ../../src/develop/example_psi.rst:70
84+
msgid "Step 3: Generate Executables and Run with CSV files"
85+
msgstr ""
86+
87+
#: ../../src/develop/example_psi.rst:72
88+
msgid ""
89+
"Also, alternatively you can build an executable for two users to actually"
90+
" run the PSI protocols with their private data. We show an example "
91+
"``main.cc`` file in the below."
92+
msgstr ""
93+
94+
#: ../../src/develop/example_psi.rst:77
95+
msgid ""
96+
"In order to compile, run ``bazel build //psi/cpp:ecdh_psi_main -c opt``. "
97+
"The ``-c opt`` flag tells the bazel build system to build a release (or, "
98+
"optimized) version of the executable."
99+
msgstr ""
100+
101+
#: ../../src/develop/example_psi.rst:79
102+
msgid "To run the exeutable, open two terminals in the same machine."
103+
msgstr ""
104+
105+
#: ../../src/develop/example_psi.rst:83
106+
msgid "Please make sure your machine's 10086 and 10087 ports are avaliable."
107+
msgstr ""
108+
109+
#: ../../src/develop/example_psi.rst:85
110+
msgid "In the first terminal, at yacl's project root, run"
111+
msgstr ""
112+
113+
#: ../../src/develop/example_psi.rst:92
114+
msgid "Then in the second terminal, at yacl's project root, run"
115+
msgstr ""
116+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2022-2024 Ant Group Co., Ltd
3+
# This file is distributed under the same license as the YACL package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: YACL \n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2025-03-11 10:28+0800\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language: zh_CN\n"
15+
"Language-Team: zh_CN <[email protected]>\n"
16+
"Plural-Forms: nplurals=1; plural=0;\n"
17+
"MIME-Version: 1.0\n"
18+
"Content-Type: text/plain; charset=utf-8\n"
19+
"Content-Transfer-Encoding: 8bit\n"
20+
"Generated-By: Babel 2.17.0\n"
21+
22+
#: ../../src/develop/example_psi_java.rst:2
23+
msgid "Example: Bind PSI to Java"
24+
msgstr ""
25+
26+
#: ../../src/develop/example_psi_java.rst:4
27+
msgid ""
28+
"This is an example of how to use Yacl's ECC api and link to build up a "
29+
"`PSI (Private Set Intersection) "
30+
"<https://en.wikipedia.org/wiki/Private_set_intersection>`_ protocol, and "
31+
"provide a java language binding using JNI. The code of this example is "
32+
"avaliable on `Github "
33+
"<https://github.com/secretflow/yacl/tree/main/examples/psi/java>`_."
34+
msgstr ""
35+
36+
#: ../../src/develop/example_psi_java.rst:7
37+
msgid ""
38+
"This example is merely designed for demonstration only, please do not use"
39+
" this example in production."
40+
msgstr ""
41+
42+
#: ../../src/develop/example_psi_java.rst:10
43+
msgid "Step 1: Implement"
44+
msgstr ""
45+
46+
#: ../../src/develop/example_psi_java.rst:19
47+
msgid "Step 2: Build and Test"
48+
msgstr ""
49+

0 commit comments

Comments
 (0)