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

Method commit_decomposed_given_base_powers

smc_range_proof/src/common.rs:58–65  ·  view source on GitHub ↗

Same as `commit_decomposed` but takes `[1, base, base^2, ..., base^{n-1}]`

(
        &self,
        base_powers: &[G::ScalarField],
        digits: &[G::ScalarField],
        randomness: &G::ScalarField,
    )

Source from the content-addressed store, hash-verified

56
57 /// Same as `commit_decomposed` but takes `[1, base, base^2, ..., base^{n-1}]`
58 pub fn commit_decomposed_given_base_powers(
59 &self,
60 base_powers: &[G::ScalarField],
61 digits: &[G::ScalarField],
62 randomness: &G::ScalarField,
63 ) -> G {
64 (self.g * inner_product(base_powers, digits) + self.h * randomness).into()
65 }
66}
67
68/// Representation of `value` in `base`-representation. Returns the base `base` digits in little-endian form

Callers 2

commit_decomposedMethod · 0.80

Calls 1

inner_productFunction · 0.50

Tested by

no test coverage detected