Examples of IGF2


Examples of com.securityinnovation.jNeo.inputstream.IGF2

        InputStream  prng)
        throws ParamSetNotSupportedException
    {
        KeyParams keyParams = KeyParams.getKeyParams(oid);

        IGF2 igf = new IGF2(keyParams.N, keyParams.c, prng);

        // Generate trinomial g that is invertible
        FullPolynomial g = null;
        boolean gIsInvertible = false;
        while (!gIsInvertible)
View Full Code Here

Examples of com.securityinnovation.jNeo.inputstream.IGF2

           
            // Form sData = OID | m | b | hTrunc
            byte sData[] = form_sData(message, 0, message.length, M, 0);
           
            // Form r from sData.
            IGF2 igf = new IGF2(
                keyParams.N, keyParams.c, keyParams.igfHash, keyParams.minCallsR,
                sData, 0, sData.length);
            FullPolynomial r = BPGM3.genTrinomial(
                keyParams.N, keyParams.dr, keyParams.dr, igf);
            igf.close();
           
            // Calculate R = r * h mod q
            R = FullPolynomial.convolution(r, h, keyParams.q);
           
            // calculate R4 = R mod 4, form octet string
View Full Code Here

Examples of com.securityinnovation.jNeo.inputstream.IGF2

        // Form sData from OID, m, b, hTrunc
        // Note: b is the leading bytes of cM.
        byte sData[] = form_sData(cM, mOffset, mLen, cM, 0);

        // Calc cr from sData
        IGF2 igf = new IGF2(
            keyParams.N, keyParams.c, keyParams.igfHash, keyParams.minCallsR,
            sData, 0, sData.length);
        FullPolynomial cr = BPGM3.genTrinomial(
            keyParams.N, keyParams.dr, keyParams.dr, igf);
        igf.close();

        // Calculate cR' = h * cr mod q
        FullPolynomial cRPrime = FullPolynomial.convolution(cr, h, keyParams.q);
        // If cR != cR', fail
        if (!cR.equals(cRPrime))
View Full Code Here

Examples of com.securityinnovation.jNeo.inputstream.IGF2

    @Test public void test_oddeven()
    {
        byte igfSequence[] = {0,00,20,40,60,8,
                              0,10,30,50,70,9};
        ByteArrayInputStream is = new ByteArrayInputStream(igfSequence);
        IGF2 igf = new IGF2(0x7fff, 16, is);
       
        short polyCoeffs[] = {1, -1, 1, -1, 1, -1, 1, -1, 1, -1};
        FullPolynomial expected = new FullPolynomial(polyCoeffs);

        FullPolynomial out = BPGM3.genTrinomial(10, 5, 5, igf);
View Full Code Here

Examples of com.securityinnovation.jNeo.inputstream.IGF2

        byte igfSequence[] = {0,00,20,40,6
                              0,00,20,40,60,8,
                              0,00,20,40,60,8,
                              0,10,30,50,70,9};
        ByteArrayInputStream is = new ByteArrayInputStream(igfSequence);
        IGF2 igf = new IGF2(0x7fff, 16, is);
       
        short polyCoeffs[] = {1, -1, 1, -1, 1, -1, 1, -1, 1, -1};
        FullPolynomial expected = new FullPolynomial(polyCoeffs);

        FullPolynomial out = BPGM3.genTrinomial(10, 5, 5, igf);
View Full Code Here

Examples of com.securityinnovation.jNeo.inputstream.IGF2

        NtruEncryptTestVector tests[] = NtruEncryptTestVector.getTestVectors();
        for (int t=0; t<tests.length; t++)
        {
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);
            FullPolynomial expected = new FullPolynomial(tests[t].r);
            IGF2 igf = new IGF2(
                keyParams.N, keyParams.c, keyParams.igfHash, 1,
                tests[t].sData, 0, tests[t].sData.length);
            FullPolynomial out = BPGM3.genTrinomial(
                keyParams.N, keyParams.dr, keyParams.dr, igf);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.