⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 referencemultiplier.java

📁 kmlnjlkj nlkjlkjkljl okopokipoipo oipipipo i
💻 JAVA
字号:
package org.bouncycastle.math.ec;import java.math.BigInteger;class ReferenceMultiplier implements ECMultiplier{    /**     * Simple shift-and-add multiplication. Serves as reference implementation     * to verify (possibly faster) implementations in     * {@link org.bouncycastle.math.ec.ECPoint ECPoint}.     *      * @param p The point to multiply.     * @param k The factor by which to multiply.     * @return The result of the point multiplication <code>k * p</code>.     */    public ECPoint multiply(ECPoint p, BigInteger k, PreCompInfo preCompInfo)    {        ECPoint q = p.getCurve().getInfinity();        int t = k.bitLength();        for (int i = 0; i < t; i++)        {            if (k.testBit(i))            {                q = q.add(p);            }            p = p.twice();        }        return q;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -