當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。