pub struct ReencryptionEvidence {Show 16 fields
pub e: CurvePoint,
pub ez: CurvePoint,
pub e1: CurvePoint,
pub e1h: CurvePoint,
pub e2: CurvePoint,
pub v: CurvePoint,
pub vz: CurvePoint,
pub v1: CurvePoint,
pub v1h: CurvePoint,
pub v2: CurvePoint,
pub uz: CurvePoint,
pub u1: CurvePoint,
pub u1h: CurvePoint,
pub u2: CurvePoint,
pub kfrag_validity_message_hash: GenericArray<u8, <Sha256 as OutputSizeUser>::OutputSize>,
pub kfrag_signature_v: bool,
}Expand description
A collection of data to prove the validity of reencryption.
In combination with the return values of Capsule::to_bytes_simple and
CapsuleFrag::to_bytes_simple, it can be used to perform the following checks:
-
Check that Alice’s verifying key (or the corresponding Ethereum address) can be derived from
CapsuleFrag::kfrag_signature,kfrag_validity_message_hash, and the recovery bytekfrag_signature_v(truecorresponds to0x01andfalseto0x00). -
Zero-knowledge verification (performed in
CapsuleFrag::verify):z * e == h * e1 + e2(correct re-encryption ofe);z * v == h * v1 + v2(correct re-encryption ofv);z * u == h * u1 + u2(correct re-encryption key commitment).
Here z == CapsuleFrag::signature, u is the constant scheme parameter
(can be hardcoded in the contract performing the check, see Parameters::u
for the value), e and v are from Capsule::to_bytes_simple,
and e1, e2, v1, v2, u1, u2 are from CapsuleFrag::to_bytes_simple.
The serialized capsule and cfrag have these points in the compressed form, so this struct
provides both coordinates to let the user avoid uncompressing the point.
Instead one can just check that the the y coordinate corresponds to the sign
in the compressed point, and that the whole point is on the curve.
h is the challenge scalar, see hash_to_cfrag_verification
for the details on how to reproduce its calculation.
Fields§
§e: CurvePointSame as e in Capsule::to_bytes_simple.
ez: CurvePointPrecalculated z * e, where z == CapsuleFrag::signature
in CapsuleFrag::to_bytes_simple.
e1: CurvePointSame as e1 in CapsuleFrag::to_bytes_simple.
e1h: CurvePointPrecalculated h * e1, where h is obtained from hash_to_cfrag_verification.
e2: CurvePointSame as e2 in CapsuleFrag::to_bytes_simple.
v: CurvePointSame as v in Capsule::to_bytes_simple.
vz: CurvePointPrecalculated z * v, where z == CapsuleFrag::signature
in CapsuleFrag::to_bytes_simple.
v1: CurvePointSame as v1 in CapsuleFrag::to_bytes_simple.
v1h: CurvePointPrecalculated h * v1, where h is obtained from hash_to_cfrag_verification.
v2: CurvePointSame as v2 in CapsuleFrag::to_bytes_simple.
uz: CurvePointPrecalculated z * u, where z == CapsuleFrag::signature
in CapsuleFrag::to_bytes_simple, and u is Parameters::u.
u1: CurvePointSame as u1 in CapsuleFrag::to_bytes_simple.
u1h: CurvePointPrecalculated h * u1, where h is obtained from hash_to_cfrag_verification.
u2: CurvePointSame as u2 in CapsuleFrag::to_bytes_simple.
kfrag_validity_message_hash: GenericArray<u8, <Sha256 as OutputSizeUser>::OutputSize>The hashed message used to create kfrag_signature in
CapsuleFrag::to_bytes_simple.
kfrag_signature_v: boolThe recovery byte corresponding to kfrag_signature in CapsuleFrag::to_bytes_simple
(true corresponds to 0x01 and false to 0x00).
Implementations§
Trait Implementations§
Source§impl Clone for ReencryptionEvidence
impl Clone for ReencryptionEvidence
Source§fn clone(&self) -> ReencryptionEvidence
fn clone(&self) -> ReencryptionEvidence
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReencryptionEvidence
impl Debug for ReencryptionEvidence
Source§impl<'de> DefaultDeserialize<'de> for ReencryptionEvidence
Available on crate feature default-serialization only.
impl<'de> DefaultDeserialize<'de> for ReencryptionEvidence
default-serialization only.Source§impl DefaultSerialize for ReencryptionEvidence
Available on crate feature default-serialization only.
impl DefaultSerialize for ReencryptionEvidence
default-serialization only.