core/src/main/java/org/bouncycastle/pqc/crypto/qtesla/QTESLA.java
/**********************************************************************************************************************************
     * Description:	Decode Signature for Heuristic qTESLA Security Category-3 (Option for Speed) and
     * 				Provably-Secure qTESLA Security Category-1
     **********************************************************************************************************************************/
Decode Signature for Heuristic qTESLA Security Category-3 (Option for Speed) and
Provably-Secure qTESLA Security Category-1
Decode Signature for Heuristic qTESLA Security Category - 3 ( Option for Speed ) and Provably - Secure qTESLA Security Category - 1
private static void decodeSignatureIIISpeedIP(byte[] C, long[] Z, final byte[] sig, int sOff, int n, int d)
    {
        int j = 0;
        for (int i = 0; i < n; i += Integer.SIZE / 2)
        {
            Z[i + 0] = (CommonFunction.load32(sig, sOff + 4 * (j + 0)) << 10) >> 10;
            Z[i + 1] = (CommonFunction.load32(sig, sOff + 4 * (j + 0)) >>> 22) |
                ((CommonFunction.load32(sig, sOff + 4 * (j + 1)) << 20) >> 10);
            Z[i + 2] = (CommonFunction.load32(sig, sOff + 4 * (j + 1)) >>> 12) |
                ((CommonFunction.load32(sig, sOff + 4 * (j + 2)) << 30) >> 10);
            Z[i + 3] = (CommonFunction.load32(sig, sOff + 4 * (j + 2)) << 8) >> 10;
            Z[i + 4] = (CommonFunction.load32(sig, sOff + 4 * (j + 2)) >>> 24) |
                ((CommonFunction.load32(sig, sOff + 4 * (j + 3)) << 18) >> 10);
            Z[i + 5] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 3)) >>> 14) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 4)) << 28) >> 10);
            Z[i + 6] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 4)) << 6) >> 10;
            Z[i + 7] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 4)) >>> 26) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 5)) << 16) >> 10);
            Z[i + 8] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 5)) >>> 16) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 6)) << 26) >> 10);
            Z[i + 9] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 6)) << 4) >> 10;
            Z[i + 10] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 6)) >>> 28) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 7)) << 14) >> 10);
            Z[i + 11] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 7)) >>> 18) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 8)) << 24) >> 10);
            Z[i + 12] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 8)) << 2) >> 10;
            Z[i + 13] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 8)) >>> 30) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 9)) << 12) >> 10);
            Z[i + 14] = (CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 9)) >>> 20) |
                ((CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 10)) << 22) >> 10);
            Z[i + 15] = CommonFunction.load32(sig, sOff + Integer.SIZE / Byte.SIZE * (j + 10)) >> 10;
            j += d / 2;
        }
        System.arraycopy(sig, sOff + n * d / Byte.SIZE, C, 0, Polynomial.HASH);
    }
private static void decodeSignatureIIISpeedIP ( byte [ ] C , long [ ] Z , final byte [ ] sig , int sOff , int n , int d ) { int j = 0 ; for ( int i = 0 ; i < n ; i += Integer . SIZE / 2 ) { Z [ i + 0 ] = ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 0 ) ) << 10 ) >> 10 ; Z [ i + 1 ] = ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 0 ) ) >>> 22 ) | ( ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 1 ) ) << 20 ) >> 10 ) ; Z [ i + 2 ] = ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 1 ) ) >>> 12 ) | ( ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 2 ) ) << 30 ) >> 10 ) ; Z [ i + 3 ] = ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 2 ) ) << 8 ) >> 10 ; Z [ i + 4 ] = ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 2 ) ) >>> 24 ) | ( ( CommonFunction . load32 ( sig , sOff + 4 * ( j + 3 ) ) << 18 ) >> 10 ) ; Z [ i + 5 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 3 ) ) >>> 14 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 4 ) ) << 28 ) >> 10 ) ; Z [ i + 6 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 4 ) ) << 6 ) >> 10 ; Z [ i + 7 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 4 ) ) >>> 26 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 5 ) ) << 16 ) >> 10 ) ; Z [ i + 8 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 5 ) ) >>> 16 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 6 ) ) << 26 ) >> 10 ) ; Z [ i + 9 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 6 ) ) << 4 ) >> 10 ; Z [ i + 10 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 6 ) ) >>> 28 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 7 ) ) << 14 ) >> 10 ) ; Z [ i + 11 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 7 ) ) >>> 18 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 8 ) ) << 24 ) >> 10 ) ; Z [ i + 12 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 8 ) ) << 2 ) >> 10 ; Z [ i + 13 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 8 ) ) >>> 30 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 9 ) ) << 12 ) >> 10 ) ; Z [ i + 14 ] = ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 9 ) ) >>> 20 ) | ( ( CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 10 ) ) << 22 ) >> 10 ) ; Z [ i + 15 ] = CommonFunction . load32 ( sig , sOff + Integer . SIZE / Byte . SIZE * ( j + 10 ) ) >> 10 ; j += d / 2 ; } System . arraycopy ( sig , sOff + n * d / Byte . SIZE , C , 0 , Polynomial . HASH ) ; }
Description:     Decode Signature for Heuristic qTESLA Security Category-3 (Option for Speed) and
                          Provably-Secure qTESLA Security Category-1
Description : Decode Signature for Heuristic qTESLA Security Category - 3 ( Option for Speed ) and Provably - Secure qTESLA Security Category - 1