polyseed fix

tobtoht:
Since only the composed languages are broken, it could also be that canonical composition is producing weird output. Try dumping whatever seed string is being fed to polyseed_decode to hex and we should be able to tell.
Or try removing UTF8PROC_LUMP from utf8_nfc
This commit is contained in:
Czarek Nakamoto
2024-04-15 16:14:38 +02:00
parent 365e58bb9f
commit 1b58a960da
4 changed files with 11 additions and 7 deletions

View File

@@ -1,8 +1,9 @@
From 33d611538efef134106f427c7ee5535d28d588f6 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
From: tobtoht <tob@featherwallet.org>
Date: Tue, 26 Mar 2024 08:19:23 +0100
Subject: [PATCH 2/9] polyseed support
Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
---
.github/workflows/build.yml | 4 +-
.gitmodules | 6 +
@@ -533,7 +534,7 @@ index 000000000..b26f37574
+ 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));
+ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_STRIPNA));
+ }
+
+ static size_t utf8_nfkd(const char* str, polyseed_str norm) {