mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 03:25:05 -05:00
feat(cpu): expose hardware aes for csprng
This commit is contained in:
committed by
Quentin Bourgerie
parent
46755e613c
commit
f393d255a2
@@ -39,6 +39,8 @@ std = [
|
||||
csprng = ["concrete-csprng"]
|
||||
parallel = ["rayon"]
|
||||
nightly = ["pulp/nightly"]
|
||||
x86_64 = ["concrete-csprng/generator_x86_64_aesni"]
|
||||
aarch64 = ["concrete-csprng/generator_aarch64_aes"]
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = "0.24"
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
use std::io::Read;
|
||||
|
||||
use super::types::{Csprng, CsprngVtable, Uint128};
|
||||
use concrete_csprng::generators::{RandomGenerator, SoftwareRandomGenerator};
|
||||
#[cfg(feature = "x86_64")]
|
||||
use concrete_csprng::generators::AesniRandomGenerator as Generator;
|
||||
#[cfg(feature = "aarch64")]
|
||||
use concrete_csprng::generators::NeonAesRandomGenerator as Generator;
|
||||
use concrete_csprng::generators::RandomGenerator;
|
||||
#[cfg(all(not(feature = "aarch64"), not(feature = "x86_64")))]
|
||||
use concrete_csprng::generators::SoftwareRandomGenerator as Generator;
|
||||
use concrete_csprng::seeders::Seed;
|
||||
use libc::c_int;
|
||||
|
||||
type Generator = SoftwareRandomGenerator;
|
||||
|
||||
#[no_mangle]
|
||||
pub static CONCRETE_CSPRNG_VTABLE: CsprngVtable = CsprngVtable {
|
||||
remaining_bytes: {
|
||||
|
||||
Reference in New Issue
Block a user