File: dh.py

package info (click to toggle)
python-noiseprotocol 0.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: python: 1,259; makefile: 25
file content (21 lines) | stat: -rw-r--r-- 448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import abc


class DH(metaclass=abc.ABCMeta):
    @property
    @abc.abstractmethod
    def klass(self):
        raise NotImplementedError

    @property
    @abc.abstractmethod
    def dhlen(self):
        raise NotImplementedError

    @abc.abstractmethod
    def generate_keypair(self) -> 'KeyPair':
        raise NotImplementedError

    @abc.abstractmethod
    def dh(self, private_key, public_key) -> bytes:
        raise NotImplementedError