本文整理汇总了Java中org.bouncycastle.crypto.params.GOST3410ValidationParameters类的典型用法代码示例。如果您正苦于以下问题:Java GOST3410ValidationParameters类的具体用法?Java GOST3410ValidationParameters怎么用?Java GOST3410ValidationParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GOST3410ValidationParameters类属于org.bouncycastle.crypto.params包,在下文中一共展示了GOST3410ValidationParameters类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateParameters
import org.bouncycastle.crypto.params.GOST3410ValidationParameters; //导入依赖的package包/类
/**
* which generates the p , q and a values from the given parameters,
* returning the GOST3410Parameters object.
*/
public GOST3410Parameters generateParameters()
{
BigInteger [] pq = new BigInteger[2];
BigInteger q = null, p = null, a = null;
int x0, c;
long x0L, cL;
if (typeproc==1)
{
x0 = init_random.nextInt();
c = init_random.nextInt();
switch(size)
{
case 512:
procedure_A(x0, c, pq, 512);
break;
case 1024:
procedure_B(x0, c, pq);
break;
default:
throw new IllegalArgumentException("Ooops! key size 512 or 1024 bit.");
}
p = pq[0]; q = pq[1];
a = procedure_C(p, q);
//System.out.println("p:"+p.toString(16)+"\n"+"q:"+q.toString(16)+"\n"+"a:"+a.toString(16));
//System.out.println("p:"+p+"\n"+"q:"+q+"\n"+"a:"+a);
return new GOST3410Parameters(p, q, a, new GOST3410ValidationParameters(x0, c));
}
else
{
x0L = init_random.nextLong();
cL = init_random.nextLong();
switch(size)
{
case 512:
procedure_Aa(x0L, cL, pq, 512);
break;
case 1024:
procedure_Bb(x0L, cL, pq);
break;
default:
throw new IllegalStateException("Ooops! key size 512 or 1024 bit.");
}
p = pq[0]; q = pq[1];
a = procedure_C(p, q);
//System.out.println("p:"+p.toString(16)+"\n"+"q:"+q.toString(16)+"\n"+"a:"+a.toString(16));
//System.out.println("p:"+p+"\n"+"q:"+q+"\n"+"a:"+a);
return new GOST3410Parameters(p, q, a, new GOST3410ValidationParameters(x0L, cL));
}
}