File: pre_key_pair.py

package info (click to toggle)
python-x3dh 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 356 kB
  • sloc: python: 1,259; makefile: 15
file content (25 lines) | stat: -rw-r--r-- 343 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from typing import NamedTuple

import xeddsa


__all__ = [
    "PreKeyPair"
]


class PreKeyPair(NamedTuple):
    """
    A pre key.
    """

    priv: bytes

    @property
    def pub(self) -> bytes:
        """
        Returns:
            The public key of this pre key.
        """

        return xeddsa.priv_to_curve25519_pub(self.priv)