How to use the bcrypto/lib/bn.js.fromJSON function in bcrypto

To help you get started, we’ve selected a few bcrypto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github handshake-org / goosig / lib / js / signature.js View on Github external
assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
fromJSON(json) {
    assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
fromJSON(json) {
    assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
fromJSON(json) {
    assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
fromJSON(json) {
    assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
github handshake-org / goosig / lib / js / signature.js View on Github external
fromJSON(json) {
    assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
fromJSON(json) {
    assert(json && typeof json === 'object');

    this.C2 = BN.fromJSON(json.C2);
    this.C3 = BN.fromJSON(json.C3);
    this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }
github handshake-org / goosig / lib / js / goo.js View on Github external
assert((json.shifts >>> 0) === json.shifts);
    assert((json.bitsPerWindow >>> 0) === json.bitsPerWindow);
    assert((json.bits >>> 0) === json.bits);
    assert((json.pointsPerSubcomb >>> 0) === json.pointsPerSubcomb);
    assert(Array.isArray(json.items));

    this.pointsPerAdd = json.pointsPerAdd;
    this.addsPerShift = json.addsPerShift;
    this.shifts = json.shifts;
    this.bitsPerWindow = json.bitsPerWindow;
    this.bits = json.bits;
    this.pointsPerSubcomb = json.pointsPerSubcomb;
    this.size = json.items.length;

    for (const item of json.items)
      this.items.push(BN.fromJSON(item));

    return this;
  }
github handshake-org / goosig / lib / js / signature.js View on Github external
this.t = BN.fromJSON(json.t);
    this.chal = BN.fromJSON(json.chal);
    this.ell = BN.fromJSON(json.ell);
    this.Aq = BN.fromJSON(json.Aq);
    this.Bq = BN.fromJSON(json.Bq);
    this.Cq = BN.fromJSON(json.Cq);
    this.Dq = BN.fromJSON(json.Dq);
    this.Eq = BN.fromJSON(json.Eq);
    this.z_w = BN.fromJSON(json.z_w);
    this.z_w2 = BN.fromJSON(json.z_w2);
    this.z_s1 = BN.fromJSON(json.z_s1);
    this.z_a = BN.fromJSON(json.z_a);
    this.z_an = BN.fromJSON(json.z_an);
    this.z_s1w = BN.fromJSON(json.z_s1w);
    this.z_sa = BN.fromJSON(json.z_sa);
    this.z_s2 = BN.fromJSON(json.z_s2);

    return this;
  }