secretflow / yacl

YACL (Yet Another Common crypto library) is a C++ library that contains cryptography, network and io modules which other SecretFlow code depends on.
https://www.secretflow.org.cn/en/docs/yacl/main/
Apache License 2.0
75 stars 63 forks source link

dear teachers, if the spu recognizes that yacl is not installed successfully, will the yacl be replaced with an openssl implementation? #412

Open zhangwaer opened 1 hour ago

zhangwaer commented 1 hour ago

Before spu, i didnot install yacl solely, and i only installed spu with guideline, but when "bazel run -c opt //examples/python/utils:nodectl -- --config pwd//examples/flax_gpt2/3pc.json up"

it output "[warning] [openssl_factory.cc:83] Yacl has been configured to use Yacl's entropy source, but unable to find one. Fallback to use openssl's default entropy srouce"

And in /.cache/bazel/as312dsd23sa34/external/yacl/yacl, there are yacl lib installed by bazel of spu.

So simply entropy source cannot be used, and the cryptographic code in yacl will be used when performing secure inference?

thanks very much!!!!!! /.cache/bazel/as312dsd23sa34/external/yacl/yacl

Jamie-Cui commented 1 hour ago

Short answer is: you can ignore that warning for now, as it only tells you yacl will use openssl's default entropy source to instantiate its pseudorandom generator.

The overall security assumption will not break if you consider openssl will do this in a secure way (for almost all cases, openssl will). The only exception maybe that you do not want to use openssl's way to get entropy source, and you have implemented your own way of acquiring es (presumably from a thrid-party hardware). In that case, this warning would tell you if you have configured correctly.

We have make yacl more silent in a recent commit https://github.com/secretflow/yacl/commit/f810593e7c4675d4c128be170a310ccaa64d93bd, so this warning would not appear if you update yacl to master branch

zhangwaer commented 1 hour ago

Short answer is: you can ignore that warning for now, as it only tells you yacl will use openssl's default entropy source to instantiate its pseudorandom generator.

The overall security assumption will not break if you consider openssl will do this in a secure way (for almost all cases, openssl will). The only exception maybe that you do not want to use openssl's way to get entropy source, and you have implemented your own way of acquiring es (presumably from a thrid-party hardware). In that case, this warning would tell you if you have configured correctly.

We have make yacl more silent in a recent commit f810593, so this warning would not appear if you update yacl to master branch

Thanks very much!!! Besides entropy source cannot be used in yacl, can ot, random oracle and other crypto tools be used normally?

Jamie-Cui commented 1 hour ago

yes, you can use OT, RO, PRG, PRP, CrHash, etc.. But be aware those tools are only experimental

zhangwaer commented 1 hour ago

yes, you can use OT, RO, PRG, PRP, CrHash, etc.. But be aware those tools are only experimental

thanks very much!!!