We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d0bc3a commit 039da39Copy full SHA for 039da39
1 file changed
hkdf.py
@@ -3,30 +3,18 @@
3
import hmac
4
import hashlib
5
import sys
6
-from struct import pack, error as struct_error
+from struct import Struct, pack, error as struct_error
7
from itertools import count, islice
8
9
if sys.version_info[0] == 3:
10
buffer = lambda x: x
11
12
13
MAX_INT64 = 0xffffffffffffffffffffffffffffffff
14
-
15
16
-def COUNTER8(x):
17
- return pack('>B', x)
18
19
20
-def COUNTER16(x):
21
- return pack('>H', x)
22
23
24
-def COUNTER32(x):
25
- return pack('>I', x)
26
27
28
-def COUNTER64(x):
29
- return pack('>Q', x)
+COUNTER8 = Struct('>B').pack
+COUNTER16 = Struct('>H').pack
+COUNTER32 = Struct('>I').pack
+COUNTER64 = Struct('>Q').pack
30
31
32
def COUNTER128(x):
0 commit comments