Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | [scriptable, uuid(5ab02a98-5122-4b90-93cd-f259c4b42e3a)] |
michael@0 | 8 | interface nsISyncJPAKE : nsISupports |
michael@0 | 9 | { |
michael@0 | 10 | /** |
michael@0 | 11 | * Perform first round of the JPAKE exchange. |
michael@0 | 12 | * |
michael@0 | 13 | * @param aSignerID |
michael@0 | 14 | * String identifying the signer. |
michael@0 | 15 | * @param aGX1 |
michael@0 | 16 | * Schnorr signature value g^x1, in hex representation. |
michael@0 | 17 | * @param aGV1 |
michael@0 | 18 | * Schnorr signature value g^v1 (v1 is a random value), in hex |
michael@0 | 19 | * representation. |
michael@0 | 20 | * @param aR1 |
michael@0 | 21 | * Schnorr signature value r1 = v1 - x1 * h, in hex representation. |
michael@0 | 22 | * @param aGX2 |
michael@0 | 23 | * Schnorr signature value g^x2, in hex representation. |
michael@0 | 24 | * @param aGV2 |
michael@0 | 25 | * Schnorr signature value g^v2 (v2 is a random value), in hex |
michael@0 | 26 | * representation. |
michael@0 | 27 | * @param aR2 |
michael@0 | 28 | * Schnorr signature value r2 = v2 - x2 * h, in hex representation. |
michael@0 | 29 | */ |
michael@0 | 30 | void round1(in ACString aSignerID, |
michael@0 | 31 | out ACString aGX1, |
michael@0 | 32 | out ACString aGV1, |
michael@0 | 33 | out ACString aR1, |
michael@0 | 34 | out ACString aGX2, |
michael@0 | 35 | out ACString aGV2, |
michael@0 | 36 | out ACString aR2); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Perform second round of the JPAKE exchange. |
michael@0 | 40 | * |
michael@0 | 41 | * @param aPeerID |
michael@0 | 42 | * String identifying the peer. |
michael@0 | 43 | * @param aPIN |
michael@0 | 44 | * String containing the weak secret (PIN). |
michael@0 | 45 | * @param aGX3 |
michael@0 | 46 | * Schnorr signature value g^x3, in hex representation. |
michael@0 | 47 | * @param aGV3 |
michael@0 | 48 | * Schnorr signature value g^v3 (v3 is a random value), in hex |
michael@0 | 49 | * representation. |
michael@0 | 50 | * @param aR3 |
michael@0 | 51 | * Schnorr signature value r3 = v3 - x3 * h, in hex representation. |
michael@0 | 52 | * @param aGX4 |
michael@0 | 53 | * Schnorr signature value g^x4, in hex representation. |
michael@0 | 54 | * @param aGV4 |
michael@0 | 55 | * Schnorr signature value g^v4 (v4 is a random value), in hex |
michael@0 | 56 | * representation. |
michael@0 | 57 | * @param aR4 |
michael@0 | 58 | * Schnorr signature value r4 = v4 - x4 * h, in hex representation. |
michael@0 | 59 | * @param aA |
michael@0 | 60 | * Schnorr signature value A, in hex representation. |
michael@0 | 61 | * @param aGVA |
michael@0 | 62 | * Schnorr signature value g^va (va is a random value), in hex |
michael@0 | 63 | * representation. |
michael@0 | 64 | * @param aRA |
michael@0 | 65 | * Schnorr signature value ra = va - xa * h, in hex representation. |
michael@0 | 66 | */ |
michael@0 | 67 | void round2(in ACString aPeerID, |
michael@0 | 68 | in ACString aPIN, |
michael@0 | 69 | in ACString aGX3, |
michael@0 | 70 | in ACString aGV3, |
michael@0 | 71 | in ACString aR3, |
michael@0 | 72 | in ACString aGX4, |
michael@0 | 73 | in ACString aGV4, |
michael@0 | 74 | in ACString aR4, |
michael@0 | 75 | out ACString aA, |
michael@0 | 76 | out ACString aGVA, |
michael@0 | 77 | out ACString aRA); |
michael@0 | 78 | |
michael@0 | 79 | /** |
michael@0 | 80 | * Perform the final step of the JPAKE exchange. This will compute |
michael@0 | 81 | * the key and expand the key to two keys, an AES256 encryption key |
michael@0 | 82 | * and a 256 bit HMAC key. It returns a key confirmation value |
michael@0 | 83 | * (SHA256d of the key) and the encryption and HMAC keys. |
michael@0 | 84 | * |
michael@0 | 85 | * @param aB |
michael@0 | 86 | * Schnorr signature value B, in hex representation. |
michael@0 | 87 | * @param aGVB |
michael@0 | 88 | * Schnorr signature value g^vb (vb is a random value), in hex |
michael@0 | 89 | * representation. |
michael@0 | 90 | * @param aRB |
michael@0 | 91 | * Schnorr signature value rb = vb - xb * h, in hex representation. |
michael@0 | 92 | * @param aAES256Key |
michael@0 | 93 | * The AES 256 encryption key, in base64 representation. |
michael@0 | 94 | * @param aHMAC256Key |
michael@0 | 95 | * The 256 bit HMAC key, in base64 representation. |
michael@0 | 96 | */ |
michael@0 | 97 | void final(in ACString aB, |
michael@0 | 98 | in ACString aGVB, |
michael@0 | 99 | in ACString aRB, |
michael@0 | 100 | in ACString aHkdfInfo, |
michael@0 | 101 | out ACString aAES256Key, |
michael@0 | 102 | out ACString aHMAC256Key); |
michael@0 | 103 | }; |