| 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> { |