/** * verify that hash equals to HMacHash(msg) * @param newHash * @return true if is the same */ private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) { byte[] msg_hash = generateByteHash(msg, key); return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0; }
/** * verify that hash equals to HMacHash(msg) * @param newHash * @return true if is the same */ private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) { byte[] msg_hash = generateByteHash(msg, key); return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0; }
/** * verify that hash equals to HMacHash(msg) * @param newHash * @return true if is the same */ private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) { byte[] msg_hash = generateByteHash(msg, key); return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0; }
/** * verify that hash equals to HMacHash(msg) * @param newHash * @return true if is the same */ private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) { byte[] msg_hash = generateByteHash(msg, key); return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0; }
/** * verify that hash equals to HMacHash(msg) * @param newHash * @return true if is the same */ private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) { byte[] msg_hash = generateByteHash(msg, key); return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0; }
static public int compareRaw(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { try { int os1 = s1; { int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1); int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2); int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1); int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; } return (os1 - s1); } catch(java.io.IOException e) { throw new RuntimeException(e); } } public int compare(byte[] b1, int s1, int l1,
static public int compareRaw(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { try { int os1 = s1; { int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1); int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2); int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1); int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; } return (os1 - s1); } catch(java.io.IOException e) { throw new RuntimeException(e); } } public int compare(byte[] b1, int s1, int l1,
static public int compareRaw(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { try { int os1 = s1; { int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1); int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2); int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1); int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; } return (os1 - s1); } catch(java.io.IOException e) { throw new RuntimeException(e); } } public int compare(byte[] b1, int s1, int l1,
l1 -= z1; l2 -= z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1, s1, i1, b2, s2, i2); if (r1 != 0) { l1 -= z1; l2 -= z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1, s1, i1, b2, s2, i2); if (r1 != 0) {
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
l1 -= z1; l2 -= z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1, s1, i1, b2, s2, i2); if (r1 != 0) { l1 -= z1; l2 -= z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1, s1, i1, b2, s2, i2); if (r1 != 0) {
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
l1 -= z1; l2 -= z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1, s1, i1, b2, s2, i2); if (r1 != 0) {
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2; int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2); s1+=z1; s2+=z2; l1-=z1; l2-=z2; int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2); if (r1 != 0) { return (r1<0)?-1:0; } s1+=i1; s2+=i2; l1-=i1; l1-=i2;