Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions common/include/xil-bignum.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ struct bignum_st {
};

/* Used for montgomery multiplication */
/*
* The layout of this structure was changed in openSSL commit 3f540b6d.
*/
#if OPENSSL_VERSION_NUMBER >= 0x30600000L
struct bn_mont_ctx_st {
BIGNUM RR; /* used to convert to montgomery form */
BIGNUM N; /* The modulus */
BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 (Ni is only
* stored for bignum algorithm) */
BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
* changed with 0.9.9, was "BN_ULONG n0;"
* before) */
int ri; /* number of bits in R */
int flags;
};
#else
struct bn_mont_ctx_st {
int ri; /* number of bits in R */
BIGNUM RR; /* used to convert to montgomery form */
Expand All @@ -37,5 +53,6 @@ struct bn_mont_ctx_st {
* before) */
int flags;
};
#endif

#endif
6 changes: 5 additions & 1 deletion common/src/authkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ void Key::Parse(const std::string& filename, bool isSecret0)
LOG_ERROR("Unsupported key file - %s\n Supported key formats: AMD Format & OpenSSL format", basefile.c_str());
}
fclose(f);
f = NULL;

if(errCode != 0)
{
Expand All @@ -195,7 +196,10 @@ void Key::Parse(const std::string& filename, bool isSecret0)
}
catch(...)
{
fclose(f);
if (f!=NULL)
{
fclose(f);
}
throw;
}
}
Expand Down
1 change: 1 addition & 0 deletions lms-hash-sigs/hss_param.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <stdio.h>
#include "hss.h"
#include "hss_internal.h"
#include "endian.h"
Expand Down