fix getFieldValue and add test

This commit is contained in:
Looly
2019-12-09 15:51:46 +08:00
parent c804ebfbc1
commit bddb97704e
3 changed files with 17 additions and 5 deletions

View File

@@ -37,6 +37,18 @@ public class SmTest {
Assert.assertEquals(content, decryptStr);
}
@Test
public void sm4Test2() {
String content = "test中文";
SM4 sm4 = new SM4(Mode.CTR, Padding.PKCS5Padding);
sm4.setIv("aaaabbbb".getBytes());
String encryptHex = sm4.encryptHex(content);
String decryptStr = sm4.decryptStr(encryptHex, CharsetUtil.CHARSET_UTF_8);
Assert.assertEquals(content, decryptStr);
}
@Test
public void sm4ECBPKCS5PaddingTest2() {
String content = "test中文";