summaryrefslogtreecommitdiff
path: root/patches/wownero
diff options
context:
space:
mode:
Diffstat (limited to 'patches/wownero')
-rw-r--r--patches/wownero/0001-Fix-wallet_api-compilation-target-https-git.wownero..patch4
-rw-r--r--patches/wownero/0002-polyseed.patch (renamed from patches/wownero/0002-polyseed-support.patch)336
-rw-r--r--patches/wownero/0003-wallet-background-sync-with-just-the-view-key.patch10
-rw-r--r--patches/wownero/0004-airgap.patch8
-rw-r--r--patches/wownero/0005-coin-control.patch8
-rw-r--r--patches/wownero/0006-fix-build.patch4
-rw-r--r--patches/wownero/0007-macos-build-fix.patch4
-rw-r--r--patches/wownero/0008-FIX-wallet-listener-crashing.patch6
-rw-r--r--patches/wownero/0009-fix-missing-___clear_cache-when-targetting-iOS.patch12
9 files changed, 185 insertions, 207 deletions
diff --git a/patches/wownero/0001-Fix-wallet_api-compilation-target-https-git.wownero..patch b/patches/wownero/0001-Fix-wallet_api-compilation-target-https-git.wownero..patch
index 6a6c697..bffbdd3 100644
--- a/patches/wownero/0001-Fix-wallet_api-compilation-target-https-git.wownero..patch
+++ b/patches/wownero/0001-Fix-wallet_api-compilation-target-https-git.wownero..patch
@@ -1,4 +1,4 @@
-From f0f386f43d6fc998c93ecb12666688d85a4d6fca Mon Sep 17 00:00:00 2001
+From 576464e0e9fdf9e9c7973397107b315d4e95b000 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 26 Mar 2024 06:55:38 +0100
Subject: [PATCH 1/9] Fix wallet_api compilation target
@@ -27,5 +27,5 @@ index 823f122c2..d81ddec93 100644
pendingTxPostProcess(transaction);
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0002-polyseed-support.patch b/patches/wownero/0002-polyseed.patch
index 8c5c12e..bee6707 100644
--- a/patches/wownero/0002-polyseed-support.patch
+++ b/patches/wownero/0002-polyseed.patch
@@ -1,37 +1,41 @@
-From 33d611538efef134106f427c7ee5535d28d588f6 Mon Sep 17 00:00:00 2001
-From: Czarek Nakamoto <cyjan@mrcyjanek.net>
-Date: Tue, 26 Mar 2024 08:19:23 +0100
-Subject: [PATCH 2/9] polyseed support
+From 84925f0c3587e9fde73ea441a4a19d0ec2c61aae Mon Sep 17 00:00:00 2001
+From: tobtoht <tob@featherwallet.org>
+Date: Sun, 14 Apr 2024 15:03:22 +0200
+Subject: [PATCH 2/9] polyseed
+Unknown date/time of origin, implemented by tobtoht for anonero, various modifications performed along the way
+
+Czarek Nakamoto <cyjan@mrcyjanek.net>
+- 2024/04/14 - replaced the normalization code with reference implementation
+
+Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
---
.github/workflows/build.yml | 4 +-
- .gitmodules | 6 +
- CMakeLists.txt | 4 +-
+ .gitmodules | 3 +
+ CMakeLists.txt | 3 +-
contrib/epee/include/wipeable_string.h | 7 +
contrib/epee/src/wipeable_string.cpp | 10 ++
- external/CMakeLists.txt | 2 +
+ external/CMakeLists.txt | 1 +
external/polyseed | 1 +
- external/utf8proc | 1 +
src/CMakeLists.txt | 1 +
src/cryptonote_basic/CMakeLists.txt | 1 +
src/cryptonote_basic/account.cpp | 23 +++-
src/cryptonote_basic/account.h | 6 +
src/cryptonote_config.h | 2 +
- src/polyseed/CMakeLists.txt | 25 ++++
- src/polyseed/pbkdf2.c | 85 ++++++++++++
+ src/polyseed/CMakeLists.txt | 24 ++++
+ src/polyseed/pbkdf2.c | 87 ++++++++++++
src/polyseed/pbkdf2.h | 46 +++++++
- src/polyseed/polyseed.cpp | 182 +++++++++++++++++++++++++
- src/polyseed/polyseed.hpp | 167 +++++++++++++++++++++++
+ src/polyseed/polyseed.cpp | 178 +++++++++++++++++++++++++
+ src/polyseed/polyseed.hpp | 162 ++++++++++++++++++++++
src/wallet/api/wallet.cpp | 71 ++++++++++
src/wallet/api/wallet.h | 10 ++
src/wallet/api/wallet2_api.h | 25 ++++
src/wallet/api/wallet_manager.cpp | 9 ++
src/wallet/api/wallet_manager.h | 10 ++
- src/wallet/wallet2.cpp | 102 ++++++++++++--
- src/wallet/wallet2.h | 30 +++-
- 25 files changed, 809 insertions(+), 21 deletions(-)
+ src/wallet/wallet2.cpp | 100 ++++++++++++--
+ src/wallet/wallet2.h | 30 ++++-
+ 24 files changed, 794 insertions(+), 20 deletions(-)
create mode 160000 external/polyseed
- create mode 160000 external/utf8proc
create mode 100644 src/polyseed/CMakeLists.txt
create mode 100644 src/polyseed/pbkdf2.c
create mode 100644 src/polyseed/pbkdf2.h
@@ -54,41 +58,37 @@ index 4c1e381c0..70bea03b3 100644
test-ubuntu:
needs: build-ubuntu
diff --git a/.gitmodules b/.gitmodules
-index 74571d5ee..86009b6b6 100644
+index 74571d5ee..bab1cbed2 100644
--- a/.gitmodules
+++ b/.gitmodules
-@@ -12,6 +12,12 @@
- path = external/supercop
- url = https://github.com/monero-project/supercop
- branch = monero
-+[submodule "external/utf8proc"]
-+ path = external/utf8proc
-+ url = https://github.com/JuliaStrings/utf8proc.git
+@@ -8,6 +8,9 @@
+ active = false
+ path = external/trezor-common
+ url = https://github.com/trezor/trezor-common.git
+[submodule "external/polyseed"]
+ path = external/polyseed
-+ url = https://github.com/tevador/polyseed.git
- [submodule "external/randomwow"]
- path = external/randomwow
- url = https://git.wownero.com/wownero/RandomWOW
++ url = https://github.com/tevador/polyseed
+ [submodule "external/supercop"]
+ path = external/supercop
+ url = https://github.com/monero-project/supercop
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 20829bc30..2dd427d3d 100644
+index 20829bc30..5661c5c48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -370,6 +370,8 @@ if(NOT MANUAL_SUBMODULES)
+@@ -370,6 +370,7 @@ if(NOT MANUAL_SUBMODULES)
#check_submodule(external/trezor-common)
check_submodule(external/randomwow)
check_submodule(external/supercop)
+ check_submodule(external/polyseed)
-+ check_submodule(external/utf8proc)
endif()
endif()
-@@ -459,7 +461,7 @@ endif()
+@@ -459,7 +460,7 @@ endif()
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
# set(BSDI TRUE)
-include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include)
-+include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include external/polyseed/include external/utf8proc)
++include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include external/polyseed/include)
if(APPLE)
cmake_policy(SET CMP0042 NEW)
@@ -137,16 +137,14 @@ index b016f2f48..f2f365b1b 100644
+
}
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
-index 29aed0cc6..c023abffa 100644
+index 29aed0cc6..b83c08bb0 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
-@@ -70,3 +70,5 @@ add_subdirectory(db_drivers)
+@@ -70,3 +70,4 @@ add_subdirectory(db_drivers)
add_subdirectory(easylogging++)
add_subdirectory(qrcodegen)
add_subdirectory(randomwow EXCLUDE_FROM_ALL)
+add_subdirectory(polyseed EXCLUDE_FROM_ALL)
-+add_subdirectory(utf8proc EXCLUDE_FROM_ALL)
-\ No newline at end of file
diff --git a/external/polyseed b/external/polyseed
new file mode 160000
index 000000000..b7c35bb3c
@@ -154,13 +152,6 @@ index 000000000..b7c35bb3c
+++ b/external/polyseed
@@ -0,0 +1 @@
+Subproject commit b7c35bb3c6b91e481ecb04fc235eaff69c507fa1
-diff --git a/external/utf8proc b/external/utf8proc
-new file mode 160000
-index 000000000..1fe43f5a6
---- /dev/null
-+++ b/external/utf8proc
-@@ -0,0 +1 @@
-+Subproject commit 1fe43f5a6d9c628f717c5ec8aeaeae4a9adfd167
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9216bcaa5..c043ba150 100644
--- a/src/CMakeLists.txt
@@ -186,7 +177,7 @@ index 1414be1b2..414936a05 100644
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
diff --git a/src/cryptonote_basic/account.cpp b/src/cryptonote_basic/account.cpp
-index 2ac455fda..4931c3740 100644
+index 2ac455fda..020e71e9d 100644
--- a/src/cryptonote_basic/account.cpp
+++ b/src/cryptonote_basic/account.cpp
@@ -87,12 +87,16 @@ DISABLE_VS_WARNINGS(4244 4345)
@@ -231,7 +222,7 @@ index 2ac455fda..4931c3740 100644
+
+ generate(secret_key, true, false);
+
-+ seed.save(m_keys.m_polyseed.data);
++ seed.save((uint8_t *)m_keys.m_polyseed.data);
+ m_keys.m_passphrase = passphrase;
+ }
+ //-----------------------------------------------------------------
@@ -291,10 +282,10 @@ index 8c0d3ce20..1c1830ad4 100644
// (1+32) + (1+1+16*32) + (1+16*32) = 1060
diff --git a/src/polyseed/CMakeLists.txt b/src/polyseed/CMakeLists.txt
new file mode 100644
-index 000000000..cca4eb746
+index 000000000..9f3339f3e
--- /dev/null
+++ b/src/polyseed/CMakeLists.txt
-@@ -0,0 +1,25 @@
+@@ -0,0 +1,24 @@
+set(polyseed_sources
+ pbkdf2.c
+ polyseed.cpp
@@ -315,43 +306,44 @@ index 000000000..cca4eb746
+target_link_libraries(polyseed_wrapper
+PUBLIC
+ polyseed
-+ utf8proc
+ ${SODIUM_LIBRARY}
+ PRIVATE
+ ${EXTRA_LIBRARIES}
+)
diff --git a/src/polyseed/pbkdf2.c b/src/polyseed/pbkdf2.c
new file mode 100644
-index 000000000..1c45f4708
+index 000000000..1f8e13955
--- /dev/null
+++ b/src/polyseed/pbkdf2.c
-@@ -0,0 +1,85 @@
-+// Copyright (c) 2023, The Monero Project
-+// Copyright (c) 2021, tevador <tevador@gmail.com>
-+// Copyright (c) 2005,2007,2009 Colin Percival
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+// SUCH DAMAGE.
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2005,2007,2009 Colin Percival
++ * Copyright 2021 tevador <tevador@gmail.com>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * SOURCE: https://raw.githubusercontent.com/tevador/polyseed-examples/master/c/pbkdf2.c
++ */
+
+#include <string.h>
+
@@ -369,8 +361,8 @@ index 000000000..1c45f4708
+
+void
+crypto_pbkdf2_sha256(const uint8_t* passwd, size_t passwdlen,
-+ const uint8_t* salt, size_t saltlen, uint64_t c,
-+ uint8_t* buf, size_t dkLen)
++ const uint8_t* salt, size_t saltlen, uint64_t c,
++ uint8_t* buf, size_t dkLen)
+{
+ crypto_auth_hmacsha256_state Phctx, PShctx, hctx;
+ size_t i;
@@ -411,38 +403,37 @@ index 000000000..1c45f4708
+ sodium_memzero((void*)&Phctx, sizeof Phctx);
+ sodium_memzero((void*)&PShctx, sizeof PShctx);
+}
-\ No newline at end of file
diff --git a/src/polyseed/pbkdf2.h b/src/polyseed/pbkdf2.h
new file mode 100644
-index 000000000..f6253b9d7
+index 000000000..8e712e988
--- /dev/null
+++ b/src/polyseed/pbkdf2.h
@@ -0,0 +1,46 @@
-+// Copyright (c) 2023, The Monero Project
-+// Copyright (c) 2021, tevador <tevador@gmail.com>
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+// SUCH DAMAGE.
++/*
++ * Copyright 2021 tevador <tevador@gmail.com>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
+
+#ifndef PBKDF2_H
+#define PBKDF2_H
@@ -456,46 +447,45 @@ index 000000000..f6253b9d7
+
+void
+crypto_pbkdf2_sha256(const uint8_t* passwd, size_t passwdlen,
-+ const uint8_t* salt, size_t saltlen, uint64_t c,
-+ uint8_t* buf, size_t dkLen);
++ const uint8_t* salt, size_t saltlen, uint64_t c,
++ uint8_t* buf, size_t dkLen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
-\ No newline at end of file
diff --git a/src/polyseed/polyseed.cpp b/src/polyseed/polyseed.cpp
new file mode 100644
-index 000000000..b26f37574
+index 000000000..c1a4c59e1
--- /dev/null
+++ b/src/polyseed/polyseed.cpp
-@@ -0,0 +1,182 @@
-+// Copyright (c) 2023, The Monero Project
-+// Copyright (c) 2021, tevador <tevador@gmail.com>
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+// SUCH DAMAGE.
+@@ -0,0 +1,178 @@
++/*
++ * Copyright 2021 tevador <tevador@gmail.com>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
+
+#include "polyseed.hpp"
+#include "pbkdf2.h"
@@ -503,41 +493,33 @@ index 000000000..b26f37574
+#include <sodium/core.h>
+#include <sodium/utils.h>
+#include <sodium/randombytes.h>
-+#include <utf8proc.h>
++#include <boost/locale.hpp>
+
++#include <cstdint>
+#include <cstring>
+#include <algorithm>
+#include <array>
+
+namespace polyseed {
+
-+ inline size_t utf8_norm(const char* str, polyseed_str norm, utf8proc_option_t options) {
-+ utf8proc_int32_t buffer[POLYSEED_STR_SIZE];
-+ utf8proc_ssize_t result;
-+
-+ result = utf8proc_decompose(reinterpret_cast<const uint8_t*>(str), 0, buffer, POLYSEED_STR_SIZE, options);
-+ if (result < 0) {
-+ return POLYSEED_STR_SIZE;
-+ }
-+ if (result > POLYSEED_STR_SIZE - 1) {
-+ return result;
-+ }
-+
-+ result = utf8proc_reencode(buffer, result, options);
-+
-+ strcpy(norm, reinterpret_cast<const char*>(buffer));
-+ sodium_memzero(buffer, POLYSEED_STR_SIZE);
-+ return result;
-+ }
++ static std::locale locale;
+
+ static size_t utf8_nfc(const char* str, polyseed_str norm) {
-+ // Note: UTF8PROC_LUMP is used here to replace the ideographic space with a regular space for Japanese phrases
-+ // to allow wallets to split on ' '.
-+ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_STRIPNA | UTF8PROC_LUMP));
++ auto s = boost::locale::normalize(str, boost::locale::norm_type::norm_nfc, locale);
++ size_t size = std::min(s.size(), (size_t)POLYSEED_STR_SIZE - 1);
++ s.copy(norm, size);
++ norm[size] = '\0';
++ sodium_memzero(&s[0], s.size());
++ return size;
+ }
+
+ static size_t utf8_nfkd(const char* str, polyseed_str norm) {
-+ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_DECOMPOSE | UTF8PROC_COMPAT | UTF8PROC_STRIPNA));
++ auto s = boost::locale::normalize(str, boost::locale::norm_type::norm_nfkd, locale);
++ size_t size = std::min(s.size(), (size_t)POLYSEED_STR_SIZE - 1);
++ s.copy(norm, size);
++ norm[size] = '\0';
++ sodium_memzero(&s[0], s.size());
++ return size;
+ }
+
+ struct dependency {
@@ -552,6 +534,10 @@ index 000000000..b26f37574
+ throw std::runtime_error("sodium_init failed");
+ }
+
++ boost::locale::generator gen;
++ gen.locale_cache_enabled(true);
++ locale = gen("");
++
+ polyseed_dependency pd;
+ pd.randbytes = &randombytes_buf;
+ pd.pbkdf2_sha256 = &crypto_pbkdf2_sha256;
@@ -655,10 +641,10 @@ index 000000000..b26f37574
+}
diff --git a/src/polyseed/polyseed.hpp b/src/polyseed/polyseed.hpp
new file mode 100644
-index 000000000..2c8c777a7
+index 000000000..a23101cff
--- /dev/null
+++ b/src/polyseed/polyseed.hpp
-@@ -0,0 +1,167 @@
+@@ -0,0 +1,162 @@
+// Copyright (c) 2023, The Monero Project
+// Copyright (c) 2021, tevador <tevador@gmail.com>
+//
@@ -710,15 +696,11 @@ index 000000000..2c8c777a7
+ const char* name_en() const {
+ return polyseed_get_lang_name_en(m_lang);
+ }
-+ const char* separator() const {
-+ return m_lang->separator;
-+ }
+ bool valid() const {
+ return m_lang != nullptr;
+ }
-+
-+ const polyseed_lang* m_lang;
-+ private:
++ private:
++ const polyseed_lang* m_lang;
+
+ friend class data;
+ };
@@ -771,7 +753,7 @@ index 000000000..2c8c777a7
+ auto size = polyseed_encode(m_data, lang.m_lang, m_coin, &str[0]);
+ str.resize(size);
+ }
-+
++
+ void split(const language& lang, polyseed_phrase& words);
+
+ void save(polyseed_storage storage) const {
@@ -824,11 +806,10 @@ index 000000000..2c8c777a7
+ polyseed_coin m_coin;
+ };
+}
-+
+#endif //POLYSEED_HPP
\ No newline at end of file
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index d81ddec93..db9c2b5d9 100644
+index d81ddec93..ceb0bcb8b 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -683,6 +683,28 @@ bool WalletImpl::recoverFromDevice(const std::string &path, const std::string &p
@@ -875,7 +856,7 @@ index d81ddec93..db9c2b5d9 100644
+ }
+
+ bool result = m_wallet->get_polyseed(seed_words_epee, passphrase_epee);
-+
++
+ seed_words.assign(seed_words_epee.data(), seed_words_epee.size());
+ passphrase.assign(passphrase_epee.data(), passphrase_epee.size());
+
@@ -897,7 +878,7 @@ index d81ddec93..db9c2b5d9 100644
+bool Wallet::createPolyseed(std::string &seed_words, std::string &err, const std::string &language)
+{
+ epee::wipeable_string seed_words_epee(seed_words.c_str(), seed_words.size());
-+
++
+ try {
+ polyseed::data polyseed(POLYSEED_COIN);
+ polyseed.create(0);
@@ -1025,7 +1006,7 @@ index 206aedc14..e3149300c 100644
bool walletExists(const std::string &path) override;
bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, bool no_spend_key, uint64_t kdf_rounds = 1) const override;
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
-index e586d67f7..83aba6253 100644
+index e586d67f7..8b6682da9 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -92,6 +92,7 @@ using namespace epee;
@@ -1167,18 +1148,15 @@ index e586d67f7..83aba6253 100644
uint64_t target_height = get_daemon_blockchain_target_height(err);
if (err.empty()) {
if (target_height < height)
-@@ -13546,9 +13611,9 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
+@@ -13546,7 +13611,7 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
return target_height;
}
-uint64_t wallet2::get_approximate_blockchain_height() const
+uint64_t wallet2::get_approximate_blockchain_height(uint64_t t) const
{
-- uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/307;
-+ uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : ((t > 0 ? t : time(NULL)) - 1522624244)/307;
+ uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/307;
LOG_PRINT_L2("Calculated blockchain height: " << approx_blockchain_height);
- return approx_blockchain_height;
- }
@@ -15262,15 +15327,6 @@ bool wallet2::parse_uri(const std::string &uri, std::string &address, std::strin
//----------------------------------------------------------------------------------------------------
uint64_t wallet2::get_blockchain_height_by_date(uint16_t year, uint8_t month, uint8_t day)
@@ -1296,5 +1274,5 @@ index df34f9abf..db5c1feb3 100644
uint32_t m_multisig_threshold;
std::vector<crypto::public_key> m_multisig_signers;
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0003-wallet-background-sync-with-just-the-view-key.patch b/patches/wownero/0003-wallet-background-sync-with-just-the-view-key.patch
index 95a8cfa..9c9347e 100644
--- a/patches/wownero/0003-wallet-background-sync-with-just-the-view-key.patch
+++ b/patches/wownero/0003-wallet-background-sync-with-just-the-view-key.patch
@@ -1,4 +1,4 @@
-From 9d6099e9c47f7cbd12f4d6550d6fda520733c2c5 Mon Sep 17 00:00:00 2001
+From 05003c0562e12cd9a768b7799982f1b05149cae2 Mon Sep 17 00:00:00 2001
From: j-berman <justinberman@protonmail.com>
Date: Thu, 13 Oct 2022 18:33:33 -0700
Subject: [PATCH 3/9] wallet: background sync with just the view key
@@ -50,7 +50,7 @@ cache.
20 files changed, 2350 insertions(+), 132 deletions(-)
diff --git a/src/cryptonote_basic/account.cpp b/src/cryptonote_basic/account.cpp
-index 4931c3740..2d556f285 100644
+index 020e71e9d..fbe0a79ba 100644
--- a/src/cryptonote_basic/account.cpp
+++ b/src/cryptonote_basic/account.cpp
@@ -158,6 +158,17 @@ DISABLE_VS_WARNINGS(4244 4345)
@@ -748,7 +748,7 @@ index 8e3477ba3..ae1aa312b 100644
bool set_show_detailed_prompt(const std::vector<std::string> &args = std::vector<std::string>());
bool set_inactivity_lock_timeout(const std::vector<std::string> &args = std::vector<std::string>());
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index db9c2b5d9..5ef3132d2 100644
+index ceb0bcb8b..b6ef2956f 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -56,6 +56,40 @@ using namespace cryptonote;
@@ -1326,7 +1326,7 @@ index a0ed60a39..626c63fc5 100644
virtual TransactionHistory * history() = 0;
virtual AddressBook * addressBook() = 0;
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
-index 83aba6253..d7e2a9699 100644
+index 8b6682da9..5b4977b8d 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -158,6 +158,8 @@ static const std::string MULTISIG_SIGNATURE_MAGIC = "SigMultisigPkV1";
@@ -4342,5 +4342,5 @@ index 1e10e1f86..bff33a561 100644
+ }
+ return self.rpc.send_json_rpc_request(stop_background_sync)
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0004-airgap.patch b/patches/wownero/0004-airgap.patch
index b0c3c02..5f5969b 100644
--- a/patches/wownero/0004-airgap.patch
+++ b/patches/wownero/0004-airgap.patch
@@ -1,4 +1,4 @@
-From 60c89b5c4e2e874e725915ed0a8b7709849ef140 Mon Sep 17 00:00:00 2001
+From 2ee7b25a0cee0ee0fbbf7fadd494b2eac85bbdd6 Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 26 Mar 2024 09:06:32 +0100
Subject: [PATCH 4/9] airgap
@@ -12,7 +12,7 @@ Subject: [PATCH 4/9] airgap
5 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 5ef3132d2..1c9a709d4 100644
+index b6ef2956f..20be5c9f0 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1172,6 +1172,24 @@ uint64_t WalletImpl::unlockedBalance(uint32_t accountIndex) const
@@ -94,7 +94,7 @@ index 626c63fc5..39b942ef4 100644
* \brief exportKeyImages - exports key images to file
* \param filename
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
-index d7e2a9699..f996863ff 100644
+index 5b4977b8d..31855a256 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -7432,6 +7432,25 @@ uint64_t wallet2::unlocked_balance(uint32_t index_major, bool strict, uint64_t *
@@ -166,5 +166,5 @@ index 2f2664f8e..51dbb5b89 100644
std::map<uint32_t, uint64_t> balance_per_subaddress(uint32_t subaddr_index_major, bool strict) const;
std::map<uint32_t, std::pair<uint64_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddress(uint32_t subaddr_index_major, bool strict);
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0005-coin-control.patch b/patches/wownero/0005-coin-control.patch
index e2dbdb1..b5d74bb 100644
--- a/patches/wownero/0005-coin-control.patch
+++ b/patches/wownero/0005-coin-control.patch
@@ -1,4 +1,4 @@
-From 9f9937ef8f4822c498e10e5bbfc57dfdfb7137f7 Mon Sep 17 00:00:00 2001
+From 878df2babdc8abd7d38edae49aa321d3b2185bbd Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Wed, 27 Mar 2024 16:31:36 +0100
Subject: [PATCH 5/9] coin control
@@ -118,7 +118,7 @@ index 3293d8ae9..bcd8b517f 100644
WalletImpl *m_wallet;
std::vector<CoinsInfo*> m_rows;
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 1c9a709d4..b935723f7 100644
+index 20be5c9f0..0430a7f9b 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -2018,11 +2018,11 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
@@ -153,7 +153,7 @@ index 39b942ef4..678f9b6b9 100644
struct SubaddressRow {
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
-index f996863ff..c53b1de67 100644
+index 31855a256..a307a59f9 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2094,11 +2094,21 @@ bool wallet2::frozen(const multisig_tx_set& txs) const
@@ -221,5 +221,5 @@ index 51dbb5b89..5e27e46cf 100644
bool frozen(const crypto::key_image &ki) const;
bool frozen(const transfer_details &td) const;
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0006-fix-build.patch b/patches/wownero/0006-fix-build.patch
index 2214dfb..e7f2438 100644
--- a/patches/wownero/0006-fix-build.patch
+++ b/patches/wownero/0006-fix-build.patch
@@ -1,4 +1,4 @@
-From 60bfb0146f7756fe339f9d3744df2bebdf628dfb Mon Sep 17 00:00:00 2001
+From 07ae3b5852e6be58a792e5fc1122efd2f30e2625 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 26 Mar 2024 09:44:54 +0100
Subject: [PATCH 6/9] fix build
@@ -133,5 +133,5 @@ index 000000000..f05cb2b6a
+ #else
+ #ifdef POLYSEED_SHARED
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0007-macos-build-fix.patch b/patches/wownero/0007-macos-build-fix.patch
index 10c33d8..006ddfa 100644
--- a/patches/wownero/0007-macos-build-fix.patch
+++ b/patches/wownero/0007-macos-build-fix.patch
@@ -1,4 +1,4 @@
-From 0f3c19706a35798a28eb040858052292a3709312 Mon Sep 17 00:00:00 2001
+From 7360e324de154023d185d3181e46fcc2ef397ccc Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Thu, 28 Mar 2024 02:03:08 +0100
Subject: [PATCH 7/9] macos build fix
@@ -111,5 +111,5 @@ index 000000000..a261636e8
+2.39.2
+
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0008-FIX-wallet-listener-crashing.patch b/patches/wownero/0008-FIX-wallet-listener-crashing.patch
index ae5c712..822202a 100644
--- a/patches/wownero/0008-FIX-wallet-listener-crashing.patch
+++ b/patches/wownero/0008-FIX-wallet-listener-crashing.patch
@@ -1,4 +1,4 @@
-From a2beff7fc49b80972f78dddedf0ea8c4db145f72 Mon Sep 17 00:00:00 2001
+From d9544a736cbccc173dcdf79538ee206a4ec63db6 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 2 Apr 2024 11:56:09 +0200
Subject: [PATCH 8/9] FIX: wallet listener crashing
@@ -8,7 +8,7 @@ Subject: [PATCH 8/9] FIX: wallet listener crashing
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index b935723f7..432ca4fbf 100644
+index 0430a7f9b..95d1fcbb8 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -201,8 +201,11 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
@@ -54,5 +54,5 @@ index b935723f7..432ca4fbf 100644
virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx)
--
-2.44.0
+2.39.2
diff --git a/patches/wownero/0009-fix-missing-___clear_cache-when-targetting-iOS.patch b/patches/wownero/0009-fix-missing-___clear_cache-when-targetting-iOS.patch
index e8809cd..b7a0b9b 100644
--- a/patches/wownero/0009-fix-missing-___clear_cache-when-targetting-iOS.patch
+++ b/patches/wownero/0009-fix-missing-___clear_cache-when-targetting-iOS.patch
@@ -1,4 +1,4 @@
-From 8cfcf5b132c41aedbc9c9a0932ffb832cf410761 Mon Sep 17 00:00:00 2001
+From dec7e838540e0b9c3fab27886864de29221a9fe9 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 2 Apr 2024 17:07:19 +0200
Subject: [PATCH 9/9] fix missing ___clear_cache when targetting iOS
@@ -9,17 +9,17 @@ Subject: [PATCH 9/9] fix missing ___clear_cache when targetting iOS
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gitmodules b/.gitmodules
-index 86009b6b6..f723bd2d8 100644
+index bab1cbed2..354638453 100644
--- a/.gitmodules
+++ b/.gitmodules
-@@ -20,6 +20,6 @@
- url = https://github.com/tevador/polyseed.git
+@@ -17,6 +17,6 @@
+ branch = monero
[submodule "external/randomwow"]
path = external/randomwow
- url = https://git.wownero.com/wownero/RandomWOW
- branch = 1.2.1-wow
+ url = https://github.com/mrcyjanek/RandomWOW
-+ branch = cyjan-fix-ios
++ branch = cyjan-fix-ios
diff --git a/external/randomwow b/external/randomwow
index 27b099b6d..6f30d4b92 160000
@@ -29,5 +29,5 @@ index 27b099b6d..6f30d4b92 160000
-Subproject commit 27b099b6dd6fef6e17f58c6dfe00009e9c5df587
+Subproject commit 6f30d4b924fecb231e5b683915cc75d18b3b5866
--
-2.44.0
+2.39.2