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: package org.mozilla.gecko.sync.jpake; michael@0: michael@0: import java.math.BigInteger; michael@0: michael@0: import org.mozilla.gecko.sync.ExtendedJSONObject; michael@0: import org.mozilla.gecko.sync.setup.Constants; michael@0: michael@0: public class JPakeJson { michael@0: /* michael@0: * Helper function to generate a JSON-encoded ZKP. michael@0: */ michael@0: public static ExtendedJSONObject makeJZkp(BigInteger gr, BigInteger b, String id) { michael@0: ExtendedJSONObject result = new ExtendedJSONObject(); michael@0: result.put(Constants.ZKP_KEY_GR, BigIntegerHelper.toEvenLengthHex(gr)); michael@0: result.put(Constants.ZKP_KEY_B, BigIntegerHelper.toEvenLengthHex(b)); michael@0: result.put(Constants.ZKP_KEY_ID, id); michael@0: return result; michael@0: } michael@0: }