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

Method validate_encryption_key

proof_system/src/sub_protocols/saver.rs:454–470  ·  view source on GitHub ↗
(
        chunk_bit_size: u8,
        encryption_key: &EncryptionKey<E>,
    )

Source from the content-addressed store, hash-verified

452 }
453
454 pub fn validate_encryption_key(
455 chunk_bit_size: u8,
456 encryption_key: &EncryptionKey<E>,
457 ) -> Result<(), ProofSystemError> {
458 if encryption_key.supported_chunks_count()?
459 != saver::utils::chunks_count::<E::ScalarField>(chunk_bit_size)
460 {
461 Err(ProofSystemError::SaverError(
462 SaverError::IncompatibleEncryptionKey(
463 saver::utils::chunks_count::<E::ScalarField>(chunk_bit_size) as usize,
464 encryption_key.supported_chunks_count()? as usize,
465 ),
466 ))
467 } else {
468 Ok(())
469 }
470 }
471
472 /// Commitment key for the commitment in ciphertext
473 pub fn encryption_comm_key(encryption_key: &EncryptionKey<E>) -> Vec<E::G1Affine> {

Callers

nothing calls this directly

Calls 1

SaverErrorEnum · 0.85

Tested by

no test coverage detected