Fix useless/misplaced short conversions

This commit is contained in:
Arnaud Fontaine
2018-03-21 11:41:26 +01:00
parent 4796f6ea78
commit 79d9342827
3 changed files with 14 additions and 14 deletions

View File

@@ -320,7 +320,7 @@ public final class PGPKey {
off = Common.skipLength(buf, off, (short)(len - (short)(off - boff)));
template_off = off;
if(template_len > (short)(len - ((short)off - boff))) {
if(template_len > (short)(len - (short)(off - boff))) {
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
return;
}
@@ -353,7 +353,7 @@ public final class PGPKey {
off = Common.skipLength(buf, off, (short)(len - (short)(off - boff)));
data_off = off;
if(data_len > (short)(len - ((short)off - boff))) {
if(data_len > (short)(len - (short)(off - boff))) {
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
return;
}
@@ -476,9 +476,9 @@ public final class PGPKey {
cipher_rsa_pkcs1.init(priv, Cipher.MODE_ENCRYPT);
off = cipher_rsa_pkcs1.doFinal(buf, (short)0, lc,
buf, (short)lc);
buf, lc);
return Util.arrayCopyNonAtomic(buf, (short)lc,
return Util.arrayCopyNonAtomic(buf, lc,
buf, (short)0,
off);
@@ -516,7 +516,7 @@ public final class PGPKey {
cipher_rsa_pkcs1.init(priv, Cipher.MODE_DECRYPT);
final short len = cipher_rsa_pkcs1.doFinal(buf, (short)1, (short)(lc - 1),
buf, (short)lc);
buf, lc);
off = Util.arrayCopyNonAtomic(buf, lc,
buf, (short)0,