michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [scriptable, uuid(5ab02a98-5122-4b90-93cd-f259c4b42e3a)] michael@0: interface nsISyncJPAKE : nsISupports michael@0: { michael@0: /** michael@0: * Perform first round of the JPAKE exchange. michael@0: * michael@0: * @param aSignerID michael@0: * String identifying the signer. michael@0: * @param aGX1 michael@0: * Schnorr signature value g^x1, in hex representation. michael@0: * @param aGV1 michael@0: * Schnorr signature value g^v1 (v1 is a random value), in hex michael@0: * representation. michael@0: * @param aR1 michael@0: * Schnorr signature value r1 = v1 - x1 * h, in hex representation. michael@0: * @param aGX2 michael@0: * Schnorr signature value g^x2, in hex representation. michael@0: * @param aGV2 michael@0: * Schnorr signature value g^v2 (v2 is a random value), in hex michael@0: * representation. michael@0: * @param aR2 michael@0: * Schnorr signature value r2 = v2 - x2 * h, in hex representation. michael@0: */ michael@0: void round1(in ACString aSignerID, michael@0: out ACString aGX1, michael@0: out ACString aGV1, michael@0: out ACString aR1, michael@0: out ACString aGX2, michael@0: out ACString aGV2, michael@0: out ACString aR2); michael@0: michael@0: /** michael@0: * Perform second round of the JPAKE exchange. michael@0: * michael@0: * @param aPeerID michael@0: * String identifying the peer. michael@0: * @param aPIN michael@0: * String containing the weak secret (PIN). michael@0: * @param aGX3 michael@0: * Schnorr signature value g^x3, in hex representation. michael@0: * @param aGV3 michael@0: * Schnorr signature value g^v3 (v3 is a random value), in hex michael@0: * representation. michael@0: * @param aR3 michael@0: * Schnorr signature value r3 = v3 - x3 * h, in hex representation. michael@0: * @param aGX4 michael@0: * Schnorr signature value g^x4, in hex representation. michael@0: * @param aGV4 michael@0: * Schnorr signature value g^v4 (v4 is a random value), in hex michael@0: * representation. michael@0: * @param aR4 michael@0: * Schnorr signature value r4 = v4 - x4 * h, in hex representation. michael@0: * @param aA michael@0: * Schnorr signature value A, in hex representation. michael@0: * @param aGVA michael@0: * Schnorr signature value g^va (va is a random value), in hex michael@0: * representation. michael@0: * @param aRA michael@0: * Schnorr signature value ra = va - xa * h, in hex representation. michael@0: */ michael@0: void round2(in ACString aPeerID, michael@0: in ACString aPIN, michael@0: in ACString aGX3, michael@0: in ACString aGV3, michael@0: in ACString aR3, michael@0: in ACString aGX4, michael@0: in ACString aGV4, michael@0: in ACString aR4, michael@0: out ACString aA, michael@0: out ACString aGVA, michael@0: out ACString aRA); michael@0: michael@0: /** michael@0: * Perform the final step of the JPAKE exchange. This will compute michael@0: * the key and expand the key to two keys, an AES256 encryption key michael@0: * and a 256 bit HMAC key. It returns a key confirmation value michael@0: * (SHA256d of the key) and the encryption and HMAC keys. michael@0: * michael@0: * @param aB michael@0: * Schnorr signature value B, in hex representation. michael@0: * @param aGVB michael@0: * Schnorr signature value g^vb (vb is a random value), in hex michael@0: * representation. michael@0: * @param aRB michael@0: * Schnorr signature value rb = vb - xb * h, in hex representation. michael@0: * @param aAES256Key michael@0: * The AES 256 encryption key, in base64 representation. michael@0: * @param aHMAC256Key michael@0: * The 256 bit HMAC key, in base64 representation. michael@0: */ michael@0: void final(in ACString aB, michael@0: in ACString aGVB, michael@0: in ACString aRB, michael@0: in ACString aHkdfInfo, michael@0: out ACString aAES256Key, michael@0: out ACString aHMAC256Key); michael@0: };