(use tweetnacl base64) (define sk (string->blob (base64-decode (string-append "49sFCt7Gh8gcbeE+ah/ojWAQiYaafiV8iX6m2Wdn3EYCTckgw" "0JZGEITrzr34HEQXQhPDKdkOtlW68xLgGzFZw==")))) (define pk (string->blob (base64-decode "Ak3JIMNCWRhCE6869+BxEF0ITwynZDrZVuvMS4BsxWc="))) ;; verifying empty string from tweetnacl js works: ((asymmetric-verify pk) (base64-decode "4SmIdjvxlarfcIZmw2NRow42RwEVuBztLSHp2cqr10hHpq0vRU2sf7DGOM9EAenq+IyycNMYOD1di6zF6fQFCQ==")) ;; sign "hello" from https://dchest.github.io/tweetnacl-js/#/sign with the secret key: ;; "49sFCt7Gh8gcbeE+ah/ojWAQiYaafiV8iX6m2Wdn3EYCTckgw0JZGEITrzr34HEQXQhPDKdkOtlW68xLgGzFZw==" ;; but this doesn't work with chicken-tweetnacl ((asymmetric-verify pk) (base64-decode "ccCcxjh+xxdUf/qozU7Nsr/InOK3yFEiuJmTQUhCF8kqVuFKO/WGXLf5nj2QPsSHM+9at6s56Ox/GhIN4vtYDQ==")) ;; chicken-tweetnacl produces a different signature for the same content: ;; "ccCcxjh+xxdUf/qozU7Nsr/InOK3yFEiuJmTQUhCF8kqVuFKO/WGXLf5nj2QPsSHM+9at6s56Ox/GhIN4vtYDWhlbGxv" (base64-encode ((asymmetric-sign sk) "hello")) ;; verifying this, things work. ((asymmetric-verify pk) (base64-decode "ccCcxjh+xxdUf/qozU7Nsr/InOK3yFEiuJmTQUhCF8kqVuFKO/WGXLf5nj2QPsSHM+9at6s56Ox/GhIN4vtYDWhlbGxv")) ;; possible causes: ;; tweetnacl.js and the original tweetnacl.impl.c are different somehow ;; https://dchest.github.io/tweetnacl-js/#/sign does some strange UTF16 encoding? <-- nope, it's UFT8