Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error: abstract def encrypt_detached must be implemented by XChaCha20Poly1305Ietf #16

Open
wout opened this issue Mar 11, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@wout
Copy link

wout commented Mar 11, 2022

Just including the lib raises the following error:

There was a problem expanding macro 'macro_140065154995856'

Code in lib/sodium/src/sodium/cipher/aead/chalsa.cr:88:3

 88 | {% for key, val in {"XChaCha20Poly1305Ietf" => "_xchacha20poly1305_ietf"} %}
      ^
Called macro defined in lib/sodium/src/sodium/cipher/aead/chalsa.cr:88:3

 88 | {% for key, val in {"XChaCha20Poly1305Ietf" => "_xchacha20poly1305_ietf"} %}

Which expanded to:

 >  7 | #
 >  8 | # WARNING: Not validated against test vectors.  You should probably write some before using this class.
 >  9 | class XChaCha20Poly1305Ietf < Chalsa
       ^
Error: abstract `def Sodium::Cipher::Aead::Chalsa#encrypt_detached(src : Bytes, dst : Bytes | ::Nil = nil, *, nonce : Sodium::Nonce | ::Nil = nil, mac : Bytes | ::Nil = nil, additional : String | Bytes | Nil = nil)` must be implemented by Sodium::Cipher::Aead::XChaCha20Poly1305Ietf

@didactic-drunk
Copy link
Owner

sodium.cr version?
crystal version?
os?

@didactic-drunk didactic-drunk added the bug Something isn't working label Mar 11, 2022
@wout
Copy link
Author

wout commented Mar 12, 2022

  • sodium.cr 1.2.3
  • crystal 1.2.2
  • elementary OS 6.1 (based on Ubuntu 20.04 LTS)

UPDATE:
I just did some more tests with different crystal versions and here are my findings:

  • 1.0.0 OK
  • 1.1.1 OK
  • 1.2.2 Error
  • 1.3.0 Error

@didactic-drunk
Copy link
Owner

Try master for the time being. A new release will happen soon.

m-o-e added a commit to busyloop/suzuri that referenced this issue Jul 3, 2022
Latest release version of sodium.cr
is broken in Crystal >= v1.2.2.

didactic-drunk/sodium.cr#16

The fixed version is not released, yet,
so for the time being we pin to a known
good commit on master.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants