Go to the source code of this file.
|
int | pot_util_init (void) |
|
void | pot_profile_list_init (u8 *name) |
|
pot_profile * | pot_profile_find (u8 id) |
|
static u16 | pot_profile_get_id (pot_profile *profile) |
|
int | pot_profile_create (pot_profile *profile, u64 prime, u64 poly2, u64 lpc, u64 secret_share) |
|
int | pot_set_validator (pot_profile *profile, u64 key) |
|
int | pot_profile_set_bit_mask (pot_profile *profile, u16 bits) |
|
u64 | pot_update_cumulative (pot_profile *profile, u64 cumulative, u64 random) |
|
u8 | pot_validate (pot_profile *profile, u64 cumulative, u64 random) |
|
u64 | pot_generate_random (pot_profile *profile) |
|
void | clear_pot_profiles () |
|
int | pot_profile_list_is_enabled (u8 *name) |
|
static u8 | pot_is_decap (pot_profile *p) |
|
static int | pot_profile_set_active (u8 id) |
|
static u8 | pot_profile_get_active_id (void) |
|
static pot_profile * | pot_profile_get_active (void) |
|
static void | pot_profile_reset_usage_stats (pot_profile *pow) |
|
static void | pot_profile_incr_usage_stats (pot_profile *pow) |
|
◆ debug_ioam
#define debug_ioam debug_ioam_fn |
◆ MAX_BITS
◆ MAX_POT_PROFILES
#define MAX_POT_PROFILES 2 |
◆ PATH_NAME_SIZE
#define PATH_NAME_SIZE 256 |
◆ pot_profile
Usage:
On any node that participates in Proof of Transit:
Step 1: Initialize this library by calling pot_init() Step 2: Setup a proof of transit profile that contains all the parameters needed to compute cumulative: Call these functions: pot_profile_find pot_profile_create pot_profile_set_bit_mask - To setup how large we want the numbers used in the computation and random number <= 64 bits Step 2a: For validator do this: pot_set_validator Step 2b: On initial node enable the profile to be used: pot_profile_set_active / pot_profile_get_active will return the profile Step 3a: At the initial node to generate Random number that will be read by all other nodes: pot_generate_random Step 3b: At all nodes including initial and verifier call this to compute cumulative: pot_update_cumulative Step 4: At the verifier: pot_validate
◆ clear_pot_profiles()
void clear_pot_profiles |
( |
| ) |
|
◆ pot_generate_random()
◆ pot_is_decap()
◆ pot_profile_create()
◆ pot_profile_find()
◆ pot_profile_get_active()
◆ pot_profile_get_active_id()
static u8 pot_profile_get_active_id |
( |
void |
| ) |
|
|
inlinestatic |
◆ pot_profile_get_id()
◆ pot_profile_incr_usage_stats()
static void pot_profile_incr_usage_stats |
( |
pot_profile * |
pow | ) |
|
|
inlinestatic |
◆ pot_profile_list_init()
void pot_profile_list_init |
( |
u8 * |
name | ) |
|
◆ pot_profile_list_is_enabled()
int pot_profile_list_is_enabled |
( |
u8 * |
name | ) |
|
◆ pot_profile_reset_usage_stats()
static void pot_profile_reset_usage_stats |
( |
pot_profile * |
pow | ) |
|
|
inlinestatic |
◆ pot_profile_set_active()
static int pot_profile_set_active |
( |
u8 |
id | ) |
|
|
inlinestatic |
◆ pot_profile_set_bit_mask()
◆ pot_set_validator()
◆ pot_update_cumulative()
◆ pot_util_init()
int pot_util_init |
( |
void |
| ) |
|
◆ pot_validate()
◆ pot_main