pub trait ArithmeticBackend: Send + Sync {
// Required methods
fn batch_rns_add(&self, a: &RnsBatch, b: &RnsBatch) -> RnsBatch;
fn batch_rns_mul(&self, a: &RnsBatch, b: &RnsBatch) -> RnsBatch;
fn batch_crt(&self, batch: &RnsBatch) -> Vec<BigUint>;
fn name(&self) -> &'static str;
}Expand description
A backend that can perform elementwise RNS arithmetic over a RnsBatch.
Required Methods§
Sourcefn batch_rns_add(&self, a: &RnsBatch, b: &RnsBatch) -> RnsBatch
fn batch_rns_add(&self, a: &RnsBatch, b: &RnsBatch) -> RnsBatch
Elementwise add: result[b][c] = (a[b][c] + b[b][c]) % m[c].
Sourcefn batch_rns_mul(&self, a: &RnsBatch, b: &RnsBatch) -> RnsBatch
fn batch_rns_mul(&self, a: &RnsBatch, b: &RnsBatch) -> RnsBatch
Elementwise multiply: result[b][c] = (a[b][c] * b[b][c]) % m[c].
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".