Data Types for use in Hardened Code. More...
Go to the source code of this file.
Typedefs | |
typedef enum hardened_bool | hardened_bool_t |
This is a boolean type for use in hardened contexts. More... | |
Enumerations | |
enum | hardened_bool { kHardenedBoolTrue = HARDENED_BOOL_TRUE, kHardenedBoolFalse = HARDENED_BOOL_FALSE, kHardenedBoolTrue = 0x739, kHardenedBoolFalse = 0x1d4 } |
This is a boolean type for use in hardened contexts. More... | |
Data Types for use in Hardened Code.
Definition in file hardened.h.
typedef enum hardened_bool hardened_bool_t |
This is a boolean type for use in hardened contexts.
The intention is that this is used instead of <stdbool.h>
's #bool, where a higher hamming distance is required between the truthy and the falsey value.
The values below were chosen at random, with some specific restrictions. They have a Hamming Distance of 8, and they are 11-bit values so they can be materialized with a single instruction on RISC-V. They are also specifically not the complement of each other.
enum hardened_bool |
This is a boolean type for use in hardened contexts.
The intention is that this is used instead of <stdbool.h>
's #bool, where a higher hamming distance is required between the truthy and the falsey value.
The values below were chosen at random, with some specific restrictions. They have a Hamming Distance of 8, and they are 11-bit values so they can be materialized with a single instruction on RISC-V. They are also specifically not the complement of each other.
Definition at line 28 of file hardened.h.