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

package org.bouncycastle.pqc.crypto.mlkem;

class Reduce
{
    public static short montgomeryReduce(final int n) {
        return (short)(n - (short)(n * 62209) * 3329 >> 16);
    }
    
    public static short barretReduce(final short n) {
        return (short)(n - (short)((short)((short)((67108864L + 1664L) / 3329L) * n >> 26) * 3329));
    }
    
    public static short conditionalSubQ(final short n) {
        final short n2 = (short)(n - 3329);
        return (short)(n2 + (n2 >> 15 & 0xD01));
    }
    
    static int checkModulus(final short n) {
        return n - 3329;
    }
}
