diff options
author | Kenny Root <kroot@google.com> | 2013-05-31 11:32:40 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2013-05-31 11:32:42 -0700 |
commit | 57323260f130e086301b1b7c0d3124a6c51f9fa8 (patch) | |
tree | 24e3e6bfc91c20f37abf5387c690b88cb8c28325 | |
parent | 89dbbc7a023c0f94f65c41d926f2ffad1f9c27e0 (diff) | |
download | libcore-57323260f130e086301b1b7c0d3124a6c51f9fa8.zip libcore-57323260f130e086301b1b7c0d3124a6c51f9fa8.tar.gz libcore-57323260f130e086301b1b7c0d3124a6c51f9fa8.tar.bz2 |
Move initialization check higher for updateAAD
This allows the tests to pass on the RI and Dalvik by ordering the
exceptions in the same way.
Change-Id: Icb5a313f86c90ed8f1d703b5cb996783ca3a214b
-rw-r--r-- | luni/src/main/java/javax/crypto/Cipher.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/luni/src/main/java/javax/crypto/Cipher.java b/luni/src/main/java/javax/crypto/Cipher.java index af58a22..ba40b86 100644 --- a/luni/src/main/java/javax/crypto/Cipher.java +++ b/luni/src/main/java/javax/crypto/Cipher.java @@ -1079,12 +1079,12 @@ public class Cipher { * @since 1.7 */ public final void updateAAD(byte[] input, int inputOffset, int inputLen) { - if (input == null) { - throw new IllegalArgumentException("input == null"); - } if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) { throw new IllegalStateException(); } + if (input == null) { + throw new IllegalArgumentException("input == null"); + } checkInputOffsetAndCount(input.length, inputOffset, inputLen); if (input.length == 0) { return; |