Here you can find the source of serializeModexpNoBase(BigInteger[] modexp, boolean withResult)
Parameter | Description |
---|---|
modexp | the modexp to serialize |
withResult | true to include result, false to omit |
static String serializeModexpNoBase(BigInteger[] modexp, boolean withResult)
//package com.java2s; /*/*from www . j a v a 2 s .c om*/ * Copyright 2016 Pascal Mainini * Licensed under MIT license, see included file LICENSE or * http://opensource.org/licenses/MIT */ import java.math.BigInteger; public class Main { /** * Helper method creating the JSON string for a single modexp without base and with or without given result. * @param modexp the modexp to serialize * @param withResult true to include result, false to omit * @return A JSON representation of modexp */ static String serializeModexpNoBase(BigInteger[] modexp, boolean withResult) { return withResult ? String.format("{\"m\":\"%s\",\"e\":\"%s\",\"r\":\"%s\"}", modexp[0].toString(16), modexp[2].toString(16), modexp[3].toString(16)) : String.format("{\"m\":\"%s\",\"e\":\"%s\"}", modexp[0].toString(16), modexp[2].toString(16)); } }