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

package org.bouncycastle.crypto.constraints;

import org.bouncycastle.math.ec.ECCurve;
import java.math.BigInteger;

public class ConstraintUtils
{
    public static int bitsOfSecurityFor(final BigInteger bigInteger) {
        return bitsOfSecurityForFF(bigInteger.bitLength());
    }
    
    public static int bitsOfSecurityFor(final ECCurve ecCurve) {
        final int n = (ecCurve.getFieldSize() + 1) / 2;
        return (n > 256) ? 256 : n;
    }
    
    public static int bitsOfSecurityForFF(final int n) {
        if (n >= 2048) {
            return (n >= 3072) ? ((n >= 7680) ? ((n >= 15360) ? 256 : 192) : 128) : 112;
        }
        return (n >= 1024) ? 80 : 20;
    }
}
