From 154874afda4a8df885e51c01f7681f04fb0b8e61 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 9 Apr 2022 09:43:53 +0200 Subject: neue Verzeichnisstruktur --- random.h | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 random.h (limited to 'random.h') diff --git a/random.h b/random.h deleted file mode 100644 index 9094d5b..0000000 --- a/random.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef ITS1_RANDOM_H_INCLUDED -#define ITS1_RANDOM_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -struct random_ctx { - unsigned char (*get_byte)(struct random_ctx *ctx); -}; - -static unsigned char -random_get_byte(struct random_ctx *ctx) -{ - return ctx->get_byte(ctx); -} - -static unsigned short -random_get_word(struct random_ctx *ctx) -{ - return (ctx->get_byte(ctx) << 8) - | ctx->get_byte(ctx) - ; -} - -static unsigned long -random_get_dword(struct random_ctx *ctx) -{ - return (ctx->get_byte(ctx) << 24) - | (ctx->get_byte(ctx) << 16) - | (ctx->get_byte(ctx) << 8) - | ctx->get_byte(ctx) - ; -} - -static unsigned long -random_get_dword_range(struct random_ctx *ctx, unsigned long l, unsigned long u) -{ - return l + random_get_dword(ctx) % (u - l + 1); -} - -#ifdef __cplusplus -} -#endif - -#endif /* ITS1_RANDOM_H_INCLUDED */ - -- cgit v1.3