All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.pqc.math.ntru.parameters.NTRUHPSParameterSet Maven / Gradle / Ivy

Go to download

The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.8 and up.

There is a newer version: 1.79
Show newest version
package org.bouncycastle.pqc.math.ntru.parameters;

import org.bouncycastle.pqc.math.ntru.HPSPolynomial;
import org.bouncycastle.pqc.math.ntru.Polynomial;

/**
 * Abstract class for NTRU-HPS parameter classes.
 * 

* The naming convention for the classes is {@code NTRUHPS[q][n]}. e.g. {@link NTRUHPS2048509} has n = 509 and q = 2048. * * @see NTRUHPS2048509 * @see NTRUHPS2048677 * @see NTRUHPS4096821 * @see NTRU specification document section 1.3.2 */ public abstract class NTRUHPSParameterSet extends NTRUParameterSet { NTRUHPSParameterSet(int n, int logQ, int seedBytes, int prfKeyBytes, int sharedKeyBytes) { super(n, logQ, seedBytes, prfKeyBytes, sharedKeyBytes); } @Override public Polynomial createPolynomial() { return new HPSPolynomial(this); } @Override public int sampleFgBytes() { return sampleIidBytes() + sampleFixedTypeBytes(); } @Override public int sampleRmBytes() { return sampleIidBytes() + sampleFixedTypeBytes(); } public int weight() { return q() / 8 - 2; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy