We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c7ba61c + 12a2a72 commit 6bf98b2Copy full SHA for 6bf98b2
1 file changed
src/shuffled/crypto.py
@@ -1,5 +1,5 @@
1
import math
2
-from abc import ABC, abstractmethod, abstractproperty
+from abc import ABC, abstractmethod
3
from typing import Sequence
4
5
from cryptography.hazmat.backends import default_backend
@@ -9,15 +9,18 @@
9
10
11
class Randomizer(ABC):
12
- @abstractproperty
+ @property
13
+ @abstractmethod
14
def domain_size(self) -> int: ...
15
16
@abstractmethod
17
def randomize(self, integer: int) -> int: ...
18
19
20
class AesRandomizer(Randomizer):
- domain_size = 2**128
21
22
+ def domain_size(self) -> int:
23
+ return 2**128
24
25
def __init__(self, key: bytes) -> None:
26
cipher = Cipher(algorithms.AES(key), modes.ECB(), backend=default_backend())
0 commit comments