File: test_ed25519.py

package info (click to toggle)
python-lib25519 0~20241004.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 120 kB
  • sloc: python: 179; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 242 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
from lib25519 import ed25519
import os


def test_ed25519():
    pk, sk = ed25519.keypair()
    m1 = os.urandom(128)
    sm = ed25519.sign(m1, sk)
    m2 = ed25519.open(sm, pk)
    assert (m1 == m2)

if __name__ == 'main':
    test_ed25519()