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

package com.google.crypto.tink.prf;

import com.google.crypto.tink.proto.AesCmacPrfKeyFormat;
import com.google.crypto.tink.proto.HmacPrfKeyFormat;
import com.google.crypto.tink.proto.HmacPrfParams;
import com.google.crypto.tink.proto.OutputPrefixType;
import com.google.crypto.tink.proto.HashType;
import com.google.crypto.tink.proto.HkdfPrfParams;
import com.google.crypto.tink.proto.HkdfPrfKeyFormat;
import com.google.crypto.tink.proto.KeyTemplate;

@Deprecated
public final class PrfKeyTemplates
{
    public static final KeyTemplate HKDF_SHA256;
    public static final KeyTemplate HMAC_SHA256_PRF;
    public static final KeyTemplate HMAC_SHA512_PRF;
    public static final KeyTemplate AES_CMAC_PRF;
    
    private PrfKeyTemplates() {
    }
    
    private static KeyTemplate createHkdfKeyTemplate() {
        final HkdfPrfKeyFormat format = HkdfPrfKeyFormat.newBuilder().setKeySize(32).setParams(HkdfPrfParams.newBuilder().setHash(HashType.SHA256)).build();
        return KeyTemplate.newBuilder().setValue(format.toByteString()).setTypeUrl(HkdfPrfKeyManager.staticKeyType()).setOutputPrefixType(OutputPrefixType.RAW).build();
    }
    
    private static KeyTemplate createHmacTemplate(final int keySize, final HashType hashType) {
        final HmacPrfParams params = HmacPrfParams.newBuilder().setHash(hashType).build();
        final HmacPrfKeyFormat format = HmacPrfKeyFormat.newBuilder().setParams(params).setKeySize(keySize).build();
        return KeyTemplate.newBuilder().setTypeUrl(HmacPrfKeyManager.getKeyType()).setValue(format.toByteString()).setOutputPrefixType(OutputPrefixType.RAW).build();
    }
    
    private static KeyTemplate createAes256CmacTemplate() {
        final AesCmacPrfKeyFormat format = AesCmacPrfKeyFormat.newBuilder().setKeySize(32).build();
        return KeyTemplate.newBuilder().setTypeUrl(AesCmacPrfKeyManager.getKeyType()).setValue(format.toByteString()).setOutputPrefixType(OutputPrefixType.RAW).build();
    }
    
    static {
        HKDF_SHA256 = createHkdfKeyTemplate();
        HMAC_SHA256_PRF = createHmacTemplate(32, HashType.SHA256);
        HMAC_SHA512_PRF = createHmacTemplate(64, HashType.SHA512);
        AES_CMAC_PRF = createAes256CmacTemplate();
    }
}
