some system-specific adjustments for RNG routines

move some system-specific seed-related stuff from hacklib.c to
a system-specific source file and #define SYS_RANDOM_SEED to
utilize it during build.

Windows changes for random seed generation using
crypto next gen (CNG) api routines.

Corresponding vms changes due to disentangling of VMS and
unix when the unix seed bits got moved (untested).
This commit is contained in:
nhmall
2019-01-13 20:54:11 -05:00
committed by Patric Mueller
parent f9433b2a87
commit 6c114640f5
11 changed files with 161 additions and 58 deletions

View File

@@ -8,37 +8,46 @@
#define INTEGER_H
#if defined(__STDC__) && __STDC_VERSION__ >= 199101L
/* The compiler claims to conform to C99. Use stdint.h */
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
#else
# if defined(HAS_STDINT_H)
/* Some compilers have stdint.h but don't conform to all of C99. */
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
# endif
#endif
#ifndef SKIP_STDINT_WORKAROUND /* !C99 */
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
#if defined(__WATCOMC__) && !defined(__386__)
/* Open Watcom providing a 16 bit build for MS-DOS or OS/2 */
/* int is 16 bits; use long for 32 bits */
typedef long int32_t;
typedef unsigned long uint32_t;
#else
/* Otherwise, assume either a 32- or 64-bit compiler */
/* long may be 64 bits; use int for 32 bits */
typedef int int32_t;
typedef unsigned int uint32_t;
#endif
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif /* !C99 */
/* Provide uint8, int16, uint16, int32, uint32, int64 and uint64 */
typedef uint8_t uint8;
typedef int16_t int16;
typedef uint16_t uint16;
typedef int32_t int32;
typedef uint32_t uint32;
#else /* !C99 */
/* Provide uint8, int16, uint16, int32 and uint32 */
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
#if defined(__WATCOMC__) && !defined(__386__)
/* Open Watcom providing a 16 bit build for MS-DOS or OS/2 */
/* int is 16 bits; use long for 32 bits */
typedef long int32;
typedef unsigned long uint32;
#else
/* Otherwise, assume either a 32- or 64-bit compiler */
/* long may be 64 bits; use int for 32 bits */
typedef int int32;
typedef unsigned int uint32;
#endif
typedef unsigned long uint32_t;
typedef unsigned long long uint64_t;
#endif /* !C99 */
typedef int64_t int64;
typedef uint64_t uint64;
#endif /* INTEGER_H */