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

package com.google.crypto.tink.mac.internal;

import java.util.Arrays;

public final class AesUtil
{
    public static final int BLOCK_SIZE = 16;
    
    public static byte[] dbl(final byte[] value) {
        if (value.length != 16) {
            throw new IllegalArgumentException("value must be a block.");
        }
        final byte[] res = new byte[16];
        for (int i = 0; i < 16; ++i) {
            res[i] = (byte)(0xFE & value[i] << 1);
            if (i < 15) {
                final byte[] array = res;
                final int n = i;
                array[n] |= (byte)(0x1 & value[i + 1] >> 7);
            }
        }
        final byte[] array2 = res;
        final int n2 = 15;
        array2[n2] ^= (byte)(0x87 & value[0] >> 7);
        return res;
    }
    
    public static byte[] cmacPad(final byte[] x) {
        if (x.length >= 16) {
            throw new IllegalArgumentException("x must be smaller than a block.");
        }
        final byte[] result = Arrays.copyOf(x, 16);
        result[x.length] = -128;
        return result;
    }
    
    private AesUtil() {
    }
}
