Skip to content

Commit 03d0b6f

Browse files
committed
xil-bignum.h: Add fix for change of struct in openSSL >= 3.6.0
The layout of struct bn_mont_ctx_st was changed in openSSL commit 3f540b6d. Signed-off-by: Wolfgang Wallner <[email protected]>
1 parent b7bb974 commit 03d0b6f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

common/include/xil-bignum.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ struct bignum_st {
2626
};
2727

2828
/* Used for montgomery multiplication */
29+
/*
30+
* The layout of this structure was changed in openSSL commit 3f540b6d.
31+
*/
32+
#if OPENSSL_VERSION_NUMBER >= 0x30600000L
33+
struct bn_mont_ctx_st {
34+
BIGNUM RR; /* used to convert to montgomery form */
35+
BIGNUM N; /* The modulus */
36+
BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 (Ni is only
37+
* stored for bignum algorithm) */
38+
BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
39+
* changed with 0.9.9, was "BN_ULONG n0;"
40+
* before) */
41+
int ri; /* number of bits in R */
42+
int flags;
43+
};
44+
#else
2945
struct bn_mont_ctx_st {
3046
int ri; /* number of bits in R */
3147
BIGNUM RR; /* used to convert to montgomery form */
@@ -37,5 +53,6 @@ struct bn_mont_ctx_st {
3753
* before) */
3854
int flags;
3955
};
56+
#endif
4057

4158
#endif

0 commit comments

Comments
 (0)