decentralized-identity / DIDComm-js

JS implementation of pack and unpack
Apache License 2.0
55 stars 25 forks source link

Fix name of libsodium chacha20poly1305 keygen function #5

Closed Patrik-Stas closed 5 years ago

Patrik-Stas commented 5 years ago

Hi @kdenhartog, it seems like in your latest changes you didn't hit the precise libsodium binding, the encryption/decryption test is failing right now on this:

TypeError: this.sodium.crypto_secretstream_chacha20poly1305_ietf_keygen is not a function

      141 | 
      142 |     private prepareRecipientKeys(toKeys: any, fromKeys: any = null) {
    > 143 |         const cek = this.sodium.crypto_secretstream_chacha20poly1305_ietf_keygen()
          |                                 ^

I think I fixed it (the test is passing) but it would be great if someone could verify this is really the correct libsodium call. Based on this it sounds like crypto_secretstream_* and crypto_aead_* are equivalent? Also made my judgement based on this and this