assh/safe_primes.h header reference
Header inclusion
Members
Type
- struct assh_safeprimes_s
Functions
- void assh_safeprime_get(const assh_safeprimes_s *desc, size_t bits, uint8_t *bignum, intptr_t *offset)
- void assh_safeprime_lfsr(uint8_t *data, size_t len, uint32_t poly, uint32_t seed)
Constant
- const assh_safeprimes_s assh_safeprimes
Members detail
const assh_safeprimes_s assh_safeprimes
This constant is declared in assh/safe_primes.h source file, line 326.
void assh_safeprime_get(const assh_safeprimes_s *desc, size_t bits, uint8_t *bignum, intptr_t *offset)
This function is for internal use only.
This function is declared in assh/safe_primes.h source file, line 67.
This function generates a base value and offset suitable to generate a safe prime number of the requested bit size.
See also assh_safeprimes_s.
This function is for internal use only.
This function is declared in assh/safe_primes.h source file, line 54.
See also assh_safeprimes_s.
This struct is for internal use only.
This struct is declared in assh/safe_primes.h source file, line 44.
The output of assh_safeprime_lfsr with the most significant bit forced to 1, interpreted as a big number stored least significant byte first, serve as base value to forge a safe prime. A value from the assh_safeprime_offset array must be added to the base value in order to obtain a safe prime number. The array contains offsets for number bit sizes multiple of 8 between 1024 and 16384 bits.
The lfsr polynomial and base seed used to generate the base values are shared by at most 1024 numbers. This allows updating only a subset of the safe prime numbers. The seed used to generate a specific base value is obtained by xoring the base seed and the number bit size.