All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.open.jwtdependency.org.bouncycastle.math.ec.ZSignedDigitL2RMultiplier Maven / Gradle / Ivy

Go to download

This is a drop in replacement for the auth0 java-jwt library (see https://github.com/auth0/java-jwt). This jar makes sure there are no external dependencies (e.g. fasterXml, Apacha Commons) needed. This is useful when deploying to an application server (e.g. tomcat with Alfreso or Pega).

The newest version!
package org.bouncycastle.math.ec;

import java.math.BigInteger;

public class ZSignedDigitL2RMultiplier extends AbstractECMultiplier
{
    /**
     * 'Zeroless' Signed Digit Left-to-Right.
     */
    protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
    {
        ECPoint addP = p.normalize(), subP = addP.negate();

        ECPoint R0 = addP;

        int n = k.bitLength();
        int s = k.getLowestSetBit();

        int i = n;
        while (--i > s)
        {
            R0 = R0.twicePlus(k.testBit(i) ? addP : subP);
        }

        R0 = R0.timesPow2(s);

        return R0;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy