MCPcopy Create free account
hub / github.com/docknetwork/crypto / powers

Function powers

utils/src/ff.rs:76–85  ·  view source on GitHub ↗

Powers of a finite field as `[1, s, s^2, .. s^{num-1}]`

(s: &F, num: u32)

Source from the content-addressed store, hash-verified

74
75/// Powers of a finite field as `[1, s, s^2, .. s^{num-1}]`
76pub fn powers<F: Field>(s: &F, num: u32) -> Vec<F> {
77 let mut powers = Vec::with_capacity(num as usize);
78 if num > 0 {
79 powers.push(F::one());
80 for i in 1..num {
81 powers.push(powers[i as usize - 1] * s);
82 }
83 }
84 powers
85}
86
87/// Powers of a finite field as `[start, start*exp, start * exp^2, .. start * exp^{num-1}]`
88pub fn powers_starting_from<F: Field>(start: F, exp: &F, num: u32) -> Vec<F> {

Callers 15

evaluate_tempMethod · 0.85
weighted_inner_productFunction · 0.85
check_powersFunction · 0.85
final_verification_checkFunction · 0.85
verify_aggregate_proofFunction · 0.85
aggregate_proofsFunction · 0.85
aggregate_proofsFunction · 0.85
verify_aggregate_proofFunction · 0.85
verifyMethod · 0.85
alpha_dFunction · 0.85

Calls

no outgoing calls

Tested by 1

check_powersFunction · 0.68