This commit is contained in:
choweli
2025-04-17 10:55:02 +08:00
parent 22d487624d
commit 038a6ca0c8
123 changed files with 232 additions and 224 deletions

View File

@@ -29,7 +29,7 @@ import java.security.SecureRandom;
/**
* 同态加密算法Paillier<br>
* 来自https://github.com/peterstefanov/paillier<br>
* 来自https://github.com/dromara/hutool/pull/3131
* 来自https://github.com/chinabugotech/hutool/pull/3131
* <p>
* 加法同态,存在有效算法+E(x+y)=E(x)+E(y)或者 x+y=D(E(x)+E(y))成立,并且不泄漏 x 和 y。
* 乘法同态,存在有效算法*E(x×y)=E(x)*E(y)或者 xy=D(E(x)*E(y))成立,并且不泄漏 x 和 y。

View File

@@ -77,7 +77,7 @@ public class KeyUtilTest {
@Test
public void generateSm4KeyTest(){
// https://github.com/dromara/hutool/issues/2150
// https://github.com/chinabugotech/hutool/issues/2150
Assertions.assertEquals(16, KeyUtil.generateKey("sm4").getEncoded().length);
Assertions.assertEquals(32, KeyUtil.generateKey("sm4", 256).getEncoded().length);
}

View File

@@ -92,7 +92,7 @@ public class RSATest {
@Test
public void rsaECBTest() {
final RSA rsa = new RSA(AsymmetricAlgorithm.RSA_ECB.getValue());
final RSA rsa = new RSA(AsymmetricAlgorithm.RSA_ECB_PKCS1.getValue());
// 获取私钥和公钥
assertNotNull(rsa.getPrivateKey());

View File

@@ -94,7 +94,7 @@ public class PemUtilTest {
@Test
@Disabled
public void readECPrivateKeyTest2() {
// https://gitee.com/dromara/hutool/issues/I37Z75
// https://gitee.com/chinabugotech/hutool/issues/I37Z75
final byte[] d = PemUtil.readPem(FileUtil.getInputStream("d:/test/keys/priv.key"));
final byte[] publicKey = PemUtil.readPem(FileUtil.getInputStream("d:/test/keys/pub.key"));

View File

@@ -29,7 +29,7 @@ public class CBCBlockCipherMacEngineTest {
@Test
public void SM4CMACTest(){
// https://github.com/dromara/hutool/issues/2206
// https://github.com/chinabugotech/hutool/issues/2206
final byte[] key = new byte[16];
final CipherParameters parameter = new KeyParameter(KeyUtil.generateKey("SM4", key).getEncoded());
final Mac mac = new Mac(new SM4MacEngine(parameter));
@@ -43,7 +43,7 @@ public class CBCBlockCipherMacEngineTest {
@Test
public void SM4CMACWithIVTest(){
// https://github.com/dromara/hutool/issues/2206
// https://github.com/chinabugotech/hutool/issues/2206
final byte[] key = new byte[16];
final byte[] iv = new byte[16];
CipherParameters parameter = new KeyParameter(KeyUtil.generateKey("SM4", key).getEncoded());

View File

@@ -102,7 +102,7 @@ public class HmacTest {
@Test
public void sm4CMACTest(){
// https://github.com/dromara/hutool/issues/2206
// https://github.com/chinabugotech/hutool/issues/2206
final byte[] key = new byte[16];
final HMac mac = new HMac(HmacAlgorithm.SM4CMAC,
KeyUtil.generateKey("SM4", key));

View File

@@ -27,7 +27,7 @@ import java.nio.file.Files;
import java.nio.file.Paths;
/**
* https://gitee.com/dromara/hutool/issues/I4EMST
* https://gitee.com/chinabugotech/hutool/issues/I4EMST
*/
public class Sm4StreamTest {