bip39: document that mnemonic/passphrase arguments require ascii/utf8 nfkd
What changed, and why it matters
This commit only updates documentation comments in a header file. It adds a note that BIP39 mnemonic and passphrase arguments must be ASCII or UTF-8 NFKD encoded. No code behavior changed, no bug was fixed, and no security vulnerability was addressed.
No action required. This is a documentation-only change. Reviewers may optionally verify that callers already enforce the documented encoding requirement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies only Doxygen-style comments in include/wally_bip39.h for four functions: bip39_mnemonic_to_bytes, bip39_mnemonic_validate, bip39_mnemonic_to_seed, and bip39_mnemonic_to_seed512. The change documents an existing input requirement (ASCII or UTF-8 NFKD encoding) but does not alter function signatures, validation logic, or any implementation code.
Changed components
include/wally_bip39.hInspect captured patch +6 / −6
### include/wally_bip39.h
@@ -97,7 +97,7 @@ WALLY_CORE_API int bip39_mnemonic_from_bytes(
* Convert a mnemonic sentence into entropy at ``bytes_out``.
*
* :param w: Word list to use. Pass NULL to use the default English list.
- * :param mnemonic: Mnemonic to convert.
+ * :param mnemonic: Mnemonic to convert. Must be ASCII or UTF-8 NFKD encoded.
* :param bytes_out: Destination for the resulting entropy.
* MAX_SIZED_OUTPUT(len, bytes_out, BIP39_ENTROPY_MAX_LEN)
* :param written: Destination for the number of bytes written to ``bytes_out``.
@@ -113,7 +113,7 @@ WALLY_CORE_API int bip39_mnemonic_to_bytes(
* Validate the checksum embedded in a mnemonic sentence.
*
* :param w: Word list to use. Pass NULL to use the default English list.
- * :param mnemonic: Mnemonic to validate.
+ * :param mnemonic: Mnemonic to validate. Must be ASCII or UTF-8 NFKD encoded.
*/
WALLY_CORE_API int bip39_mnemonic_validate(
const struct words *w,
@@ -122,8 +122,8 @@ WALLY_CORE_API int bip39_mnemonic_validate(
/**
* Convert a mnemonic into a binary seed.
*
- * :param mnemonic: Mnemonic to convert.
- * :param passphrase: Mnemonic passphrase or NULL if no passphrase is needed.
+ * :param mnemonic: Mnemonic to convert. Must be ASCII or UTF-8 NFKD encoded.
+ * :param passphrase: Mnemonic passphrase or NULL if no passphrase is needed. Must be ASCII or UTF-8 NFKD encoded.
* :param bytes_out: The destination for the binary seed.
* FIXED_SIZED_OUTPUT(len, bytes_out, BIP39_SEED_LEN_512)
* :param written: Destination for the number of bytes written to ``bytes_out``.
@@ -138,8 +138,8 @@ WALLY_CORE_API int bip39_mnemonic_to_seed(
/**
* Convert a mnemonic into a binary seed of 512 bits.
*
- * :param mnemonic: Mnemonic to convert.
- * :param passphrase: Mnemonic passphrase or NULL if no passphrase is needed.
+ * :param mnemonic: Mnemonic to convert. Must be ASCII or UTF-8 NFKD encoded.
+ * :param passphrase: Mnemonic passphrase or NULL if no passphrase is needed. Must be ASCII or UTF-8 NFKD encoded.
* :param bytes_out: The destination for the binary seed.
* FIXED_SIZED_OUTPUT(len, bytes_out, BIP39_SEED_LEN_512)
*Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.