core/src/main/java/org/bouncycastle/pqc/crypto/qtesla/QTESLA.java
/***************************************************************************************************************************************************************
     * Description:	Encode Signature for Provably-Secure qTESLA Security Category-3
     ***************************************************************************************************************************************************************/
Encode Signature for Provably-Secure qTESLA Security Category-3
Encode Signature for Provably - Secure qTESLA Security Category - 3
private static void encodeSignature(byte[] signature, int signatureOffset, byte[] C, int cOffset, long[] Z)
    {
        int j = 0;
        for (int i = 0; i < (Parameter.N_III_P * Parameter.D_III_P / Integer.SIZE); i += Parameter.D_III_P / Byte.SIZE)
        {
            CommonFunction.store32(signature, signatureOffset + Integer.SIZE / Byte.SIZE * (i + 0), (int)(((Z[j + 0] & ((1 << 24) - 1))) | (Z[j + 1] << 24)));
            CommonFunction.store32(signature, signatureOffset + Integer.SIZE / Byte.SIZE * (i + 1), (int)((((Z[j + 1] >> 8) & ((1 << 16) - 1))) | (Z[j + 2] << 16)));
            CommonFunction.store32(signature, signatureOffset + Integer.SIZE / Byte.SIZE * (i + 2), (int)((((Z[j + 2] >> 16) & ((1 << 8) - 1))) | (Z[j + 3] << 8)));
            j += Byte.SIZE / 2;
        }
        System.arraycopy(C, cOffset, signature, signatureOffset + Parameter.N_III_P * Parameter.D_III_P / Byte.SIZE, Polynomial.HASH);
    }
private static void encodeSignature ( byte [ ] signature , int signatureOffset , byte [ ] C , int cOffset , long [ ] Z ) { int j = 0 ; for ( int i = 0 ; i < ( Parameter . N_III_P * Parameter . D_III_P / Integer . SIZE ) ; i += Parameter . D_III_P / Byte . SIZE ) { CommonFunction . store32 ( signature , signatureOffset + Integer . SIZE / Byte . SIZE * ( i + 0 ) , ( int ) ( ( ( Z [ j + 0 ] & ( ( 1 << 24 ) - 1 ) ) ) | ( Z [ j + 1 ] << 24 ) ) ) ; CommonFunction . store32 ( signature , signatureOffset + Integer . SIZE / Byte . SIZE * ( i + 1 ) , ( int ) ( ( ( ( Z [ j + 1 ] >> 8 ) & ( ( 1 << 16 ) - 1 ) ) ) | ( Z [ j + 2 ] << 16 ) ) ) ; CommonFunction . store32 ( signature , signatureOffset + Integer . SIZE / Byte . SIZE * ( i + 2 ) , ( int ) ( ( ( ( Z [ j + 2 ] >> 16 ) & ( ( 1 << 8 ) - 1 ) ) ) | ( Z [ j + 3 ] << 8 ) ) ) ; j += Byte . SIZE / 2 ; } System . arraycopy ( C , cOffset , signature , signatureOffset + Parameter . N_III_P * Parameter . D_III_P / Byte . SIZE , Polynomial . HASH ) ; }
Description:     Encode Signature for Provably-Secure qTESLA Security Category-3
Description : Encode Signature for Provably - Secure qTESLA Security Category - 3