1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/services/crypto/component/nsISyncJPAKE.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,103 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +[scriptable, uuid(5ab02a98-5122-4b90-93cd-f259c4b42e3a)] 1.11 +interface nsISyncJPAKE : nsISupports 1.12 +{ 1.13 + /** 1.14 + * Perform first round of the JPAKE exchange. 1.15 + * 1.16 + * @param aSignerID 1.17 + * String identifying the signer. 1.18 + * @param aGX1 1.19 + * Schnorr signature value g^x1, in hex representation. 1.20 + * @param aGV1 1.21 + * Schnorr signature value g^v1 (v1 is a random value), in hex 1.22 + * representation. 1.23 + * @param aR1 1.24 + * Schnorr signature value r1 = v1 - x1 * h, in hex representation. 1.25 + * @param aGX2 1.26 + * Schnorr signature value g^x2, in hex representation. 1.27 + * @param aGV2 1.28 + * Schnorr signature value g^v2 (v2 is a random value), in hex 1.29 + * representation. 1.30 + * @param aR2 1.31 + * Schnorr signature value r2 = v2 - x2 * h, in hex representation. 1.32 + */ 1.33 + void round1(in ACString aSignerID, 1.34 + out ACString aGX1, 1.35 + out ACString aGV1, 1.36 + out ACString aR1, 1.37 + out ACString aGX2, 1.38 + out ACString aGV2, 1.39 + out ACString aR2); 1.40 + 1.41 + /** 1.42 + * Perform second round of the JPAKE exchange. 1.43 + * 1.44 + * @param aPeerID 1.45 + * String identifying the peer. 1.46 + * @param aPIN 1.47 + * String containing the weak secret (PIN). 1.48 + * @param aGX3 1.49 + * Schnorr signature value g^x3, in hex representation. 1.50 + * @param aGV3 1.51 + * Schnorr signature value g^v3 (v3 is a random value), in hex 1.52 + * representation. 1.53 + * @param aR3 1.54 + * Schnorr signature value r3 = v3 - x3 * h, in hex representation. 1.55 + * @param aGX4 1.56 + * Schnorr signature value g^x4, in hex representation. 1.57 + * @param aGV4 1.58 + * Schnorr signature value g^v4 (v4 is a random value), in hex 1.59 + * representation. 1.60 + * @param aR4 1.61 + * Schnorr signature value r4 = v4 - x4 * h, in hex representation. 1.62 + * @param aA 1.63 + * Schnorr signature value A, in hex representation. 1.64 + * @param aGVA 1.65 + * Schnorr signature value g^va (va is a random value), in hex 1.66 + * representation. 1.67 + * @param aRA 1.68 + * Schnorr signature value ra = va - xa * h, in hex representation. 1.69 + */ 1.70 + void round2(in ACString aPeerID, 1.71 + in ACString aPIN, 1.72 + in ACString aGX3, 1.73 + in ACString aGV3, 1.74 + in ACString aR3, 1.75 + in ACString aGX4, 1.76 + in ACString aGV4, 1.77 + in ACString aR4, 1.78 + out ACString aA, 1.79 + out ACString aGVA, 1.80 + out ACString aRA); 1.81 + 1.82 + /** 1.83 + * Perform the final step of the JPAKE exchange. This will compute 1.84 + * the key and expand the key to two keys, an AES256 encryption key 1.85 + * and a 256 bit HMAC key. It returns a key confirmation value 1.86 + * (SHA256d of the key) and the encryption and HMAC keys. 1.87 + * 1.88 + * @param aB 1.89 + * Schnorr signature value B, in hex representation. 1.90 + * @param aGVB 1.91 + * Schnorr signature value g^vb (vb is a random value), in hex 1.92 + * representation. 1.93 + * @param aRB 1.94 + * Schnorr signature value rb = vb - xb * h, in hex representation. 1.95 + * @param aAES256Key 1.96 + * The AES 256 encryption key, in base64 representation. 1.97 + * @param aHMAC256Key 1.98 + * The 256 bit HMAC key, in base64 representation. 1.99 + */ 1.100 + void final(in ACString aB, 1.101 + in ACString aGVB, 1.102 + in ACString aRB, 1.103 + in ACString aHkdfInfo, 1.104 + out ACString aAES256Key, 1.105 + out ACString aHMAC256Key); 1.106 +};