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

package com.google.crypto.tink.subtle;

import java.io.InputStream;
import java.io.OutputStream;
import java.nio.channels.SeekableByteChannel;
import java.nio.channels.ReadableByteChannel;
import java.io.IOException;
import java.nio.channels.WritableByteChannel;
import java.security.GeneralSecurityException;
import com.google.crypto.tink.StreamingAead;

abstract class NonceBasedStreamingAead implements StreamingAead
{
    public abstract StreamSegmentEncrypter newStreamSegmentEncrypter(final byte[] associatedData) throws GeneralSecurityException;
    
    public abstract StreamSegmentDecrypter newStreamSegmentDecrypter() throws GeneralSecurityException;
    
    public abstract int getPlaintextSegmentSize();
    
    public abstract int getCiphertextSegmentSize();
    
    public abstract int getCiphertextOffset();
    
    public abstract int getCiphertextOverhead();
    
    public abstract int getHeaderLength();
    
    @Override
    public WritableByteChannel newEncryptingChannel(final WritableByteChannel ciphertextChannel, final byte[] associatedData) throws GeneralSecurityException, IOException {
        return new StreamingAeadEncryptingChannel(this, ciphertextChannel, associatedData);
    }
    
    @Override
    public ReadableByteChannel newDecryptingChannel(final ReadableByteChannel ciphertextChannel, final byte[] associatedData) throws GeneralSecurityException, IOException {
        return new StreamingAeadDecryptingChannel(this, ciphertextChannel, associatedData);
    }
    
    @Override
    public SeekableByteChannel newSeekableDecryptingChannel(final SeekableByteChannel ciphertextSource, final byte[] associatedData) throws GeneralSecurityException, IOException {
        return new StreamingAeadSeekableDecryptingChannel(this, ciphertextSource, associatedData);
    }
    
    @Override
    public OutputStream newEncryptingStream(final OutputStream ciphertext, final byte[] associatedData) throws GeneralSecurityException, IOException {
        return new StreamingAeadEncryptingStream(this, ciphertext, associatedData);
    }
    
    @Override
    public InputStream newDecryptingStream(final InputStream ciphertextStream, final byte[] associatedData) throws GeneralSecurityException, IOException {
        return new StreamingAeadDecryptingStream(this, ciphertextStream, associatedData);
    }
}
