E0 分包设置为 4064
This commit is contained in:
parent
8e3e0c5f11
commit
0c13d0c38a
@ -1506,7 +1506,7 @@ public class SydApi4j implements SydApi {
|
|||||||
|
|
||||||
final ByteBuffer bbs = ByteBuffer.allocate(v + 1024);
|
final ByteBuffer bbs = ByteBuffer.allocate(v + 1024);
|
||||||
|
|
||||||
int packSize = 4080; // 2048/3072/4080
|
int packSize = 4064; // 2048/3072/4064
|
||||||
int packSizeDe = packSize + 16;
|
int packSizeDe = packSize + 16;
|
||||||
// int fm = (int) data.get("fullMode$option");
|
// int fm = (int) data.get("fullMode$option");
|
||||||
int fm = (Integer) data.get("fullMode$option");
|
int fm = (Integer) data.get("fullMode$option");
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.sunyard.sydapi.test;
|
|||||||
|
|
||||||
import com.sunyard.RetWrap;
|
import com.sunyard.RetWrap;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import racal.sunyard.main.SydApi4j;
|
import racal.sunyard.main.SydApi4j;
|
||||||
@ -11,14 +12,14 @@ import java.util.Arrays;
|
|||||||
public class TestE0 {
|
public class TestE0 {
|
||||||
|
|
||||||
private SydApi4j api;
|
private SydApi4j api;
|
||||||
private byte[] data = new byte[ 20 * 1024 * 1024 ];
|
private byte[] data = new byte[ 4 * 1024 -1 ];
|
||||||
private byte[] iv = new byte[ 32 ];
|
private byte[] iv = new byte[ 32 ];
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void before() {
|
public void before() {
|
||||||
// 通过设置debug的属性开启debug,如果不设置则默认不打开
|
// 通过设置debug的属性开启debug,如果不设置则默认不打开
|
||||||
System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||||
api = (SydApi4j) new SydApi4j().connect("192.168.1.111", 8889, null, 1000, 1000, 2);
|
api = (SydApi4j) new SydApi4j().connect("172.16.18.59", 8889, null, 1000, 1000, 2);
|
||||||
Arrays.fill( iv, (byte) 0x38 );
|
Arrays.fill( iv, (byte) 0x38 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,8 +39,11 @@ public class TestE0 {
|
|||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
RetWrap retWrap = this.api.SYMEnDeData(true, 1, sessionKeyByLMK, 1, 1, data, iv, 0);
|
RetWrap retWrap = this.api.SYMEnDeData(true, 1, sessionKeyByLMK, 1, 1, data, iv, 0);
|
||||||
byte[] enData = (byte[]) retWrap.get("msg_all");
|
byte[] enData = (byte[]) retWrap.get("msg_all");
|
||||||
|
retWrap = this.api.SYMEnDeData(false, 1, sessionKeyByLMK, 1, 1, enData, iv, 0);
|
||||||
|
byte[] oData = (byte[]) retWrap.get("msg_all");
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
System.out.println( "耗时=" + ( end - start ) );
|
System.out.println( "耗时=" + ( end - start ) );
|
||||||
|
Assert.assertArrayEquals( oData, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user