Make credentials serializable for Tor JS bindings
Author: onyinyang <onyinyang@users.noreply.github.com>
This commit is contained in:
parent
f7002632f7
commit
9ce2a81fe7
|
@ -6,6 +6,7 @@ zero-knowledge proof of its correctness (as it does at issuing time). */
|
|||
|
||||
use curve25519_dalek::ristretto::RistrettoPoint;
|
||||
use curve25519_dalek::scalar::Scalar;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// A migration credential.
|
||||
///
|
||||
|
@ -15,7 +16,7 @@ use curve25519_dalek::scalar::Scalar;
|
|||
/// from a 1-bridge untrusted bucket to a 3-bridge trusted bucket) and 1
|
||||
/// for blockage migrations (moving buckets because the from_bucket has
|
||||
/// been blocked).
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Migration {
|
||||
pub P: RistrettoPoint,
|
||||
pub Q: RistrettoPoint,
|
||||
|
@ -31,7 +32,7 @@ pub struct Migration {
|
|||
/// authority), but known only to the user. The level_since date is the
|
||||
/// Julian date of when this user was changed to the current trust
|
||||
/// level.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Lox {
|
||||
pub P: RistrettoPoint,
|
||||
pub Q: RistrettoPoint,
|
||||
|
@ -57,7 +58,7 @@ pub struct Lox {
|
|||
/// That way, people entitled to migrate buckets can receive a Migration
|
||||
/// credential with their new bucket, without the BA learning either
|
||||
/// their old or new buckets.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct MigrationKey {
|
||||
pub P: RistrettoPoint,
|
||||
pub Q: RistrettoPoint,
|
||||
|
@ -73,7 +74,7 @@ pub struct MigrationKey {
|
|||
/// credential (in zero knowledge) with today's date to prove that the
|
||||
/// bridges in their bucket have not been blocked, in order to gain a
|
||||
/// trust level.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct BucketReachability {
|
||||
pub P: RistrettoPoint,
|
||||
pub Q: RistrettoPoint,
|
||||
|
@ -89,7 +90,7 @@ pub struct BucketReachability {
|
|||
/// as the inviter, and inherits the inviter's blockages count (so that
|
||||
/// you can't clear your blockages count simply by inviting yourself).
|
||||
/// Invitations expire after some amount of time.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Invitation {
|
||||
pub P: RistrettoPoint,
|
||||
pub Q: RistrettoPoint,
|
||||
|
|
Loading…
Reference in New Issue