parent
59358787eb
commit
3bd99e9fbd
|
@ -104,9 +104,11 @@ pub struct Response {
|
|||
// The fields for the new Lox credential
|
||||
P: RistrettoPoint,
|
||||
EncQ: (RistrettoPoint, RistrettoPoint),
|
||||
EncInvRemain: (RistrettoPoint, RistrettoPoint),
|
||||
id_server: Scalar,
|
||||
TId: RistrettoPoint,
|
||||
TBucket: RistrettoPoint,
|
||||
TInvRemain: RistrettoPoint,
|
||||
TBlockages: RistrettoPoint,
|
||||
|
||||
// The lox_zkp
|
||||
|
@ -153,10 +155,11 @@ define_proof! {
|
|||
blindissue,
|
||||
"Blockage Migration Blind Issuing",
|
||||
(x0, x0tilde, xid, xbucket, xlevel, xsince, xinvremain, xblockages,
|
||||
s, b, tid, tbucket, tblockages),
|
||||
s, b, tid, tbucket, tinvremain, tblockages),
|
||||
(P, EncQ0, EncQ1, X0, Xid, Xbucket, Xlevel, Xsince, Xinvremain,
|
||||
Xblockages, Plevel, Psince, Pinvremain, TId, TBucket, TBlockages,
|
||||
D, EncId0, EncId1, EncBucket0, EncBucket1, EncBlockages0, EncBlockages1),
|
||||
Xblockages, Plevel, Psince, TId, TBucket, TInvRemain, TBlockages,
|
||||
D, EncId0, EncId1, EncBucket0, EncBucket1, EncInvRemain0,
|
||||
EncInvRemain1, EncBlockages0, EncBlockages1),
|
||||
(A, B):
|
||||
Xid = (xid*A),
|
||||
Xlevel = (xlevel*A),
|
||||
|
@ -170,11 +173,15 @@ define_proof! {
|
|||
TId = (tid*A),
|
||||
TBucket = (b*Xbucket),
|
||||
TBucket = (tbucket*A),
|
||||
TInvRemain = (b*Xinvremain),
|
||||
TInvRemain = (tinvremain*A),
|
||||
TBlockages = (b*Xblockages),
|
||||
TBlockages = (tblockages*A),
|
||||
EncQ0 = (s*B + tid*EncId0 + tbucket*EncBucket0
|
||||
+ tinvremain*EncInvRemain0
|
||||
+ tblockages*EncBlockages0),
|
||||
EncQ1 = (s*D + tid*EncId1 + tbucket*EncBucket1
|
||||
+ tinvremain*EncInvRemain1
|
||||
+ tblockages*EncBlockages1
|
||||
+ x0*P + xlevel*Plevel + xsince*Psince)
|
||||
}
|
||||
|
@ -487,6 +494,12 @@ impl BridgeAuth {
|
|||
// invitations for moving from level i to level i+1)
|
||||
let invremain: Scalar = LEVEL_INVITATIONS[(level - 3) as usize].into();
|
||||
|
||||
let sinvremain = Scalar::random(&mut rng);
|
||||
let EncInvRemain = (
|
||||
&sinvremain * Btable,
|
||||
&invremain * Btable + sinvremain * req.D,
|
||||
);
|
||||
|
||||
// Compute the MAC on the visible attributes
|
||||
let b = Scalar::random(&mut rng);
|
||||
let P = &b * Btable;
|
||||
|
@ -507,6 +520,9 @@ impl BridgeAuth {
|
|||
let tbucket = self.lox_priv.x[2] * b;
|
||||
let TBucket = &tbucket * Atable;
|
||||
let EncQBucket = (tbucket * req.EncBucket.0, tbucket * req.EncBucket.1);
|
||||
let tinvremain = self.lox_priv.x[5] * b;
|
||||
let TInvRemain = &tinvremain * Atable;
|
||||
let EncQInvRemain = (tinvremain * EncInvRemain.0, tinvremain * EncInvRemain.1);
|
||||
let tblockages = self.lox_priv.x[6] * b;
|
||||
let TBlockages = &tblockages * Atable;
|
||||
let EncQBlockages = (
|
||||
|
@ -515,8 +531,8 @@ impl BridgeAuth {
|
|||
);
|
||||
|
||||
let EncQ = (
|
||||
EncQHc.0 + EncQId.0 + EncQBucket.0 + EncQBlockages.0,
|
||||
EncQHc.1 + EncQId.1 + EncQBucket.1 + EncQBlockages.1,
|
||||
EncQHc.0 + EncQId.0 + EncQBucket.0 + EncQInvRemain.0 + EncQBlockages.0,
|
||||
EncQHc.1 + EncQId.1 + EncQBucket.1 + EncQInvRemain.1 + EncQBlockages.1,
|
||||
);
|
||||
|
||||
let mut transcript = Transcript::new(b"blockage migration issuing");
|
||||
|
@ -537,15 +553,17 @@ impl BridgeAuth {
|
|||
Xblockages: &self.lox_pub.X[6],
|
||||
Plevel: &(trust_level * P),
|
||||
Psince: &(level_since * P),
|
||||
Pinvremain: &(invremain * P),
|
||||
TId: &TId,
|
||||
TBucket: &TBucket,
|
||||
TInvRemain: &TInvRemain,
|
||||
TBlockages: &TBlockages,
|
||||
D: &req.D,
|
||||
EncId0: &EncId.0,
|
||||
EncId1: &EncId.1,
|
||||
EncBucket0: &req.EncBucket.0,
|
||||
EncBucket1: &req.EncBucket.1,
|
||||
EncInvRemain0: &EncInvRemain.0,
|
||||
EncInvRemain1: &EncInvRemain.1,
|
||||
EncBlockages0: &req.EncBlockages.0,
|
||||
EncBlockages1: &req.EncBlockages.1,
|
||||
x0: &self.lox_priv.x[0],
|
||||
|
@ -560,6 +578,7 @@ impl BridgeAuth {
|
|||
b: &b,
|
||||
tid: &tid,
|
||||
tbucket: &tbucket,
|
||||
tinvremain: &tinvremain,
|
||||
tblockages: &tblockages,
|
||||
},
|
||||
)
|
||||
|
@ -569,9 +588,11 @@ impl BridgeAuth {
|
|||
level_since,
|
||||
P,
|
||||
EncQ,
|
||||
EncInvRemain,
|
||||
id_server,
|
||||
TId,
|
||||
TBucket,
|
||||
TInvRemain,
|
||||
TBlockages,
|
||||
piBlindIssue,
|
||||
})
|
||||
|
@ -613,6 +634,13 @@ pub fn handle_response(
|
|||
// moving from level i to level i+1)
|
||||
let invremain: Scalar = LEVEL_INVITATIONS[(new_level - 1) as usize].into();
|
||||
|
||||
// Decrypt EncInvRemain
|
||||
let recv_invremain = resp.EncInvRemain.1 - (state.d * resp.EncInvRemain.0);
|
||||
|
||||
if recv_invremain != &invremain * Btable {
|
||||
return Err(ProofError::VerificationFailure);
|
||||
}
|
||||
|
||||
// Verify the proof
|
||||
let mut transcript = Transcript::new(b"blockage migration issuing");
|
||||
blindissue::verify_compact(
|
||||
|
@ -633,15 +661,17 @@ pub fn handle_response(
|
|||
Xblockages: &lox_pub.X[6].compress(),
|
||||
Plevel: &(state.trust_level * resp.P).compress(),
|
||||
Psince: &(resp.level_since * resp.P).compress(),
|
||||
Pinvremain: &(invremain * resp.P).compress(),
|
||||
TId: &resp.TId.compress(),
|
||||
TBucket: &resp.TBucket.compress(),
|
||||
TInvRemain: &resp.TInvRemain.compress(),
|
||||
TBlockages: &resp.TBlockages.compress(),
|
||||
D: &state.D.compress(),
|
||||
EncId0: &EncId.0.compress(),
|
||||
EncId1: &EncId.1.compress(),
|
||||
EncBucket0: &state.EncBucket.0.compress(),
|
||||
EncBucket1: &state.EncBucket.1.compress(),
|
||||
EncInvRemain0: &resp.EncInvRemain.0.compress(),
|
||||
EncInvRemain1: &resp.EncInvRemain.1.compress(),
|
||||
EncBlockages0: &state.EncBlockages.0.compress(),
|
||||
EncBlockages1: &state.EncBlockages.1.compress(),
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue