|
5 | 5 | import os |
6 | 6 | from typing import Sequence |
7 | 7 |
|
8 | | -from .certificates import client_pk_len_for_es_version |
9 | | -from .constants import ( |
| 8 | +from certificates import client_pk_len_for_es_version |
| 9 | +from constants import ( |
10 | 10 | CLIENT_MAGIC_SIZE, |
11 | 11 | CLIENT_NONCE_SIZE, |
12 | 12 | ES_VERSION_XCHACHA20POLY1305, |
|
18 | 18 | RESOLVER_NONCE_SIZE, |
19 | 19 | TAG_SIZE, |
20 | 20 | ) |
21 | | -from .crypto import ( |
| 21 | +from crypto import ( |
22 | 22 | _require_size, |
23 | 23 | box_xchacha20_shared_key, |
24 | 24 | pad_7816_4, |
|
28 | 28 | xchacha20_djb_poly1305_open, |
29 | 29 | xchacha20_djb_poly1305_seal, |
30 | 30 | ) |
31 | | -from .errors import CertificateError, DecryptionError |
32 | | -from .types import DecryptedQuery, PreparedQuery, ResolverCertificate |
| 31 | +from errors import CertificateError, DecryptionError |
| 32 | +from protocol_types import DecryptedQuery, PreparedQuery, ResolverCertificate |
33 | 33 |
|
34 | 34 |
|
35 | 35 | def encrypt_dnscrypt_query( |
@@ -92,7 +92,7 @@ def decrypt_dnscrypt_query( |
92 | 92 | if certificate.es_version == ES_VERSION_XCHACHA20POLY1305: |
93 | 93 | shared_key = box_xchacha20_shared_key(match.resolver_sk, client_pk) |
94 | 94 | elif certificate.es_version == ES_VERSION_XWING: |
95 | | - from .pq import pq_shared_key, xwing_decapsulate |
| 95 | + from pq import pq_shared_key, xwing_decapsulate |
96 | 96 |
|
97 | 97 | kem_ss = xwing_decapsulate(encrypted_kem=client_pk, secret_seed=match.resolver_sk) |
98 | 98 | shared_key = pq_shared_key(certificate, kem_ss, client_pk) |
|
0 commit comments