Java BigInteger Calculate getClearExpPipe(BigInteger M)

Here you can find the source of getClearExpPipe(BigInteger M)

Description

Returns the numbers: M, M^2, M^3, ..., M^maxExp

License

Open Source License

Parameter

Parameter Description
M a parameter

Declaration

public static BigInteger[] getClearExpPipe(BigInteger M) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 FRESCO (http://github.com/aicis/fresco).
 *
 * This file is part of the FRESCO project.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE./*  w w w  . j a  va 2s .  c  om*/
 *
 * FRESCO uses SCAPI - http://crypto.biu.ac.il/SCAPI, Crypto++, Miracl, NTL,
 * and Bouncy Castle. Please see these projects for any further licensing issues.
 *******************************************************************************/

import java.math.BigInteger;

public class Main {
    private static BigInteger p = null;
    public static int EXP_PIPE_SIZE = 200 + 1;

    /**
     * Returns the numbers: M, M^2, M^3, ..., M^maxExp
     * @param M
     * @return
     */
    public static BigInteger[] getClearExpPipe(BigInteger M) {
        BigInteger[] Ms = new BigInteger[EXP_PIPE_SIZE - 1];
        Ms[0] = M;
        for (int i = 1; i < Ms.length; i++) {
            Ms[i] = Ms[i - 1].multiply(M).mod(p);
        }
        return Ms;
    }
}

Related

  1. getAddressText(BigInteger address)
  2. getByteArrayFromBigIntegerArray(Object value)
  3. getBytes(BigInteger bi, int minLen)
  4. getBytes(BigInteger big, int bitlen)
  5. getBytesWithoutSign(BigInteger arg)
  6. getCreateLocalNextHopJobKey(Long vpnId, BigInteger dpnId, String prefix)
  7. getDateOf(BigInteger fileTime)
  8. getDateOf(final BigInteger fileTime)
  9. getDigitCount(BigInteger number)