style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@ -20,8 +20,7 @@ public class RSA {
* @return encrypted message
*/
public synchronized String encrypt(String message) {
return (new BigInteger(message.getBytes())).modPow(publicKey, modulus)
.toString();
return (new BigInteger(message.getBytes())).modPow(publicKey, modulus).toString();
}
/**
@ -36,9 +35,7 @@ public class RSA {
*/
public synchronized String decrypt(String encryptedMessage) {
return new String(
(new BigInteger(encryptedMessage)).modPow(privateKey, modulus)
.toByteArray()
);
(new BigInteger(encryptedMessage)).modPow(privateKey, modulus).toByteArray());
}
/**
@ -57,8 +54,7 @@ public class RSA {
BigInteger q = new BigInteger(bits / 2, 100, r);
modulus = p.multiply(q);
BigInteger m =
(p.subtract(BigInteger.ONE)).multiply(q.subtract(BigInteger.ONE));
BigInteger m = (p.subtract(BigInteger.ONE)).multiply(q.subtract(BigInteger.ONE));
publicKey = BigInteger.valueOf(3L);