jedisct1 / libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Other
980 stars 141 forks source link

libsodium.js on s390x #255

Closed bert2002 closed 3 years ago

bert2002 commented 3 years ago

Hi, we want to use libsodium on the s390x architecture of IBM (IBM Z) and running into a runtime error. We run Debian 10 with libsodum 1.0.17-1 but when using the lib we are running into an error. We wrote a quick test (attached) and running into this problem:

$ npm start
npm WARN npm npm does not support Node.js v10.21.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

> test-libsodium@1.0.0 start /home/user/test-libsodium
> npx tsc && node ./built/index.js

Running a simple sodium test...
TypeError: Cannot read property 'rc' of undefined
    at Object.I._sodium_init (/home/user/test-libsodium/node_modules/libsodium/dist/modules/libsodium.js:1:319019)
    at a (/home/user/test-libsodium/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js:1:98)
    at /home/user/test-libsodium/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js:1:14262

Any idea which kernel function it tries to access that might not be available on s390x?

Cheers, bert

bert2002 commented 3 years ago

Example code: tezos-libsodium-test.tar.gz Run it with:

npm ci
npm start

Expected outcome:

# npm start

> test-libsodium@1.0.0 start /home/user/Downloads/tezos/test-libsodium
> npx tsc && node ./built/index.js

Running a simple sodium test...

### DONE!
Encoded key: 'tz1RtHAYaWuqdTFWg31KC2E5QnMQ6Y7t8Go2' ###
bert2002 commented 3 years ago

Hi, it seems that libsodium-wrappers-sumo works on s390x.

jedisct1 commented 3 years ago

it seems that libsodium-wrappers-sumo works on s390x.

Great!