NTRUEncryptionKeyGenerationParameters.java 文件源码

java
阅读 43 收藏 0 点赞 0 评论 0

项目:ipack 作者:
/**
 * Constructs a parameter set that uses ternary private keys (i.e. </code>polyType=SIMPLE</code>).
 *
 * @param N            number of polynomial coefficients
 * @param q            modulus
 * @param df           number of ones in the private polynomial <code>f</code>
 * @param dm0          minimum acceptable number of -1's, 0's, and 1's in the polynomial <code>m'</code> in the last encryption step
 * @param db           number of random bits to prepend to the message
 * @param c            a parameter for the Index Generation Function ({@link org.bouncycastle.pqc.crypto.ntru.IndexGenerator})
 * @param minCallsR    minimum number of hash calls for the IGF to make
 * @param minCallsMask minimum number of calls to generate the masking polynomial
 * @param hashSeed     whether to hash the seed in the MGF first (true) or use the seed directly (false)
 * @param oid          three bytes that uniquely identify the parameter set
 * @param sparse       whether to treat ternary polynomials as sparsely populated ({@link org.bouncycastle.pqc.math.ntru.polynomial.SparseTernaryPolynomial} vs {@link org.bouncycastle.pqc.math.ntru.polynomial.DenseTernaryPolynomial})
 * @param fastFp       whether <code>f=1+p*F</code> for a ternary <code>F</code> (true) or <code>f</code> is ternary (false)
 * @param hashAlg      a valid identifier for a <code>java.security.MessageDigest</code> instance such as <code>SHA-256</code>. The <code>MessageDigest</code> must support the <code>getDigestLength()</code> method.
 */
public NTRUEncryptionKeyGenerationParameters(int N, int q, int df, int dm0, int db, int c, int minCallsR, int minCallsMask, boolean hashSeed, byte[] oid, boolean sparse, boolean fastFp, Digest hashAlg)
{
    super(new SecureRandom(), db);
    this.N = N;
    this.q = q;
    this.df = df;
    this.db = db;
    this.dm0 = dm0;
    this.c = c;
    this.minCallsR = minCallsR;
    this.minCallsMask = minCallsMask;
    this.hashSeed = hashSeed;
    this.oid = oid;
    this.sparse = sparse;
    this.fastFp = fastFp;
    this.polyType = NTRUParameters.TERNARY_POLYNOMIAL_TYPE_SIMPLE;
    this.hashAlg = hashAlg;
    init();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号