diff --git a/.gitignore b/.gitignore index 4b8fbb5..108dc59 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,4 @@ config.h config.log config.status *.tar.gz +autom4te.cache/ diff --git a/README.md b/README.md index 4e4e197..42ac794 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,10 @@ You can import a key by running the following command with that individual’s f ## Version History +### 0.2.0, 10/4/2020 + +* Fix for [https://github.com/BlockchainCommons/Research/issues/45](wordlist alphabetization error). + ### 0.1.1, 7/1/2020 * Moved to depending on bc-crypto-base for calculation of CRC32 checksum. diff --git a/configure b/configure index 200ada5..813c025 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bc-bytewords 0.1.1. +# Generated by GNU Autoconf 2.69 for bc-bytewords 0.2.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bc-bytewords' PACKAGE_TARNAME='bc-bytewords' -PACKAGE_VERSION='0.1.1' -PACKAGE_STRING='bc-bytewords 0.1.1' +PACKAGE_VERSION='0.2.0' +PACKAGE_STRING='bc-bytewords 0.2.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1225,7 +1225,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bc-bytewords 0.1.1 to adapt to many kinds of systems. +\`configure' configures bc-bytewords 0.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1286,7 +1286,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bc-bytewords 0.1.1:";; + short | recursive ) echo "Configuration of bc-bytewords 0.2.0:";; esac cat <<\_ACEOF @@ -1366,7 +1366,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bc-bytewords configure 0.1.1 +bc-bytewords configure 0.2.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1848,7 +1848,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bc-bytewords $as_me 0.1.1, which was +It was created by bc-bytewords $as_me 0.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4306,7 +4306,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bc-bytewords $as_me 0.1.1, which was +This file was extended by bc-bytewords $as_me 0.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4368,7 +4368,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bc-bytewords config.status 0.1.1 +bc-bytewords config.status 0.2.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6e80fe7..34ed4ed 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([bc-bytewords], [0.1.1]) +AC_INIT([bc-bytewords], [0.2.0]) AC_CONFIG_SRCDIR([src/bc-bytewords.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/src/bc-bytewords.c b/src/bc-bytewords.c index a0a9a48..e1ff661 100644 --- a/src/bc-bytewords.c +++ b/src/bc-bytewords.c @@ -11,7 +11,7 @@ #include #include -static const char* bytewords = "ableacidalsoapexaquaarchatomauntawayaxisbackbaldbarnbeltbetabiasbluebodybragbrewbulbbuzzcalmcashcatschefcityclawcodecolacookcostcruxcurlcuspcyandarkdatadaysdelidicedietdoordowndrawdropdrumdulldutyeacheasyechoedgeepicevenexamexiteyesfactfairfernfigsfilmfishfizzflapflewfluxfoxyfreefrogfuelfundgalagamegeargemsgiftgirlglowgoodgraygrimgurugushgyrohalfhanghardhawkheathelphighhillholyhopehornhutsicedideaidleinchinkyintoirisironitemjadejazzjoinjoltjowljudojugsjumpjunkjurykeepkenokeptkeyskickkilnkingkitekiwiknoblamblavalazyleaflegsliarlistlimplionlogoloudloveluaulucklungmainmanymathmazememomenumeowmildmintmissmonknailnavyneednewsnextnoonnotenumbobeyoboeomitonyxopenovalowlspaidpartpeckplaypluspoempoolposepuffpumapurrquadquizraceramprealredorichroadrockroofrubyruinrunsrustsafesagascarsetssilkskewslotsoapsolosongstubsurfswantacotasktaxitenttiedtimetinytoiltombtoystriptunatwinuglyundouniturgeuservastveryvetovialvibeviewvisavoidvowswallwandwarmwaspwavewaxywebswhatwhenwhizwolfworkyankyawnyellyogayurtzapszestzinczonezoomzero"; +static const char* bytewords = "ableacidalsoapexaquaarchatomauntawayaxisbackbaldbarnbeltbetabiasbluebodybragbrewbulbbuzzcalmcashcatschefcityclawcodecolacookcostcruxcurlcuspcyandarkdatadaysdelidicedietdoordowndrawdropdrumdulldutyeacheasyechoedgeepicevenexamexiteyesfactfairfernfigsfilmfishfizzflapflewfluxfoxyfreefrogfuelfundgalagamegeargemsgiftgirlglowgoodgraygrimgurugushgyrohalfhanghardhawkheathelphighhillholyhopehornhutsicedideaidleinchinkyintoirisironitemjadejazzjoinjoltjowljudojugsjumpjunkjurykeepkenokeptkeyskickkilnkingkitekiwiknoblamblavalazyleaflegsliarlimplionlistlogoloudloveluaulucklungmainmanymathmazememomenumeowmildmintmissmonknailnavyneednewsnextnoonnotenumbobeyoboeomitonyxopenovalowlspaidpartpeckplaypluspoempoolposepuffpumapurrquadquizraceramprealredorichroadrockroofrubyruinrunsrustsafesagascarsetssilkskewslotsoapsolosongstubsurfswantacotasktaxitenttiedtimetinytoiltombtoystriptunatwinuglyundouniturgeuservastveryvetovialvibeviewvisavoidvowswallwandwarmwaspwavewaxywebswhatwhenwhizwolfworkyankyawnyellyogayurtzapszerozestzinczonezoom"; static bool decode_word(const char* in_word, size_t word_len, uint8_t* out_index) { static int16_t* array = NULL; diff --git a/test/test.c b/test/test.c index ba6ee78..9ed3b7c 100644 --- a/test/test.c +++ b/test/test.c @@ -51,13 +51,13 @@ static bool test_decode(bw_style style, const char* encoded, uint8_t input[], si void test1() { uint8_t input[] = {0, 1, 2, 128, 255}; size_t input_len = 5; - assert(test_encode(bw_standard, input, input_len, "able acid also lava zero jade need echo taxi")); - assert(test_encode(bw_uri, input, input_len, "able-acid-also-lava-zero-jade-need-echo-taxi")); - assert(test_encode(bw_minimal, input, input_len, "aeadaolazojendeoti")); + assert(test_encode(bw_standard, input, input_len, "able acid also lava zoom jade need echo taxi")); + assert(test_encode(bw_uri, input, input_len, "able-acid-also-lava-zoom-jade-need-echo-taxi")); + assert(test_encode(bw_minimal, input, input_len, "aeadaolazmjendeoti")); - assert(test_decode(bw_standard, "able acid also lava zero jade need echo taxi", input, input_len)); - assert(test_decode(bw_uri, "able-acid-also-lava-zero-jade-need-echo-taxi", input, input_len)); - assert(test_decode(bw_minimal, "aeadaolazojendeoti", input, input_len)); + assert(test_decode(bw_standard, "able acid also lava zoom jade need echo taxi", input, input_len)); + assert(test_decode(bw_uri, "able-acid-also-lava-zoom-jade-need-echo-taxi", input, input_len)); + assert(test_decode(bw_minimal, "aeadaolazmjendeoti", input, input_len)); // bad checksum assert(!test_decode(bw_standard, "able acid also lava zero jade need echo wolf", input, input_len)); @@ -86,25 +86,25 @@ void test2() { char* encoded = "yank toys bulb skew when warm free fair tent swan " - "open brag mint noon jury lion view tiny brew note " - "body data webs what zone bald join runs data whiz " - "days keys user diet news ruby whiz zoom menu surf " + "open brag mint noon jury list view tiny brew note " + "body data webs what zinc bald join runs data whiz " + "days keys user diet news ruby whiz zone menu surf " "flew omit trip pose runs fund part even crux fern " "math visa tied loud redo silk curl jugs hard beta " "next cost puma drum acid junk swan free very mint " - "flap warm fact math flap what list free jugs yell " + "flap warm fact math flap what limp free jugs yell " "fish epic whiz open numb math city belt glow wave " - "list fuel grim free zoom open love diet gyro cats " + "limp fuel grim free zone open love diet gyro cats " "fizz holy city puff"; assert(test_encode(bw_standard, input, input_len, encoded)); assert(test_decode(bw_standard, encoded, input, input_len)); char* encoded_minimal = - "yktsbbswwnwmfefrttsnonbgmtnnjylnvwtybwne" - "bydawswtzebdjnrsdawzdsksurdtnsrywzzmmusf" + "yktsbbswwnwmfefrttsnonbgmtnnjyltvwtybwne" + "bydawswtzcbdjnrsdawzdsksurdtnsrywzzemusf" "fwottppersfdptencxfnmhvatdldroskcljshdba" - "ntctpadmadjksnfevymtfpwmftmhfpwtltfejsyl" - "fhecwzonnbmhcybtgwweltflgmfezmonledtgocs" + "ntctpadmadjksnfevymtfpwmftmhfpwtlpfejsyl" + "fhecwzonnbmhcybtgwwelpflgmfezeonledtgocs" "fzhycypf"; assert(test_encode(bw_minimal, input, input_len, encoded_minimal)); assert(test_decode(bw_minimal, encoded_minimal, input, input_len));