Multi-Party Computation for Java (mpc4j) is an efficient and easy-to-use Secure Multi-Party Computation (MPC), Homomorphic Encryption (HE) and Differential Privacy (DP) library mainly written in Java.
mpc4j aims to provide an academic library for researchers to study and develop MPC/HE/DP in a unified manner. As mpc4j tries to provide state-of-the-art MPC/HE/DP implementations, researchers could leverage the library to have fair and quick comparisons between the new algorithms/protocols they proposed and existing ones.
We note that mpc4j is mainly focused on research and mpc4j assumes a very strong system model. Specifically, mpc4j assumes never-crash nodes with a fully synchronized network. In practice, crash-recovery nodes with a partially synchronized network would be a reasonable system model. Aside from the system model, mpc4j tries to integrate tools that are suitable to be used in the production environment. We emphasize that additional engineering problems need to be solved if you want to develop your own MPC/DP applications. A reasonable solution would be to implement communication APIs on your own, develop protocols by calling tools in mpc4j, and referring protocol implementations in mpc4j as a prototype.

克隆项目,进入到mpc4j/mpc4j-native-tool/doc/compile_mac_aarch64.md 参考该readme安装native-tool。
安装openssl和cmake 完成
brew install openssl
brew install cmake
安装gmp 未完成
这里m1-Ventura安装gmp-6.2.1失败,查了资料应该和操作系统版本有关,考虑升级一下系统
apple m1 - gmp unit tests failing on Ventura Mac m1 - Stack Overflow
wget <https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz>
xz -d gmp-6.2.1.tar.xz
tar -xvf gmp-6.2.1.tar
cd gmp-6.2.1
./configure --enable-cxx CFLAGS="-O3" CXXFLAGS="-O3"
make
make check
sudo make install
cd .. # return to the original path
安装NTL 完成
wget <https://libntl.org/ntl-11.5.1.tar.gz>
tar -xvzf ntl-11.5.1.tar.gz
cd ntl-11.5.1
cd src
./configure SHARED=on CXXFLAGS=-O3 # Must compile NTL as a shared library
make
make check
sudo make install
cd .. # return to the ntl-11.5.1 path
cd .. # return to the original path
安装MCL 完成
git clone -b v1.61 <https://github.com/herumi/mcl.git>
cd mcl
mkdir build
cd build
cmake .. -DMCL_USE_ASM=OFF # remove assembly language support
make
sudo make install
cd .. # return to the build path
cd .. # return to the original path
安装libsodium 完成