X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fcrypto%2FRSA.java;h=69a70b24663aea766492fea1e776ae2ae5784047;hb=17aa8e877ba041eedb13af8d49ff365417718c31;hp=546d32380ce0f38b574910ca97f43d6f0f5ac642;hpb=89b8212fad1ba1e9207da969ae38ee643073de70;p=org.ibex.crypto.git diff --git a/src/org/ibex/crypto/RSA.java b/src/org/ibex/crypto/RSA.java index 546d323..69a70b2 100644 --- a/src/org/ibex/crypto/RSA.java +++ b/src/org/ibex/crypto/RSA.java @@ -31,7 +31,7 @@ public class RSA { if(reverse ? cbytes[0] == 0 : cbytes.length > outSize) { if(cbytes[0] != 0) throw new RuntimeException("should never happen"); byte[] buf = new byte[cbytes.length-1]; - System.arraycopy(cbytes,1,buf,0,outSize); + System.arraycopy(cbytes,1,buf,0,buf.length); return buf; } else if(!reverse && cbytes.length < outSize) { // output needs to be exactly outSize in length