本文整理汇总了Java中org.bouncycastle.crypto.params.KDFFeedbackParameters.useCounter方法的典型用法代码示例。如果您正苦于以下问题:Java KDFFeedbackParameters.useCounter方法的具体用法?Java KDFFeedbackParameters.useCounter怎么用?Java KDFFeedbackParameters.useCounter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.crypto.params.KDFFeedbackParameters
的用法示例。
在下文中一共展示了KDFFeedbackParameters.useCounter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.bouncycastle.crypto.params.KDFFeedbackParameters; //导入方法依赖的package包/类
public void init(DerivationParameters params)
{
if (!(params instanceof KDFFeedbackParameters))
{
throw new IllegalArgumentException("Wrong type of arguments given");
}
KDFFeedbackParameters feedbackParams = (KDFFeedbackParameters)params;
// --- init mac based PRF ---
this.prf.init(new KeyParameter(feedbackParams.getKI()));
// --- set arguments ---
this.fixedInputData = feedbackParams.getFixedInputData();
int r = feedbackParams.getR();
this.ios = new byte[r / 8];
if (feedbackParams.useCounter())
{
// this is more conservative than the spec
BigInteger maxSize = TWO.pow(r).multiply(BigInteger.valueOf(h));
this.maxSizeExcl = maxSize.compareTo(INTEGER_MAX) == 1 ?
Integer.MAX_VALUE : maxSize.intValue();
}
else
{
this.maxSizeExcl = Integer.MAX_VALUE;
}
this.iv = feedbackParams.getIV();
this.useCounter = feedbackParams.useCounter();
// --- set operational state ---
generatedBytes = 0;
}