// 
// Decompiled by Procyon v0.6.0
// 

package org.bouncycastle.pqc.crypto.mldsa;

class PolyVecMatrix
{
    private final PolyVecL[] matrix;
    
    PolyVecMatrix(final MLDSAEngine mldsaEngine) {
        final int dilithiumK = mldsaEngine.getDilithiumK();
        this.matrix = new PolyVecL[dilithiumK];
        for (int i = 0; i < dilithiumK; ++i) {
            this.matrix[i] = new PolyVecL(mldsaEngine);
        }
    }
    
    public void pointwiseMontgomery(final PolyVecK polyVecK, final PolyVecL polyVecL) {
        for (int i = 0; i < this.matrix.length; ++i) {
            polyVecK.getVectorIndex(i).pointwiseAccountMontgomery(this.matrix[i], polyVecL);
        }
    }
    
    public void expandMatrix(final byte[] array) {
        for (int i = 0; i < this.matrix.length; ++i) {
            this.matrix[i].uniformBlocks(array, i << 8);
        }
    }
    
    private String addString() {
        String s = "[";
        for (int i = 0; i < this.matrix.length; ++i) {
            final String string = s + "Outer Matrix " + i + " [" + this.matrix[i].toString();
            if (i == this.matrix.length - 1) {
                s = string + "]\n";
            }
            else {
                s = string + "],\n";
            }
        }
        return s + "]\n";
    }
    
    public String toString(final String s) {
        return s.concat(": \n" + this.addString());
    }
}
