Searched refs:iv (Results 1 - 13 of 13) sorted by relevance

/libcore/luni/src/main/java/javax/crypto/spec/
H A DIvParameterSpec.java32 private final byte[] iv; field in class:IvParameterSpec
36 * the specified buffer <i>iv</i> used as <i>initialization vector</i>.
38 * @param iv
43 public IvParameterSpec(byte[] iv) { argument
44 if (iv == null) {
45 throw new NullPointerException("iv == null");
47 this.iv = new byte[iv.length];
48 System.arraycopy(iv, 0, this.iv,
63 IvParameterSpec(byte[] iv, int offset, int byteCount) argument
[all...]
H A DRC2ParameterSpec.java30 private final byte[] iv; field in class:RC2ParameterSpec
41 iv = null;
53 * @param iv
58 public RC2ParameterSpec(int effectiveKeyBits, byte[] iv) { argument
59 if (iv == null) {
60 throw new IllegalArgumentException("iv == null");
62 if (iv.length < 8) {
63 throw new IllegalArgumentException("iv.length < 8");
66 this.iv = new byte[8];
67 System.arraycopy(iv,
88 RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset) argument
[all...]
H A DGCMParameterSpec.java35 private final byte[] iv; field in class:GCMParameterSpec
39 * Initial Vector (IV) from buffer {@code iv} and a tag length of
42 * @throws IllegalArgumentException if the specified {@code iv} is null or
46 public GCMParameterSpec(int tagLen, byte[] iv) { argument
50 if (iv == null) {
51 throw new IllegalArgumentException("iv == null");
54 this.iv = iv.clone();
59 * (IV) of {@code byteCount} bytes from the specified buffer {@code iv}
62 * @throws IllegalArgumentException if the specified {@code iv} i
68 GCMParameterSpec(int tagLen, byte[] iv, int offset, int byteCount) argument
[all...]
H A DRC5ParameterSpec.java32 private final byte[] iv; field in class:RC5ParameterSpec
49 this.iv = null;
67 * @param iv
73 public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) { argument
74 if (iv == null) {
75 throw new IllegalArgumentException("iv == null");
77 if (iv.length < 2 * (wordSize / 8)) {
78 throw new IllegalArgumentException("iv.length < 2 * (wordSize / 8)");
83 this.iv = new byte[2*(wordSize/8)];
84 System.arraycopy(iv,
112 RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int offset) argument
[all...]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/
H A DIvParameterSpecTest.java40 * IvParameterSpec(byte[] iv) constructor testing. Checks that
52 byte[] iv = new byte[] {1, 2, 3, 4, 5};
53 IvParameterSpec ivps = new IvParameterSpec(iv);
54 iv[0] ++;
56 + "the change of internal array", iv[0] == ivps.getIV()[0]);
60 * IvParameterSpec(byte[] iv) constructor testing. Checks that
79 + "if (iv.length - offset < len).");
90 + "if offset index bytes outside the iv.");
102 + "if len index bytes outside the iv.");
111 byte[] iv
[all...]
H A DRC2ParameterSpecTest.java39 * RC2ParameterSpec(int effectiveKeyBits, byte[] iv) method testing.
41 * inappropriate constructor parameters and that input iv array is
46 byte[] iv = {1, 2, 3, 4, 5, 6, 7, 8};
51 + "in the case of null iv.");
58 + "in the case of short iv.");
62 RC2ParameterSpec ps = new RC2ParameterSpec(effectiveKeyBits, iv);
63 iv[0] ++;
64 assertFalse("The change of iv specified in the constructor "
66 iv[0] == ps.getIV()[0]);
70 * RC2ParameterSpec(int effectiveKeyBits, byte[] iv, in
[all...]
H A DRC5ParameterSpecTest.java38 * RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) method
40 * inappropriate constructor parameters and that input iv array is
47 byte[] iv = {1, 2, 3, 4};
52 + "in the case of null iv.");
57 new RC5ParameterSpec(version, rounds, wordSize+8, iv);
59 + "in the case of short iv.");
66 + "in the case of short iv.");
71 wordSize, iv);
72 iv[0] ++;
73 assertFalse("The change of iv specifie
[all...]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
H A DCipherSymmetricKeyThread.java39 byte[] iv = null;//new byte[16];
49 iv = new byte[8];
51 iv = new byte[16];
53 sr.nextBytes(iv);
54 IvParameterSpec ivspec = new IvParameterSpec(iv);
59 iv = cip.getIV();
60 ivspec = new IvParameterSpec(iv);
/libcore/crypto/src/main/java/org/conscrypt/
H A DOpenSSLCipher.java89 private byte[] iv; field in class:OpenSSLCipher
218 return iv;
223 if (iv != null && iv.length > 0) {
226 params.init(iv);
237 private void engineInitInternal(int opmode, Key key, byte[] iv, SecureRandom random) argument
266 if (iv == null && ivLength != 0) {
267 iv = new byte[ivLength];
272 random.nextBytes(iv);
274 } else if (iv !
[all...]
H A DNativeCrypto.java297 public static native void EVP_CipherInit_ex(long ctx, long evpCipher, byte[] key, byte[] iv, argument
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
H A DKeyGeneratorTest.java508 byte[] iv = null;
509 iv = new byte[8];
510 sr.nextBytes(iv);
511 aps = new IvParameterSpec(iv);
H A DCipherTest.java333 + ".iv");
334 IvParameterSpec iv = new IvParameterSpec(ivMaterial);
336 c.init(Cipher.DECRYPT_MODE, k, iv);
391 + ".iv");
392 IvParameterSpec iv = new IvParameterSpec(ivMaterial);
394 c.init(Cipher.ENCRYPT_MODE, k, iv);
/libcore/luni/src/test/java/libcore/javax/crypto/
H A DCipherTest.java671 final byte[] iv = new byte[16];
672 new SecureRandom().nextBytes(iv);
673 return new IvParameterSpec(iv);
687 byte[] iv = encryptCipher.getIV();
688 if (iv != null) {
689 return new IvParameterSpec(iv);
2103 * echo -n 'I only regret that I have but one test to write.' | openssl enc -aes-256-cbc -K ec53c6d51d2c4973585fb0b8e51cd2e39915ff07a1837872715d6121bf861935 -iv ceaa31952dfd3d0f5af4b2042ba06094 | openssl enc -aes-256-cbc -K ec53c6d51d2c4973585fb0b8e51cd2e39915ff07a1837872715d6121bf861935 -iv ceaa31952dfd3d0f5af4b2042ba06094 -d -nopad | recode ../x1 | sed 's/0x/(byte) 0x/g'
2121 * echo -n 'I only regret that I have but one test to write.' | openssl enc -aes-256-cbc -K ec53c6d51d2c4973585fb0b8e51cd2e39915ff07a1837872715d6121bf861935 -iv ceaa31952dfd3d0f5af4b2042ba06094 | recode ../x1 | sed 's/0x/(byte) 0x/g'
2142 public final byte[] iv; field in class:CipherTest.CipherTestParam
2150 CipherTestParam(String mode, byte[] key, byte[] iv, byte[] plaintext, byte[] plaintextPadded, byte[] ciphertext) argument
[all...]

Completed in 144 milliseconds