01: package org.bouncycastle.crypto.params;
02:
03: import org.bouncycastle.crypto.CipherParameters;
04:
05: public class ParametersWithIV implements CipherParameters {
06: private byte[] iv;
07: private CipherParameters parameters;
08:
09: public ParametersWithIV(CipherParameters parameters, byte[] iv) {
10: this (parameters, iv, 0, iv.length);
11: }
12:
13: public ParametersWithIV(CipherParameters parameters, byte[] iv,
14: int ivOff, int ivLen) {
15: this .iv = new byte[ivLen];
16: this .parameters = parameters;
17:
18: System.arraycopy(iv, ivOff, this .iv, 0, ivLen);
19: }
20:
21: public byte[] getIV() {
22: return iv;
23: }
24:
25: public CipherParameters getParameters() {
26: return parameters;
27: }
28: }
|