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

Method check_sizes

compressed_sigma/src/compressed_linear_form.rs:358–376  ·  view source on GitHub ↗
(
        &self,
        g: &[G],
        linear_form: &L,
    )

Source from the content-addressed store, hash-verified

356 }
357
358 fn check_sizes<L: LinearForm<G::ScalarField>>(
359 &self,
360 g: &[G],
361 linear_form: &L,
362 ) -> Result<(), CompSigmaError> {
363 if !(g.len() + 1).is_power_of_two() {
364 return Err(CompSigmaError::UncompressedNotPowerOf2);
365 }
366 if self.A.len() != self.B.len() {
367 return Err(CompSigmaError::VectorLenMismatch);
368 }
369 if (g.len() + 1) != (1 << (self.A.len() + 1)) {
370 return Err(CompSigmaError::WrongRecursionLevel);
371 }
372 if !linear_form.size().is_power_of_two() {
373 return Err(CompSigmaError::UncompressedNotPowerOf2);
374 }
375 Ok(())
376 }
377}
378
379pub fn prepare_generators_and_linear_form_for_compression<

Callers 2

is_valid_recursiveMethod · 0.45
is_validMethod · 0.45

Calls 2

lenMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected