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

Method decrypt_given_pairing_powers

saver/src/encryption.rs:303–322  ·  view source on GitHub ↗

Same as `Self::decrypt` but expects pairing powers (see `PreparedDecryptionKey::pairing_powers`) that can be precomputed for even faster decryption

(
        c_0: &E::G1Affine,
        c: &[E::G1Affine],
        sk: &SecretKey<E::ScalarField>,
        dk: impl Into<PreparedDecryptionKey<E>>,
        g_i: &[E::G1Affine],
        chunk_bit_size: u8

Source from the content-addressed store, hash-verified

301 /// Same as `Self::decrypt` but expects pairing powers (see `PreparedDecryptionKey::pairing_powers`)
302 /// that can be precomputed for even faster decryption
303 pub fn decrypt_given_pairing_powers(
304 c_0: &E::G1Affine,
305 c: &[E::G1Affine],
306 sk: &SecretKey<E::ScalarField>,
307 dk: impl Into<PreparedDecryptionKey<E>>,
308 g_i: &[E::G1Affine],
309 chunk_bit_size: u8,
310 pairing_powers: &[Vec<PairingOutput<E>>],
311 ) -> crate::Result<(E::ScalarField, E::G1Affine)> {
312 let (chunks, nu) = Self::decrypt_to_chunks_given_pairing_powers(
313 c_0,
314 c,
315 sk,
316 dk,
317 g_i,
318 chunk_bit_size,
319 Some(pairing_powers),
320 )?;
321 Ok((utils::compose(&chunks, chunk_bit_size)?, nu))
322 }
323
324 /// Same as `Self::decrypt` but takes Groth16's verification key instead of the generators used for Elgamal encryption
325 pub fn decrypt_given_groth16_vk(

Callers 2

checkFunction · 0.80

Calls 1

composeFunction · 0.85

Tested by

no test coverage detected