Skip to content

EdDSA hash not working #1097

@nijel

Description

@nijel

compute_hash_digest does not work for EdDSA.

Expected Result

I'd expect compute_hash_digest for EdDSA to work.

Actual Result

It fails with NotImplementedError. This was originally reported at python-social-auth/social-core#1306, so there might be something wrong in python-social-auth as well.

Reproduction Steps

(test) /tmp$ uv pip install 'pyjwt[crypto]'
Using Python 3.11.2 environment at: test
Resolved 4 packages in 313ms
░░░░░░░░░░░░░░░░░░░░ [0/4] Installing wheels...                                                                                                                                                                    
Installed 4 packages in 51ms
 + cffi==2.0.0
 + cryptography==46.0.1
 + pycparser==2.23
 + pyjwt==2.10.1
(test) /tmp$ python
Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jwt
>>> algo = jwt.get_algorithm_by_name('EdDSA')
>>> algo.compute_hash_digest(b'')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/test/lib/python3.11/site-packages/jwt/algorithms.py", line 153, in compute_hash_digest
    raise NotImplementedError
NotImplementedError

System Information

{
  "cryptography": {
    "version": "46.0.1"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.11.2"
  },
  "platform": {
    "release": "6.1.0-38-amd64",
    "system": "Linux"
  },
  "pyjwt": {
    "version": "2.10.1"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues without activity for more than 60 days

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions