Giter Club home page Giter Club logo

Comments (16)

theref avatar theref commented on September 27, 2024 1
  • Ciphertext Validity Checking - must be done before creating a decryption share
  • #38

Screenshot 2023-01-16 at 10 20 03

tpke/src/iphertext.rs:

pub fn check_ciphertext_validity<E: PairingEngine>(
    c: &Ciphertext<E>,
    aad: &[u8],
) -> bool {
    let g_inv = E::G1Prepared::from(-E::G1Affine::prime_subgroup_generator());
    let hash_g2 = E::G2Prepared::from(construct_tag_hash::<E>(
        c.commitment,
        &c.ciphertext[..],
        aad,
    ));

    E::product_of_pairings(&[
        (E::G1Prepared::from(c.commitment), hash_g2),
        (g_inv, E::G2Prepared::from(c.auth_tag)),
    ]) == E::Fqk::one()
}

which is used by pub fn checked_decrypt and fn decrypt_with_shared_secret.

Also, in file tpke/src/api we have:

    pub fn to_decryption_share(&self) -> DecryptionShare {
        // TODO: Add verification steps

Verification is missing from this function.

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024 1

Yes, these are from the original Ferveo source code, and I'd like to figure out what they do, how to use them, whether we need them etc.

from ferveo.

theref avatar theref commented on September 27, 2024
  • Verifying Decryption Shares - must be done before combining decryption shares

Screenshot 2023-01-16 at 10 22 07

Screenshot 2023-01-16 at 11 06 47

from ferveo.

theref avatar theref commented on September 27, 2024
  • We don't use weights, but the indexing is still important

Screenshot 2023-01-16 at 10 59 19

from ferveo.

theref avatar theref commented on September 27, 2024
  • Are we going to be aggregating decryption shares?

Screenshot 2023-01-16 at 11 08 48

from ferveo.

cygnusv avatar cygnusv commented on September 27, 2024
  • Are we going to be aggregating decryption shares?
Screenshot 2023-01-16 at 11 08 48

No, my understanding is that this makes sense for Ferveo original implementation, where a node (with a single private blinding key ek_i) may have many private shares, and the corresponding decryption shares can be aggregated.

from ferveo.

theref avatar theref commented on September 27, 2024

yeah, i couldn't think of any scenario where it would make sense for our use case

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

I found some other checks that I would like to document and verify.

Moved to issue description

from ferveo.

theref avatar theref commented on September 27, 2024

oh nice, these are from the code and we need to verify the maths?

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

We don't use weights, but the indexing is still important

Marking as complete since ferveo validators have a share_index attributed to them.

Are we going to be aggregating decryption shares?

Marking as solved.

I've aggregated the remaining checks into the issue description.

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

Not sure how to compute 4.4.4 for a simple tDec variant. In this variant, $D_i$ is of type Fqk (product of pairing), but we need to be G1Prepared for $e(D_i, B_i)$ to work.

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

verify_blinding doesn't work i.e. the original code seems to be implemented incorrectly. I can't find a reference to this operation in the docs or in the whitepaper.

@cygnusv, is this something we would like to explore further, or should we drop verify_blinding?

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

If blinding_key, $B_i = [b] dk_i$, is the same as PublicKey::encryption_key of DKG validator, then verify_blinding in tpke is effectively the same check that verify_full in ferveo does:

  • $e(G_1, \hat{Y}{i,\omega_j}) = e(A_{i,\omega_j}, ek_i)$ verify_full
  • $e(g, Y_i) = e(A_i, [b] H)$, verify_blinding

If $B_i = [b] dk_i = b [H]$ doesn't hold, then I don't know what verify_blinding is supposed to check.

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

Not sure how to compute 4.4.4 for a simple tDec variant. In this variant, Di is of type Fqk (product of pairing), but we need to be G1Prepared for e(Di,Bi) to work.

The naive rewrite doesn't make sense here anyway, since in simple tDec decryption share is defined as $C_i=e(U,Z_i)$, and in fast tDec as $D_i=[b−1]U$.

Marking this as a candidate for a research item in #42

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

Found this earlier rewrite of verify_blinding.

from ferveo.

piotr-roslaniec avatar piotr-roslaniec commented on September 27, 2024

Closing this as the work will be continued in separate issues mentioned in OP.

from ferveo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.