Skip to content

Commit

Permalink
repo-sync-2024-09-26T11:38:23+0800 (#391)
Browse files Browse the repository at this point in the history
* repo-sync-2024-09-26T11:38:23+0800

* Update .licenserc.yaml

* Update .licenserc.yaml

* Update continue-config.yml
  • Loading branch information
Jamie-Cui authored Sep 26, 2024
1 parent 8cd686d commit d33801a
Show file tree
Hide file tree
Showing 54 changed files with 1,748 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .circleci/continue-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ commands:
command: |
set +e
declare -i test_status
bazel test //... -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors --jobs 16 | tee test_result.log; test_status=${PIPESTATUS[0]}
bazel test //yacl/... -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors --jobs 16 | tee test_result.log; test_status=${PIPESTATUS[0]}
git clone https://github.com/secretflow/devtools.git
sh devtools/rename-junit-xml.sh
Expand Down
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ header: # <1>
- '**/*.patch'
- '**/*.lds'
- '**/*.csv'
- '**/*.rst'
- 'LICENSE'
- 'NOTICE'
- '.bazelversion'
Expand All @@ -43,6 +44,7 @@ header: # <1>
- 'yacl/crypto/aes/aes_intrinsics.h'
- 'yacl/crypto/aes/aes_opt.h'
- 'yacl/io/circuit/data/**.txt'
- 'docs/requirements.txt'

comment: never # <9>

Expand Down
70 changes: 28 additions & 42 deletions ALGORITHMS.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,91 @@
# Supported Advanced Crypto Algorithms
# Algorithm List

## Oblivious Transfer and Extensions
In this part, we provide a comprehensive list of the algorithms that yacl implements.

**Oblivious Transfer and Extensions**

- The Simplest Protocol for Oblivious Transfer\
*Tung Chou, Claudio Orlandi*\
LatinCrypt 2015, [eprint](https://eprint.iacr.org/2015/267), CO15
LatinCrypt 2015, [CO15](https://eprint.iacr.org/2015/267)

- Extending Oblivious Transfers Efficiently\
*Yuval Ishai, Joe Kilian, Kobbi Nissim, Erez Petrank*\
Crypto 2003, [eprint](https://www.iacr.org/archive/crypto2003/27290145/27290145.pdf), IKNP03
Crypto 2003, [IKNP03](https://www.iacr.org/archive/crypto2003/27290145/27290145.pdf)

- Actively Secure OT Extension with Optimal Overhead\
*Marcel Keller, Emmanuela Orsini, Peter Scholl*\
Crypto 2015, [eprint](https://eprint.iacr.org/2015/546), KOS15
Crypto 2015, [KOS15](https://eprint.iacr.org/2015/546)

- Efficient Batched Oblivious PRF with Applications to Private Set Intersection\
*Vladimir Kolesnikov, Ranjit Kumaresan, Mike Rosulek, Ni Trieu*\
CCS 2016, [eprint](https://eprint.iacr.org/2016/799), KKRT16
CCS 2016, [KKRT16](https://eprint.iacr.org/2016/799)

- Distributed vector-OLE: Improved constructions and implementation\
*Phillipp Schoppmann, Adrià Gascón, Leonie Reichert, Mariana Raykova*\
CCS 2019, [eprint](https://eprint.iacr.org/2019/1084), SGRR19
CCS 2019, [SGRR19](https://eprint.iacr.org/2019/1084)

- Half-Tree: Halving the Cost of Tree Expansion in COT and DPF\
*Xiaojie Guo, Kang Yang, Xiao Wang, Wenhao Zhang, Xiang Xie, Jiang Zhang, Zheli Liu*\
EUROCRYPT 2023, [eprint](https://eprint.iacr.org/2022/1431), GYWZ+23
EUROCRYPT 2023, [GYWZ+23](https://eprint.iacr.org/2022/1431)

- Ferret: Fast Extension for coRRElated oT with small communication\
*Kang Yang, Chenkai Weng, Xiao Lan, Jiang Zhang, Xiao Wang*\
CCS'20, [eprint](https://eprint.iacr.org/2020/924), YWLZ+20
CCS'20, [YWLZ+20](https://eprint.iacr.org/2020/924)

- SoftSpokenOT: Quieter OT Extension from Small-Field Silent VOLE in the Minicrypt Model\
*Lawrence Roy*\
Crypto 2022, [publisher](https://www.iacr.org/cryptodb//data/paper.php?pubkey=32258), Roy22

## Vector Oblivious Linear Evaluation (over Field 2k)
Crypto 2022, [Roy22](https://www.iacr.org/cryptodb//data/paper.php?pubkey=32258)

Base VOLE:
**Vector Oblivious Linear Evaluation (over Field 2k)**

- MASCOT: Faster Malicious Arithmetic Secure Computation with Oblivious Transfer\
*Marcel Keller, Emmanuela Orsini*\
CCS 2016, [eprint](https://eprint.iacr.org/2016/505), KO16

Silent VOLE:
CCS 2016, [KO16](https://eprint.iacr.org/2016/505)

- Efficient Two-Round OT Extension and Silent Non-Interactive Secure Computation\
*Elette Boyle, Geoffroy Couteau, Niv Gilboa, Yuval Ishai, Lisa Kohl, Peter Rindal, Peter Scholl*\
CCS 2019, [eprint](https://eprint.iacr.org/2019/1159), BCGI+19 (with Peter Rindal)
CCS 2019, [BCGI+19 (with Peter Rindal)](https://eprint.iacr.org/2019/1159)

- Efficient Two-Round OT Extension and Silent Non-Interactive Secure Computation\
*Elette Boyle, Geoffroy Couteau, Niv Gilboa, Yuval Ishai, Lisa Kohl, Peter Rindal, Peter Scholl*\
CCS 2019, [eprint](https://eprint.iacr.org/2019/1159), BCGI+19
CCS 2019, [BCGI+19](https://eprint.iacr.org/2019/1159)

- Correlated Pseudorandomness from Expand-Accumulate Codes\
*Elette Boyle, Geoffroy Couteau, Niv Gilboa, Yuval Ishai, Lisa Kohl, Nicolas Resch, Peter Scholl*\
Crypto 2022, [eprint](https://eprint.iacr.org/2022/1014), BCG+22

Subfield VOLE:
Crypto 2022, [BCG+22](https://eprint.iacr.org/2022/1014)

- Wolverine: Fast, Scalable, and Communication-Efficient Zero-Knowledge Proofs for Boolean and Arithmetic Circuits\
*Chenkai Weng, Kang Yang, Jonathan Katz, Xiao Wang*
SP, 2021, [eprint](https://eprint.iacr.org/2020/925), WYKW21

## Codes
SP, 2021, [WYKW21](https://eprint.iacr.org/2020/925)

Local Linear Code
**Codes**

- Ferret: Fast Extension for coRRElated oT with small communication\
*Kang Yang, Chenkai Weng, Xiao Lan, Jiang Zhang, Xiao Wang*\
CCS'20, [eprint](https://eprint.iacr.org/2020/924), YWLZ+20

Low Density Parity Check Code (Silver Code)
CCS'20, [YWLZ+20](https://eprint.iacr.org/2020/924)

- Silver: Silent VOLE and Oblivious Transfer from Hardness of Decoding Structured LDPC Codes\
*Geoffroy Couteau, Peter Rindal, Srinivasan Raghuraman*\
Crypto 2021, [eprint](https://eprint.iacr.org/2021/1150), CRR21

Expanding Accumulation Code
Crypto 2021, [CRR21](https://eprint.iacr.org/2021/1150)

- Correlated Pseudorandomness from Expand-Accumulate Codes\
*Elette Boyle, Geoffroy Couteau, Niv Gilboa, Yuval Ishai, Lisa Kohl, Nicolas Resch, Peter Scholl*\
Crypto 2022, [eprint](https://eprint.iacr.org/2022/1014), BCG+22

Crypto 2022, [BCG+22](https://eprint.iacr.org/2022/1014)

## Distributed Point Functions
**Distributed Point Functions**

- Function secret sharing: improvements and extensions\
*Elette Boyle, Niv Gilboa, Yuval Ishai*\
CCS 2016, [eprint](https://eprint.iacr.org/2018/707), BGI16
CCS 2016, [BGI16](https://eprint.iacr.org/2018/707)

## Theoretical Tools

Correlation-Robust Hash (CrHash)
**Correlation-Robust Hash (CrHash)**

- Efficient and Secure Multiparty Computation from Fixed-Key Block Ciphers\
*Chun Guo, Jonathan Katz, Xiao Wang, Yu Yu*\
Preprint 2019, [eprint](https://eprint.iacr.org/2019/074), GKWY19
Preprint 2019, [GKWY19](https://eprint.iacr.org/2019/074)

Circular Correlation-Robust Hash (CCR Hash)
**Circular Correlation-Robust Hash (CCR Hash)**

- Efficient and Secure Multiparty Computation from Fixed-Key Block Ciphers\
*Chun Guo, Jonathan Katz, Xiao Wang, Yu Yu*\
Preprint 2019, [eprint](https://eprint.iacr.org/2019/074), GKWY19

Preprint 2019, [GKWY19](https://eprint.iacr.org/2019/074)
21 changes: 10 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,63 @@
# CHANGELOG
# Changelog

All notable changes to this project will be documented in this file.

## 2024-05-15
**2024-05-15**
- [Tag] release/0.4.5b0
- [Feature] Re-organize repo layout, add kernel folder for crypto protocols with links
- [Feature] Add ECC lib25519 implementation
- [Feature] Add ECC FourQ implementation
- [Feature] Unify f2k implementaion
- [Bugifx] Fix RandBits implementation

## 2024-02-01
**2024-02-01**
- [Tag] release/0.4.3
- [Feature] Add Silent Vole (malicious version)
- [Bugifx] Multiple bugfixes

## 2024-01-09
**2024-01-09**
- [YACL] v0.4.2
- [Dependency] Bump: Openssl 3.0.12 (experimental)
- [Feature] Add Softspoken OTe (malicious version)
- [API] Refactor entropy source, drbg, and rand; Refine traditional crypto APIs
- [Bugifx] Multiple bugfixes


## 2023-11-16
**2023-11-16**
- [YACL] v0.4.1.1
- [Feature] Init Global Security Parameters for Yacl [WIP: apply security parameter to all algorithms]
- [Feature] Add Softspoken OTe (semi-honest version)
- [Feature] Add Silent Vole [WIP: optimize MpVole and DualEncode]

## 2023-10-20
**2023-10-20**
- [YACL] v0.4.1
- [Feature] Add Sigma-type ZKP Protocols (An unified implementation)
- [Feature] Add ECC Pairing SPI and support to libmcl(ecc, pairing)
- [Feature] Add Multiplication for GF(2^64) and GF(2^128)
- [Bugfix] fix KOS OTe security flaws
- [Feature] Add AVX2 Matrix Transpose

## 2023-05-25
**2023-05-25**
- [YACL] v0.3.3
- [Feature] Add Ferret OTe
- [Feature] Add Gywz OTe (Correlated GGM Tree)
- [Feature] Add KOS OTe (warning: KOS still has potential security flaws)

## 2023-02-02
**2023-02-02**
- [YACL] v0.3.1
- [Feature] Add `dynamic_bitset` for manipulating bit vectors
- [API] RO now can accept multiple inputs
- [API] Add iknp cot api, improve iknp performance
- [Bugfix] Fix Several m1 related bugs

## 2022-12-08
**2022-12-08**
- [YACL] v0.3.0
- [Feature] Add random permutation and correlation-robust hash function
- [Feature] Add OT/OTe benchmark
- [API] Fix randomness implementation
- [API] Re-organize repo layout
- [Bugfix] Fix Random Oralce Usage

## 2022-12-01
**2022-12-01**
- [YACL] v0.2.0
- [API] Rename YASL to YACL
- [API] Re-organize repo layout
85 changes: 39 additions & 46 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
# Getting Started Guide
# Getting Started

This document includes guidelines.

## Table of Contents

- [Prerequisites](#prerequisites)
- [Download and Build](#download-and-build)
- [Ubuntu](#ubuntu)
- [MacOS](#macos)
- [Setup Compilation Database for your lsp](#setup-compilation-database-for-your-lsp)
- [(Optional) Setup Vscode](#optional-setup-vscode)

## Prerequisites

To build Yacl from source, you will need the following tools:

- **bazel**: We recommend to use the official [bazelisk](https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation) to manage bazel version.
- **gcc >= 10.3**
- **[cmake](https://cmake.org/getting-started/)**
- **[ninja/ninja-build](https://ninja-build.org/)**
- [bazel](https://bazel.build/): We recommend to use the official [bazelisk](https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation) to manage bazel version.
- [gcc >= 10.3](https://gcc.gnu.org/)
- [cmake](https://cmake.org/)
- [ninja/ninja-build](https://ninja-build.org/)
- **Perl 5 with core modules** (Required by [OpenSSL](https://github.com/openssl/openssl/blob/master/INSTALL.md#prerequisites))

## Download and Build
## Download and build

Please make sure you already have `git` installed on your system, then clone Yacl
Please make sure you already have `git` installed on your system, then clone Yacl via the github link,

```sh
git clone https://github.com/secretflow/yacl
$ git clone https://github.com/secretflow/yacl.git
```

The building process of YACL is as following.

### Ubuntu

Download the dependencies

```sh
sudo apt install gcc wget cmake ninja-build nasm automake libtool
$ sudo apt install gcc wget cmake ninja-build nasm automake libtool libomp-dev
```

We recommend to use `bazelisk` to manage different versions of `bazel`. On Linux, You can download Bazelisk binary on our Releases page and add it to your PATH manually, which also works on macOS and Windows. You can download the newest `bazelisk` binary from its official [github release page](https://github.com/bazelbuild/bazelisk/releases).
Expand All @@ -43,29 +36,29 @@ The following is an example of downloading and setting up bazelisk v1.20.0, you

```sh
# If you use a x86 architecture cpu
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64
mv bazelisk-linux-amd64 bazel && chmod +x bazel
sudo mv bazel /usr/local/bin # you need sudo to do this
$ wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64
$ mv bazelisk-linux-amd64 bazel && chmod +x bazel
$ sudo mv bazel /usr/local/bin # you need sudo to do this

# If you use an arm architecture cpu
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-arm64
mv bazelisk-linux-arm64 bazel && chmod +x bazel
sudo mv bazel /usr/local/bin # you need sudo to do this
$ wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-arm64
$ mv bazelisk-linux-arm64 bazel && chmod +x bazel
$ sudo mv bazel /usr/local/bin # you need sudo to do this
```

To build Yacl, at yacl's root directory, run the following

```sh
bazel build //...
bazel build //... -c opt # build as optimized mode
bazel build //... -c dbg # build as debug mode
bazel build //... --config gm # build with gm mode
$ bazel build //...
$ bazel build //... -c opt # build as optimized mode
$ bazel build //... -c dbg # build as debug mode
$ bazel build //... --config gm # build with gm mode
```

To test Yacl

```sh
bazel test //...
$ bazel test //...
```

### MacOS
Expand All @@ -74,47 +67,47 @@ First you need to download XCode and [homebrew](https://brew.sh/),

```sh
# Install Xcode
https://apps.apple.com/us/app/xcode/id497799835?mt=12
$ https://apps.apple.com/us/app/xcode/id497799835?mt=12

# Select Xcode toolchain version
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
```

Then download the dependencies,

```
```sh
# Install dependencies
brew install bazelisk cmake ninja nasm automake libtool
$ brew install bazelisk cmake ninja nasm automake libtool libomp
```

To build Yacl, at yacl's root directory, run the following

```sh
bazel build //...
bazel build //... -c opt # build as optimized mode
bazel build //... -c dbg # build as debug mode
$ bazel build //...
$ bazel build //... -c opt # build as optimized mode
$ bazel build //... -c dbg # build as debug mode
$ bazel build //... --config gm # build with gm mode
```

To test Yacl

```sh
bazel test //...
$ bazel test //...
```

## Setup Compilation Database for your lsp
## Setup compilation database for your lsp

Language servers accept a `compile_commands.json` file input to help it with linting, jumping to definitions/references, and other functions. This file consists of an array of “command objects”, where each command object specifies one way a translation unit is compiled in the project. A lot of modern C/C++ build system can generate this file with simple steps, it's the same for bazel.

```sh
sudo apt install curl
cd /path/to/yacl/ # change to yacl path
bash <(curl -s https://raw.githubusercontent.com/secretflow/devtools/9efb0bc93068a122864fdb661946695badacbe24/refresh_compile_commands.sh)
$ sudo apt install curl
$ cd /path/to/yacl/ # change to yacl path
$ bash <(curl -s https://raw.githubusercontent.com/secretflow/devtools/9efb0bc93068a122864fdb661946695badacbe24/refresh_compile_commands.sh)
```

## (Optional) Setup Vscode
## (Optional) Recommended vscode extensions

We recommend to use the following extensions for vscode users:
- Clang-Format: Use Clang-Format in Visual Studio Code
- cpplint: code style check tool extension for cpplint
- Bazel: Bazel BUILD integration
- clangd: C/C++ completion, navigation, and insights
- [Bazel](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel): Bazel BUILD integration
- [clangd](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd): C/C++ completion, navigation, and insights
- [cpplint](https://marketplace.visualstudio.com/items?itemName=mine.cpplint): code style check tool extension for cpplint (requires `cpplint` binary)
Loading

0 comments on commit d33801a

Please sign in to comment.