Skip to content

BigInt type problem (curv and rust-paillier) #21

@marvellous987

Description

@marvellous987

Hi, I encountered a type conversion issue among type BigInt:

  1. Using Paillier::encrypt in rust-paillier, we need to first convert the BigInt variable to RawPlaintext. However, there is an error:
error[E0277]: the trait bound `RawPlaintext<'_>: From<&curv::BigInt>` is not satisfied
   --> ...
    |
63  |         RawPlaintext::from(&x1)
    |         ^^^^^^^^^^^^^^^^^^ the trait `From<&curv::BigInt>` is not implemented for `RawPlaintext<'_>`
  1. Using Paillier::decrypt in rust-paillier:
    let gamma1 = Paillier::decrypt(
        &dk,
        RawCiphertext::from(C_gamma.clone())
    ).0
    .clone()
    .into_owned();

and gamma1 is a paillier::Bigint rather than a curv::BigInt.

I think it is the same origin of problem, would anyone can give me any suggestion?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions