From 966c01a9c82cd6455380f8aebe5e083c84e6dc42 Mon Sep 17 00:00:00 2001 From: codestation Date: Sun, 24 Jul 2011 13:24:35 -0430 Subject: [PATCH] Updated CryptoEngine with cbc upstream fix. --- src/jpcsp/crypto/CryptoEngine.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jpcsp/crypto/CryptoEngine.java b/src/jpcsp/crypto/CryptoEngine.java index 34e87cb..d5d9d1d 100644 --- a/src/jpcsp/crypto/CryptoEngine.java +++ b/src/jpcsp/crypto/CryptoEngine.java @@ -1869,9 +1869,9 @@ public class CryptoEngine { buf[15] = code; // Set the the data size to size. - buf[16] = 0; - buf[17] = 0; - buf[18] = 0; + buf[16] = (byte) ((size >> 24) & 0xFF); + buf[17] = (byte) ((size >> 16) & 0xFF); + buf[18] = (byte) ((size >> 8) & 0xFF); buf[19] = (byte) (size & 0xFF); ByteBuffer bBuf = ByteBuffer.wrap(buf); @@ -1906,7 +1906,7 @@ public class CryptoEngine { tmp[14] = 0; tmp[15] = code; - // Set the the data size to size. + // Set the the data size to 0xA0. tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; @@ -1943,10 +1943,10 @@ public class CryptoEngine { buf[15] = (byte) seed; // Set the the data size to size. - buf[16] = (byte) (size >> 24); - buf[17] = (byte) (size >> 16); - buf[18] = (byte) (size >> 8); - buf[19] = (byte) (size); + buf[16] = (byte) ((size >> 24) & 0xFF); + buf[17] = (byte) ((size >> 16) & 0xFF); + buf[18] = (byte) ((size >> 8) & 0xFF); + buf[19] = (byte) (size & 0xFF); ByteBuffer bBuf = ByteBuffer.wrap(buf); hleUtilsBufferCopyWithRange(bBuf, size, bBuf, size, kirk);