ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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
12
17
19#define MIN_PASSWORD_LENGTH 8
21#define MAX_PASSWORD_LENGTH 256
22
24
29
31#define X25519_KEY_SIZE 32
33#define ED25519_PUBLIC_KEY_SIZE 32
35#define ED25519_PRIVATE_KEY_SIZE 64
37#define ED25519_SIGNATURE_SIZE 64
39#define XSALSA20_NONCE_SIZE 24
41#define POLY1305_MAC_SIZE 16
43#define HMAC_SHA256_SIZE 32
45#define HMAC_SHA256_KEY_SIZE 32
47#define ARGON2ID_SALT_SIZE 32
49#define SECRETBOX_KEY_SIZE 32
51#define AES256_KEY_SIZE 32
53#define AES_IV_SIZE 16
55#define AES256_DERIVED_SIZE (AES256_KEY_SIZE + AES_IV_SIZE)
56
58
65
67#define CRYPTO_PUBLIC_KEY_SIZE X25519_KEY_SIZE
69#define CRYPTO_PRIVATE_KEY_SIZE X25519_KEY_SIZE
71#define CRYPTO_SHARED_KEY_SIZE X25519_KEY_SIZE
73#define CRYPTO_ED25519_PUBLIC_KEY_SIZE ED25519_PUBLIC_KEY_SIZE
75#define CRYPTO_ED25519_PRIVATE_KEY_SIZE ED25519_PRIVATE_KEY_SIZE
77#define CRYPTO_ED25519_SIGNATURE_SIZE ED25519_SIGNATURE_SIZE
79#define CRYPTO_NONCE_SIZE XSALSA20_NONCE_SIZE
81#define CRYPTO_SALT_SIZE ARGON2ID_SALT_SIZE
83#define CRYPTO_ENCRYPTION_KEY_SIZE SECRETBOX_KEY_SIZE
85#define CRYPTO_MAC_SIZE POLY1305_MAC_SIZE
87#define CRYPTO_HMAC_SIZE HMAC_SHA256_SIZE
88
90
95
97#define AUTH_HMAC_SIZE 32
99#define AUTH_CHALLENGE_SIZE 32
101#define AUTH_COMBINED_SIZE (AUTH_HMAC_SIZE + AUTH_CHALLENGE_SIZE)
103#define AUTH_SIGNATURE_SIZE 64
105#define AUTH_SIGNATURE_COMBINED_SIZE (AUTH_SIGNATURE_SIZE + AUTH_CHALLENGE_SIZE)
106
108
113
115#define AUTH_CHALLENGE_FLAGS_SIZE 1
117#define AUTH_CHALLENGE_PACKET_SIZE (AUTH_CHALLENGE_FLAGS_SIZE + AUTH_CHALLENGE_SIZE)
118
120
125
127#define AUTH_RESPONSE_PASSWORD_SIZE (AUTH_HMAC_SIZE + AUTH_CHALLENGE_SIZE)
129#define AUTH_RESPONSE_SIGNATURE_SIZE (AUTH_SIGNATURE_SIZE + AUTH_CHALLENGE_SIZE)
130
132
134#define SERVER_AUTH_RESPONSE_SIZE AUTH_HMAC_SIZE
135
140
142#define MAX_AUTH_FAILED_PACKET_SIZE 256
144#define MAX_ENCRYPTED_PACKET_SIZE 65536
145
147
152
154#define HEX_STRING_SIZE_32 (32 * 2 + 1)
156#define HEX_STRING_SIZE_64 (64 * 2 + 1)
158#define PASSWORD_BUFFER_SIZE 256
160#define ZERO_KEY_SIZE X25519_KEY_SIZE
161
163
165#define ED25519_SEED_SIZE 32
167#define GPG_FINGERPRINT_SIZE 20
168#define GPG_FINGERPRINT_HEX_BUFFER_SIZE (GPG_FINGERPRINT_SIZE * 2 + 1)
169#define GPG_KEY_ID_SIZE 8
170#define GPG_KEY_ID_HEX_BUFFER_SIZE (GPG_KEY_ID_SIZE * 2 + 1)
172#define MAX_COMMENT_LEN 256
173#define MAX_GPG_KEYGRIP_LEN 64
Application limits and constraints.