|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--HFE.HFE2_n
This class is the "central class" of QuartzLight and is used for speed measurement.
Field Summary | |
private static int[] |
codeVec
Cipher as a vector. |
(package private) static int |
extensionDegree
Holds the degree of the irreducible polynomial and thereby also the degree of the extension field |
(package private) boolean |
foundRoot
signals if we found a root or not, i.e., if the root-field is valid or not. |
(package private) static int[] |
generatingPolynomial
Central switch to change generating polynomial. |
(package private) static Poly2Max |
generatingPolynomialAsMaxPoly
Polynomial set in variable generatingPolynomial
but as a Poly2Max polynomial. |
(package private) static int |
messageSigLength
Holds the number of bits for a message in terms of a signature. |
(package private) static int |
padBits
Holds the number of bits for a message in terms of a signature. |
private Poly2_nMax |
privatePoly
Stores the private polynomial over GF(2^n). |
private Poly2MultiSquare[] |
publicPoly
Stores the public key in an array of polynomials. |
(package private) static int |
reductionTerm
Central switch to change the reduction term, i.e. |
private static int[] |
resVec
Message as a vector. |
(package private) java.util.Random |
rnd
Random number generator for signature generation |
private RootFinding |
rootFinder
Root finding algorithm |
private static int[] |
rootVec
Message as a vector. |
(package private) static int |
signatureLength
Holds the number of bits for a signature. |
private static int[] |
sigTmpVec
Hash of message as a vector. |
private static int[] |
textVec
Message as a vector. |
private static Field2_n |
tmpElem1
Temporary register [element of GF(2^n)]. |
private static Field2_n |
tmpElem2
Temporary register [element of GF(2^n)]. |
private Transform2 |
transS
Transformation S in HFE |
private AffinePolyVec |
transSpoly
Transform S in HFE in terms of affine polynomials |
private Transform2 |
transT
Transformation T in HFE |
private AffinePolyVec |
transTpoly
Transform T in HFE in terms of affine polynomials |
private static int[] |
valueVec
Message in a special format as a vector. |
Constructor Summary | |
(package private) |
HFE2_n(byte[] seed)
Initializes HFE2_n by generating the public and the private key from the given seed. |
Method Summary | |
boolean |
checkRoot(Field2_n root)
Collects the roots. |
private void |
encryptPrivate(Field2_n plain,
Field2_n res)
Encryptes a given, n bit plain text. |
(package private) void |
generateKeys(byte[] seed)
Generates the public and the private key from a given seed and stores them in the object's fields. |
(package private) void |
generateKeysInterpoly(byte[] seed)
Generates the public and the private key from a given seed and stores them in the object's fields. |
private static Poly2_nMax |
genPolyPrivate(java.security.SecureRandom rndGen)
Generates a private polynomial for HFE. |
private void |
genPolyPublic()
Generats the public polynomials from the private polynomial using base transformation. |
private void |
genPolyPublicInterpoly(Poly2MultiSquare[] res)
Generats the public polynomials from the private polynomial using polynomial interpolation. |
private Poly2MultiSquare[] |
genPolyPublicSlow()
Generats the public polynomials from the private polynomial using base transformation. |
void |
genSign(int[] message,
int[] res)
Generates signature for given message using (S,P,T). |
static void |
main(java.lang.String[] args)
Tests everything in this class |
static void |
speedIt()
Tests how fast the package runs on the current hardware. |
static void |
testIt()
Tests the functionality of the whole class. |
boolean |
valSign(int[] message,
int[] sig)
Validates if given signature sig is valid or not. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int[] generatingPolynomial
generatingPolynomialAsMaxPoly
static final int reductionTerm
static final int extensionDegree
static final Poly2Max generatingPolynomialAsMaxPoly
generatingPolynomial
but as a Poly2Max polynomial.
Does not need to be changed for different Field2_n
.static final int padBits
static final int messageSigLength
static final int signatureLength
boolean foundRoot
private Poly2_nMax privatePoly
private Poly2MultiSquare[] publicPoly
private Transform2 transS
private Transform2 transT
private AffinePolyVec transSpoly
private AffinePolyVec transTpoly
private RootFinding rootFinder
private static int[] textVec
private static int[] sigTmpVec
genSign(int[], int[])
private static int[] resVec
private static int[] rootVec
genSign(int[], int[])
private static int[] valueVec
private static int[] codeVec
private static Field2_n tmpElem1
private static Field2_n tmpElem2
java.util.Random rnd
Constructor Detail |
HFE2_n(byte[] seed)
seed
- Seed for the cryptographic random number generator.Method Detail |
private static Poly2_nMax genPolyPrivate(java.security.SecureRandom rndGen)
rndGen
- Secure random number generatorprivate Poly2MultiSquare[] genPolyPublicSlow()
private void genPolyPublic()
private void genPolyPublicInterpoly(Poly2MultiSquare[] res)
void generateKeys(byte[] seed)
seed
- Seed for the random number generator. Must be "quite long" to be secure
(e.g., at least 80 bits in the Quartz standard).void generateKeysInterpoly(byte[] seed)
seed
- Seed for the random number generator. Must be "quite long" to be secure
(e.g., at least 80 bits in the Quartz standard).private void encryptPrivate(Field2_n plain, Field2_n res)
transSpoly
, transTpoly
to be initialized correctly.plain
- plaintext as element from Field2_n
res
- result as element from Field2_n
public void genSign(int[] message, int[] res)
message
- to sign (in general: hash of this message with messageSigLength
bits)res
- signature for this message with signatureLength
bitspublic boolean valSign(int[] message, int[] sig)
sig
is valid or not.message
- which was signed (in general: hash of this message with messageSigLength
bits) using method genSign(int[], int[])
sig
- signature for this message with signatureLength
bitspublic boolean checkRoot(Field2_n root)
checkRoot
in interface CheckRoot
public static void testIt()
public static final void speedIt()
public static void main(java.lang.String[] args)
testIt()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |