package org.bouncycastle.crypto.digests;

/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
class Utils {

    private static class DefaultProperties implements org.bouncycastle.crypto.CryptoServiceProperties {
        private final int a;
        private final java.lang.String b;
        private final org.bouncycastle.crypto.CryptoServicePurpose c;

        public DefaultProperties(int i, java.lang.String str, org.bouncycastle.crypto.CryptoServicePurpose cryptoServicePurpose) {
            this.a = i;
            this.b = str;
            this.c = cryptoServicePurpose;
        }

        @Override // org.bouncycastle.crypto.CryptoServiceProperties
        public int bitsOfSecurity() {
            return this.a;
        }

        @Override // org.bouncycastle.crypto.CryptoServiceProperties
        public org.bouncycastle.crypto.CryptoServicePurpose getPurpose() {
            return this.c;
        }

        @Override // org.bouncycastle.crypto.CryptoServiceProperties
        public java.lang.String getServiceName() {
            return this.b;
        }
    }

    private static class DefaultPropertiesWithPRF implements org.bouncycastle.crypto.CryptoServiceProperties {
        private final int a;
        private final int b;
        private final java.lang.String c;
        private final org.bouncycastle.crypto.CryptoServicePurpose d;

        public DefaultPropertiesWithPRF(int i, int i2, java.lang.String str, org.bouncycastle.crypto.CryptoServicePurpose cryptoServicePurpose) {
            this.a = i;
            this.b = i2;
            this.c = str;
            this.d = cryptoServicePurpose;
        }

        @Override // org.bouncycastle.crypto.CryptoServiceProperties
        public int bitsOfSecurity() {
            return this.d == org.bouncycastle.crypto.CryptoServicePurpose.PRF ? this.b : this.a;
        }

        @Override // org.bouncycastle.crypto.CryptoServiceProperties
        public org.bouncycastle.crypto.CryptoServicePurpose getPurpose() {
            return this.d;
        }

        @Override // org.bouncycastle.crypto.CryptoServiceProperties
        public java.lang.String getServiceName() {
            return this.c;
        }
    }

    static org.bouncycastle.crypto.CryptoServiceProperties a(org.bouncycastle.crypto.Digest digest, int i, org.bouncycastle.crypto.CryptoServicePurpose cryptoServicePurpose) {
        return new org.bouncycastle.crypto.digests.Utils.DefaultPropertiesWithPRF(digest.getDigestSize() * 4, i, digest.getAlgorithmName(), cryptoServicePurpose);
    }

    static org.bouncycastle.crypto.CryptoServiceProperties b(org.bouncycastle.crypto.Digest digest, org.bouncycastle.crypto.CryptoServicePurpose cryptoServicePurpose) {
        return new org.bouncycastle.crypto.digests.Utils.DefaultProperties(digest.getDigestSize() * 4, digest.getAlgorithmName(), cryptoServicePurpose);
    }
}
