Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb51d00b

Browse files
committed
Use BN_ULONG in probable_prime_dh()
This was the last user of BN_LONG in code. It had no reason to do so.BN_mod_word() returns a BN_ULONG and since the largest prime in thesmall primes table primes[] is well below 20000, the only return valuethat could cause 'mod' to be negative was the error sentinel (BN_ULONG)-1.ok jsing kenjiro
1 parent2dc93f8 commitb51d00b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎lib/libcrypto/bn/bn_prime.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: bn_prime.c,v 1.35 2025/05/10 05:54:38 tb Exp $ */
1+
/* $OpenBSD: bn_prime.c,v 1.36 2025/11/06 09:04:14 tb Exp $ */
22
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
33
* All rights reserved.
44
*
@@ -338,7 +338,7 @@ probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, const BIGNUM *rem,
338338
loop:
339339
for (i=1;i<NUMPRIMES;i++) {
340340
/* check that rnd is a prime */
341-
BN_LONGmod=BN_mod_word(rnd,primes[i]);
341+
BN_ULONGmod=BN_mod_word(rnd,primes[i]);
342342
if (mod== (BN_ULONG)-1)
343343
gotoerr;
344344
if (mod <=1) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp