当前位置: 首页>>代码示例>>Java>>正文


Java Nat224类代码示例

本文整理汇总了Java中org.bouncycastle.math.raw.Nat224的典型用法代码示例。如果您正苦于以下问题:Java Nat224类的具体用法?Java Nat224怎么用?Java Nat224使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Nat224类属于org.bouncycastle.math.raw包,在下文中一共展示了Nat224类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isSquare

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
private static boolean isSquare(int[] x)
{
    int[] t1 = Nat224.create();
    int[] t2 = Nat224.create();
    Nat224.copy(x, t1);

    for (int i = 0; i < 7; ++i)
    {
        Nat224.copy(t1, t2);
        SecP224R1Field.squareN(t1, 1 << i, t1);
        SecP224R1Field.multiply(t1, t2, t1);
    }

    SecP224R1Field.squareN(t1, 95, t1);
    return Nat224.isOne(t1);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:17,代码来源:SecP224R1FieldElement.java

示例2: RP

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
private static void RP(int[] nc, int[] d1, int[] e1, int[] f1, int[] t)
{
    Nat224.copy(nc, f1);

    int[] d0 = Nat224.create();
    int[] e0 = Nat224.create();

    for (int i = 0; i < 7; ++i)
    {
        Nat224.copy(d1, d0);
        Nat224.copy(e1, e0);

        int j = 1 << i;
        while (--j >= 0)
        {
            RS(d1, e1, f1, t);
        }

        RM(nc, d0, e0, d1, e1, f1, t);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:22,代码来源:SecP224R1FieldElement.java

示例3: half

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void half(int[] x, int[] z)
{
    if ((x[0] & 1) == 0)
    {
        Nat.shiftDownBit(7, x, 0, z);
    }
    else
    {
        int c = Nat224.add(x, P, z);
        Nat.shiftDownBit(7, z, c);
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:13,代码来源:SecP224K1Field.java

示例4: squareN

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void squareN(int[] x, int n, int[] z)
    {
//        assert n > 0;

        int[] tt = Nat224.createExt();
        Nat224.square(x, tt);
        reduce(tt, z);

        while (--n > 0)
        {
            Nat224.square(z, tt);
            reduce(tt, z);
        }
    }
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:15,代码来源:SecP224K1Field.java

示例5: divide

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public ECFieldElement divide(ECFieldElement b)
    {
//        return multiply(b.invert());
        int[] z = Nat224.create();
        Mod.invert(SecP224K1Field.P, ((SecP224K1FieldElement)b).x, z);
        SecP224K1Field.multiply(z, x, z);
        return new SecP224K1FieldElement(z);
    }
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:9,代码来源:SecP224K1FieldElement.java

示例6: invert

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public ECFieldElement invert()
    {
//        return new SecP224K1FieldElement(toBigInteger().modInverse(Q));
        int[] z = Nat224.create();
        Mod.invert(SecP224K1Field.P, x, z);
        return new SecP224K1FieldElement(z);
    }
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:8,代码来源:SecP224K1FieldElement.java

示例7: equals

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public boolean equals(Object other)
{
    if (other == this)
    {
        return true;
    }

    if (!(other instanceof SecP224K1FieldElement))
    {
        return false;
    }

    SecP224K1FieldElement o = (SecP224K1FieldElement)other;
    return Nat224.eq(x, o.x);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:16,代码来源:SecP224K1FieldElement.java

示例8: add

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void add(int[] x, int[] y, int[] z)
{
    int c = Nat224.add(x, y, z);
    if (c != 0 || (z[6] == P6 && Nat224.gte(z, P)))
    {
        addPInvTo(z);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:9,代码来源:SecP224R1Field.java

示例9: addOne

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void addOne(int[] x, int[] z)
{
    int c = Nat.inc(7, x, z);
    if (c != 0 || (z[6] == P6 && Nat224.gte(z, P)))
    {
        addPInvTo(z);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:9,代码来源:SecP224R1Field.java

示例10: fromBigInteger

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static int[] fromBigInteger(BigInteger x)
{
    int[] z = Nat224.fromBigInteger(x);
    if (z[6] == P6 && Nat224.gte(z, P))
    {
        Nat224.subFrom(P, z);
    }
    return z;
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:10,代码来源:SecP224R1Field.java

示例11: multiplyAddToExt

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void multiplyAddToExt(int[] x, int[] y, int[] zz)
{
    int c = Nat224.mulAddTo(x, y, zz);
    if (c != 0 || (zz[13] == PExt13 && Nat.gte(14, zz, PExt)))
    {
        if (Nat.addTo(PExtInv.length, PExtInv, zz) != 0)
        {
            Nat.incAt(14, zz, PExtInv.length);
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:12,代码来源:SecP224R1Field.java

示例12: negate

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void negate(int[] x, int[] z)
{
    if (Nat224.isZero(x))
    {
        Nat224.zero(z);
    }
    else
    {
        Nat224.sub(P, x, z);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:12,代码来源:SecP224R1Field.java

示例13: reduce32

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void reduce32(int x, int[] z)
    {
        long cc = 0;

        if (x != 0)
        {
            long xx07 = x & M;

            cc += (z[0] & M) - xx07;
            z[0] = (int)cc;
            cc >>= 32;
            if (cc != 0)
            {
                cc += (z[1] & M);
                z[1] = (int)cc;
                cc >>= 32;
                cc += (z[2] & M);
                z[2] = (int)cc;
                cc >>= 32;
            }
            cc += (z[3] & M) + xx07;
            z[3] = (int)cc;
            cc >>= 32;

//            assert cc == 0 || cc == 1;
        }

        if ((cc != 0 && Nat.incAt(7, z, 4) != 0)
            || (z[6] == P6 && Nat224.gte(z, P)))
        {
            addPInvTo(z);
        }
    }
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:34,代码来源:SecP224R1Field.java

示例14: subtract

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void subtract(int[] x, int[] y, int[] z)
{
    int c = Nat224.sub(x, y, z);
    if (c != 0)
    {
        subPInvFrom(z);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:9,代码来源:SecP224R1Field.java

示例15: twice

import org.bouncycastle.math.raw.Nat224; //导入依赖的package包/类
public static void twice(int[] x, int[] z)
{
    int c = Nat.shiftUpBit(7, x, 0, z);
    if (c != 0 || (z[6] == P6 && Nat224.gte(z, P)))
    {
        addPInvTo(z);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:9,代码来源:SecP224R1Field.java


注:本文中的org.bouncycastle.math.raw.Nat224类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。