IdentityEncryptionHandlerState.java 1.21 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.internal.pdftoolkit.core.securityframework.EncryptionHandlerState
 *  com.adobe.internal.pdftoolkit.core.util.ByteOps
 */
package com.adobe.internal.pdftoolkit.core.encryption;

import com.adobe.internal.pdftoolkit.core.securityframework.EncryptionHandlerState;
import com.adobe.internal.pdftoolkit.core.util.ByteOps;

public final class IdentityEncryptionHandlerState
implements EncryptionHandlerState {
    private static byte[] mEmpty = new byte[0];

    public byte[] init(byte[] buffer, int start, int len, byte[] addKey, int mode) {
        if (start == 0 && buffer.length == len) {
            return buffer;
        }
        byte[] retBuf = new byte[len];
        ByteOps.copy((byte[])buffer, (int)start, (byte[])retBuf, (int)0, (int)len);
        return retBuf;
    }

    public byte[] update(byte[] buffer, int start, int len) {
        if (start == 0 && buffer.length == len) {
            return buffer;
        }
        byte[] retBuf = new byte[len];
        ByteOps.copy((byte[])buffer, (int)start, (byte[])retBuf, (int)0, (int)len);
        return retBuf;
    }

    public byte[] finish() {
        return mEmpty;
    }
}