Skip to content

Commit d3f6373

Browse files
committedDec 9, 2024·
fix p and q being equal
1 parent 8b1c890 commit d3f6373

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎services/crypter/src/user.cc

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ CrypterService::Register(::grpc::ServerContext *context,
2121

2222
mpz_class P = random_prime(32);
2323
mpz_class Q = random_prime(32);
24+
while (P == Q) {
25+
Q = random_prime(32);
26+
}
2427
mpz_class N = P * Q;
2528
mpz_class lambda = (P - 1) * (Q - 1);
2629
auto id = random_id();

0 commit comments

Comments
 (0)
Please sign in to comment.