| 39 | pub const MVE_DEFAULT_U: usize = 30; |
| 40 | |
| 41 | pub trait Mve { |
| 42 | /// The underlying multi-recipient key-encapsulation mechanism. |
| 43 | type Mkem: Mkem; |
| 44 | /// The instance being proven. |
| 45 | type Instance; |
| 46 | /// The witness for the instance. |
| 47 | type Witness; |
| 48 | type Proof; |
| 49 | type Ciphertext; |
| 50 | type RecipientCiphertext; |
| 51 | type Error; |
| 52 | |
| 53 | fn keygen<R: CryptoRng + RngCore>(rng: &mut R) -> KemKeyPair<Self::Mkem> { |
| 54 | KemKeyPair::new(rng) |
| 55 | } |
| 56 | |
| 57 | fn prove( |
| 58 | pks: &[<Self::Mkem as Mkem>::PublicKey], |
| 59 | instance: &Self::Instance, |
| 60 | witness: &Self::Witness, |
| 61 | session_identifier: &str, |
| 62 | ) -> Self::Proof; |
| 63 | |
| 64 | fn verify( |
| 65 | pks: &[<Self::Mkem as Mkem>::PublicKey], |
| 66 | instance: &Self::Instance, |
| 67 | proof: &Self::Proof, |
| 68 | session_identifier: &str, |
| 69 | ) -> Result<Self::Ciphertext, Self::Error>; |
| 70 | |
| 71 | fn compress(ct: &Self::Ciphertext, recipient_index: usize) |
| 72 | -> Option<Self::RecipientCiphertext>; |
| 73 | |
| 74 | fn decrypt( |
| 75 | sk: &<Self::Mkem as Mkem>::SecretKey, |
| 76 | ct_i: &Self::RecipientCiphertext, |
| 77 | instance: &Self::Instance, |
| 78 | ) -> Result<Self::Witness, Self::Error>; |
| 79 | } |
| 80 | |
| 81 | #[derive(Clone, Serialize, Deserialize)] |
| 82 | pub struct MkemCiphertextGroup<Ct> { |
no outgoing calls
no test coverage detected