Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Add JA test vectors #38

Merged
merged 2 commits into from Oct 5, 2015
Merged

Add JA test vectors #38

merged 2 commits into from Oct 5, 2015

Conversation

dabura667
Copy link
Contributor

(Note: changed this PR to only contain JP test vectors)

This will add Japanese test vectors to the library.

@dabura667 dabura667 force-pushed the add-jp-tests branch 3 times, most recently from 62ee824 to 87ba5be Compare September 28, 2015 12:44
@dabura667 dabura667 changed the title [BUGFIX] Fix major utf8 bug + add JA test vectors Add JA test vectors Sep 28, 2015
@dabura667
Copy link
Contributor Author

Note: this PR requires #39 which is why it is failing.

@braydonf
Copy link
Contributor

These vectors I believe originally came from: https://github.com/trezor/python-mnemonic/blob/master/vectors.json It may be useful to follow up upstream as well?

@dabura667
Copy link
Contributor Author

Yes, I created these using python by replacing existing code with Japanese (rather than adding supprt for multiple languages). Then I ran those tests manually against my own javascript implementation based off early versions of bip39 (bitcoinjs-lib), but again, no upstream support.
https://bip32jp.github.io/english/

I just added Japanese in a pr to bip39 the other day.
bitcoinjs/bip39#24

I should also add the vectors to python-mnemonic.

@braydonf
Copy link
Contributor

How did you produce the seed hex values?

Did you run python3 generate_vectors.py from https://github.com/trezor/python-mnemonic

@dabura667
Copy link
Contributor Author

I believe I just used the same as English.

@braydonf
Copy link
Contributor

braydonf commented Oct 1, 2015

I was running #39 with vectors generated from python3 generate_vectors.py. Even though the vectors committed in the python-mnemonic repository only include English vectors, the script will also generate Japanese, and was able to get it to work with a few modifications. However I needed to replace the ideographic spaces that was generated with 0xe38080, and wasn't able to verify the toSeed() hex strings.

matiu added a commit that referenced this pull request Oct 5, 2015
@matiu matiu merged commit 34331c6 into bitpay:master Oct 5, 2015
@dabura667
Copy link
Contributor Author

@braydonf thats because the generate_vectors uses passphrase TREZOR whereas mine use a japanese passphrase

@braydonf
Copy link
Contributor

braydonf commented Oct 5, 2015

I tried using that one as well, and didn't have any luck.

@dabura667
Copy link
Contributor Author

@braydonf I just tried again, and suddenly forgot how to get python to cooperate with UTF-8...

I struggled for a while, and decided to quit. However, the vectors I have here I have verified against the python reference implementation... though I forget how I did it.

I even tried using a VM with Ubuntu, still was getting ASCII errors crying about \u3000...

@braydonf
Copy link
Contributor

braydonf commented Oct 5, 2015

I used python3, and the generate_vectors.py worked (except for the ideographic space issues mentioned earlier), I had issues when trying to use python2.7.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants