1
0
forked from cheng/wallet

minor changes to fix the original failure to compile correctly

Which might have worked, but now visual studio compiler
crashes on ristretto.h

modified:   src/frame.cpp
modified:   src/ristretto255.h
modified:   src/stdafx.h
This commit is contained in:
Cheng 2023-02-16 13:28:10 +08:00
parent fab225e872
commit 0967d18cc4
No known key found for this signature in database
GPG Key ID: 571C3A9C3B9E6FCA
3 changed files with 11 additions and 3 deletions

View File

@ -70,7 +70,7 @@ try {
singletonFrame = this;
SetIcon(wxICON(AAArho));
sqlite3_init();
if (sodium_init() == -1) {
if (sodium_init() < 0) {
szError = "Fatal Error: Encryption library did not init.";
errorCode = 6;
// Cannot log the error, because logging not set up yet, so logging itself causes an exception

View File

@ -494,7 +494,14 @@ namespace ristretto255 {
return u;
}
else {
return u << ro::serialize(j);
auto sj = ro::serialize(j);
int i = crypto_generichash_blake2b_update(
&u.st,
&sj[0],
sj.size()
);
if (i) throw HashReuseException();
return u;
}
}

View File

@ -79,7 +79,7 @@ std::span<uint8_t>& operator^=(std::span<byte>&, byte *);
#ifdef __WXMSW__
#include <wx/msw/msvcrt.h> // redefines the new() operator
#endif
#define SODIUM_STATIC
#define SODIUM_STATIC 1
#include <sodium.h>
#include <mpir.h>
#pragma comment(lib, "libsodium.lib")
@ -98,6 +98,7 @@ enum MyIDs {
myID_MAINFRAME_PANEL, myID_TESTWINDOW, myID_WELCOME_TO_ROCOIN, myID_WALLET_UI,
mID_CLOSE_WALLET, myID_MYEXIT
};
#include "localization.h"
#include "db_accessors.h"
#include "app.h"