ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
sizes.h
Go to the documentation of this file.
1#pragma once
2
3/* Existing buffer budgets in bytes, including NUL for text storage. */
4#define GPG_SIGNATURE_PACKET_CAPACITY 512
5
6/* Existing buffer budgets in bytes, including NUL for text storage. */
7#define ED25519_SIGNATURE_PART_SIZE (ED25519_SIGNATURE_SIZE / 2)
8
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
17
22
24#define MIN_PASSWORD_LENGTH 8
26#define MAX_PASSWORD_LENGTH 256
27
29
34
36#define X25519_KEY_SIZE 32
38#define ED25519_PUBLIC_KEY_SIZE 32
40#define ED25519_PRIVATE_KEY_SIZE 64
42#define ED25519_SIGNATURE_SIZE 64
44#define XSALSA20_NONCE_SIZE 24
46#define POLY1305_MAC_SIZE 16
48#define HMAC_SHA256_SIZE 32
50#define HMAC_SHA256_KEY_SIZE 32
52#define ARGON2ID_SALT_SIZE 32
54#define SECRETBOX_KEY_SIZE 32
56#define AES256_KEY_SIZE 32
58#define AES_IV_SIZE 16
60#define AES256_DERIVED_SIZE (AES256_KEY_SIZE + AES_IV_SIZE)
61
63
70
72#define CRYPTO_PUBLIC_KEY_SIZE X25519_KEY_SIZE
74#define CRYPTO_PRIVATE_KEY_SIZE X25519_KEY_SIZE
76#define CRYPTO_SHARED_KEY_SIZE X25519_KEY_SIZE
78#define CRYPTO_ED25519_PUBLIC_KEY_SIZE ED25519_PUBLIC_KEY_SIZE
80#define CRYPTO_ED25519_PRIVATE_KEY_SIZE ED25519_PRIVATE_KEY_SIZE
82#define CRYPTO_ED25519_SIGNATURE_SIZE ED25519_SIGNATURE_SIZE
84#define CRYPTO_NONCE_SIZE XSALSA20_NONCE_SIZE
86#define CRYPTO_SALT_SIZE ARGON2ID_SALT_SIZE
88#define CRYPTO_ENCRYPTION_KEY_SIZE SECRETBOX_KEY_SIZE
90#define CRYPTO_MAC_SIZE POLY1305_MAC_SIZE
92#define CRYPTO_HMAC_SIZE HMAC_SHA256_SIZE
93
95
100
102#define AUTH_HMAC_SIZE 32
104#define AUTH_CHALLENGE_SIZE 32
106#define AUTH_COMBINED_SIZE (AUTH_HMAC_SIZE + AUTH_CHALLENGE_SIZE)
108#define AUTH_SIGNATURE_SIZE 64
110#define AUTH_SIGNATURE_COMBINED_SIZE (AUTH_SIGNATURE_SIZE + AUTH_CHALLENGE_SIZE)
111
113
118
120#define AUTH_CHALLENGE_FLAGS_SIZE 1
122#define AUTH_CHALLENGE_PACKET_SIZE \
123 (AUTH_CHALLENGE_FLAGS_SIZE + AUTH_CHALLENGE_SIZE)
124
126
131
134#define AUTH_RESPONSE_PASSWORD_SIZE (AUTH_HMAC_SIZE + AUTH_CHALLENGE_SIZE)
137#define AUTH_RESPONSE_SIGNATURE_SIZE (AUTH_SIGNATURE_SIZE + AUTH_CHALLENGE_SIZE)
138
140
142#define SERVER_AUTH_RESPONSE_SIZE AUTH_HMAC_SIZE
143
148
150#define MAX_AUTH_FAILED_PACKET_SIZE 256
152#define MAX_ENCRYPTED_PACKET_SIZE 65536
153
155
160
163#define HEX_STRING_SIZE_32 (32 * 2 + 1)
166#define HEX_STRING_SIZE_64 (64 * 2 + 1)
168#define PASSWORD_BUFFER_SIZE 256
170#define ZERO_KEY_SIZE X25519_KEY_SIZE
171
173
175#define ED25519_SEED_SIZE 32
177#define GPG_FINGERPRINT_SIZE 20
178#define GPG_FINGERPRINT_HEX_BUFFER_SIZE (GPG_FINGERPRINT_SIZE * 2 + 1)
179#define GPG_KEY_ID_SIZE 8
180#define GPG_KEY_ID_HEX_BUFFER_SIZE (GPG_KEY_ID_SIZE * 2 + 1)
182#define MAX_COMMENT_LEN 256
183#define MAX_GPG_KEYGRIP_LEN 64
184
185#ifdef __cplusplus
186}
187#endif
Application limits and constraints.