core/src/main/java/org/bouncycastle/pqc/crypto/qtesla/QTESLA.java
/****************************************************************************************************************************************************************
     * Description:	Decode Public Key for Provably-Secure qTESLA Security Category-3
     *
     * @param        publicKey            Decoded Public Key
     * @param        seedA                Seed Used to Generate the Polynomials A_i for i = 1, ..., k
     * @param        seedAOffset            Starting Point of the Seed A
     * @param        publicKeyInput        Public Key to be Decoded
     *
     * @return none
     ****************************************************************************************************************************************************************/
Decode Public Key for Provably-Secure qTESLA Security Category-3
@param        publicKey            Decoded Public Key
@param        seedA                Seed Used to Generate the Polynomials A_i for i = 1, ..., k
@param        seedAOffset            Starting Point of the Seed A
@param        publicKeyInput        Public Key to be Decoded

@return none
Decode Public Key for Provably - Secure qTESLA Security Category - 3 @param publicKey Decoded Public Key @param seedA Seed Used to Generate the Polynomials A_i for i = 1 ... k @param seedAOffset Starting Point of the Seed A @param publicKeyInput Public Key to be Decoded @return none
private static void decodePublicKeyIIIP(int[] publicKey, byte[] seedA, int seedAOffset, final byte[] publicKeyInput)
    {
        int j = 0;
        int mask = (1 << Parameter.Q_LOGARITHM_III_P) - 1;
        for (short i = 0; i < Parameter.N_III_P * Parameter.K_III_P; i += Integer.SIZE)
        {
            publicKey[i] = CommonFunction.load32(publicKeyInput, Integer.SIZE / Byte.SIZE * j) & mask;
            for (int index = 1; index < Parameter.Q_LOGARITHM_III_P; index++)
            {
                publicKey[i + index] = ((CommonFunction.load32(publicKeyInput, Integer.SIZE / Byte.SIZE * (j + index - 1)) >>> (Integer.SIZE - index)) |
                    (CommonFunction.load32(publicKeyInput, Integer.SIZE / Byte.SIZE * (j + index)) << index)) & mask;
            }
            publicKey[i + Parameter.Q_LOGARITHM_III_P] = CommonFunction.load32(publicKeyInput, Integer.SIZE / Byte.SIZE * (j + Parameter.Q_LOGARITHM_III_P - 1)) >>> 1;
            j += Parameter.Q_LOGARITHM_III_P;
        }
        System.arraycopy(publicKeyInput, Parameter.N_III_P * Parameter.K_III_P * Parameter.Q_LOGARITHM_III_P / Byte.SIZE, seedA, seedAOffset, Polynomial.SEED);
    }
private static void decodePublicKeyIIIP ( int [ ] publicKey , byte [ ] seedA , int seedAOffset , final byte [ ] publicKeyInput ) { int j = 0 ; int mask = ( 1 << Parameter . Q_LOGARITHM_III_P ) - 1 ; for ( short i = 0 ; i < Parameter . N_III_P * Parameter . K_III_P ; i += Integer . SIZE ) { publicKey [ i ] = CommonFunction . load32 ( publicKeyInput , Integer . SIZE / Byte . SIZE * j ) & mask ; for ( int index = 1 ; index < Parameter . Q_LOGARITHM_III_P ; index ++ ) { publicKey [ i + index ] = ( ( CommonFunction . load32 ( publicKeyInput , Integer . SIZE / Byte . SIZE * ( j + index - 1 ) ) >>> ( Integer . SIZE - index ) ) | ( CommonFunction . load32 ( publicKeyInput , Integer . SIZE / Byte . SIZE * ( j + index ) ) << index ) ) & mask ; } publicKey [ i + Parameter . Q_LOGARITHM_III_P ] = CommonFunction . load32 ( publicKeyInput , Integer . SIZE / Byte . SIZE * ( j + Parameter . Q_LOGARITHM_III_P - 1 ) ) >>> 1 ; j += Parameter . Q_LOGARITHM_III_P ; } System . arraycopy ( publicKeyInput , Parameter . N_III_P * Parameter . K_III_P * Parameter . Q_LOGARITHM_III_P / Byte . SIZE , seedA , seedAOffset , Polynomial . SEED ) ; }
Description:     Decode Public Key for Provably-Secure qTESLA Security Category-3
 @param        publicKey            Decoded Public Key
 @param        seedA                Seed Used to Generate the Polynomials A_i for i = 1, ..., k
 @param        seedAOffset            Starting Point of the Seed A
 @param        publicKeyInput        Public Key to be Decoded
Description : Decode Public Key for Provably - Secure qTESLA Security Category - 3 @param publicKey Decoded Public Key @param seedA Seed Used to Generate the Polynomials A_i for i = 1 ... k @param seedAOffset Starting Point of the Seed A @param publicKeyInput Public Key to be Decoded