3 #define __DNSCRYPT_H__ 1
10 #define DNSCRYPT_MAGIC_QUERY_LEN 8U
11 #define DNSCRYPT_MAGIC_RESPONSE "r6fnvWj8"
13 #ifndef DNSCRYPT_MAX_PADDING
14 # define DNSCRYPT_MAX_PADDING 256U
16 #ifndef DNSCRYPT_BLOCK_SIZE
17 # define DNSCRYPT_BLOCK_SIZE 64U
19 #ifndef DNSCRYPT_MIN_PAD_LEN
20 # define DNSCRYPT_MIN_PAD_LEN 8U
22 #define crypto_box_HALF_NONCEBYTES (crypto_box_NONCEBYTES / 2U)
24 size_t dnscrypt_response_header_size(void);
25 size_t dnscrypt_query_header_size(void);
27 int dnscrypt_cmp_client_nonce(const uint8_t
28 client_nonce
[crypto_box_HALF_NONCEBYTES
],
29 const uint8_t * const buf
, const size_t len
);
31 size_t dnscrypt_pad(uint8_t *buf
, const size_t len
, const size_t max_len
);
33 void dnscrypt_key_to_fingerprint(char fingerprint
[80U],
34 const uint8_t * const key
);
36 int dnscrypt_fingerprint_to_key(const char * const fingerprint
,
37 uint8_t key
[crypto_box_PUBLICKEYBYTES
]);