📄 x9curve.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: X9Curve.java
package jit.asn1.x9;
import jit.asn1.*;
import jit.math.BigInteger;
import jit.math.ec.ECCurve;
import jit.math.ec.ECFieldElement;
// Referenced classes of package jit.asn1.x9:
// X9FieldElement, X9ObjectIdentifiers, X9FieldID
public class X9Curve
implements DEREncodable, X9ObjectIdentifiers
{
private ECCurve curve;
private byte seed[];
public X9Curve(ECCurve curve)
{
this.curve = curve;
seed = null;
}
public X9Curve(ECCurve curve, byte seed[])
{
this.curve = curve;
this.seed = seed;
}
public X9Curve(X9FieldID fieldID, ASN1Sequence seq)
{
if(fieldID.getIdentifier().equals(X9ObjectIdentifiers.prime_field))
{
BigInteger q = ((DERInteger)fieldID.getParameters()).getValue();
X9FieldElement x9A = new X9FieldElement(true, q, (ASN1OctetString)seq.getObjectAt(0));
X9FieldElement x9B = new X9FieldElement(true, q, (ASN1OctetString)seq.getObjectAt(1));
curve = new jit.math.ec.ECCurve.Fp(q, x9A.getValue().toBigInteger(), x9B.getValue().toBigInteger());
} else
{
throw new RuntimeException("not implemented");
}
if(seq.size() == 3)
seed = ((DERBitString)seq.getObjectAt(2)).getBytes();
}
public ECCurve getCurve()
{
return curve;
}
public byte[] getSeed()
{
return seed;
}
public DERObject getDERObject()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add((new X9FieldElement(curve.getA())).getDERObject());
v.add((new X9FieldElement(curve.getB())).getDERObject());
if(seed != null)
v.add(new DERBitString(seed));
return new DERSequence(v);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -