dcrypt_algorithms/ec/p192/constants.rs
1//! Shared constants and helper functions for P-192 operations
2
3/// Size of a P-192 scalar in bytes (24 bytes = 192 bits)
4pub const P192_SCALAR_SIZE: usize = 24;
5
6/// Size of a P-192 field element in bytes (24 bytes = 192 bits)
7pub const P192_FIELD_ELEMENT_SIZE: usize = 24;
8
9/// Size of an uncompressed P-192 point in bytes:
10/// format byte (0x04) + x-coordinate + y-coordinate
11pub const P192_POINT_UNCOMPRESSED_SIZE: usize = 1 + 2 * P192_FIELD_ELEMENT_SIZE; // 49 bytes
12
13/// Size of a compressed P-192 point in bytes:
14/// format byte (0x02/0x03) + x-coordinate
15pub const P192_POINT_COMPRESSED_SIZE: usize = 1 + P192_FIELD_ELEMENT_SIZE; // 25 bytes
16
17/// Size of the KDF output for P-192 ECDH‐KEM shared secret derivation
18pub const P192_KEM_SHARED_SECRET_KDF_OUTPUT_SIZE: usize = 32;