mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-16 23:51:36 -05:00
fix(compiler): Do not reinstantiate csprng each time in the simulation backend
This commit is contained in:
committed by
Quentin Bourgerie
parent
9dcf1c4b6f
commit
5370fb3cf9
@@ -16,6 +16,8 @@
|
||||
|
||||
using concretelang::csprng::SoftCSPRNG;
|
||||
|
||||
thread_local auto csprng = SoftCSPRNG(0);
|
||||
|
||||
inline concrete::SecurityCurve *security_curve() {
|
||||
return concrete::getSecurityCurve(128, concrete::BINARY);
|
||||
}
|
||||
@@ -29,7 +31,7 @@ uint64_t from_torus(double torus) {
|
||||
// single one?
|
||||
uint64_t gaussian_noise(double mean, double variance) {
|
||||
uint64_t random_gaussian_buff[2];
|
||||
auto csprng = SoftCSPRNG(0);
|
||||
|
||||
concrete_cpu_fill_with_random_gaussian(random_gaussian_buff, 2, variance,
|
||||
csprng.ptr);
|
||||
return random_gaussian_buff[0];
|
||||
|
||||
Reference in New Issue
Block a user