MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / add_vectors_u128

Function add_vectors_u128

ciphercore-base/src/bytes.rs:56–67  ·  view source on GitHub ↗
(vec1: &[u128], vec2: &[u128], modulus: Option<u128>)

Source from the content-addressed store, hash-verified

54}
55
56pub fn add_vectors_u128(vec1: &[u128], vec2: &[u128], modulus: Option<u128>) -> Result<Vec<u128>> {
57 if vec1.len() != vec2.len() {
58 return Err(runtime_error!(
59 "Vectors of different lengths can't be summed"
60 ));
61 }
62 let mut res = vec![];
63 for i in 0..vec1.len() {
64 res.push(add_u128(vec1[i], vec2[i], modulus));
65 }
66 Ok(res)
67}
68
69pub fn sum_vector_u64(vec: &[u64], modulus: Option<u64>) -> u64 {
70 let mut res = 0;

Callers 6

generalized_addFunction · 0.85
share_vectorFunction · 0.85
test_simple_shareFunction · 0.85
evaluateFunction · 0.85
evaluate_nodeMethod · 0.85

Calls 2

add_u128Function · 0.85
pushMethod · 0.45

Tested by 1

test_simple_shareFunction · 0.68