From 8c6d8449d8f9fed6f009f38878a80f17fcc778f2 Mon Sep 17 00:00:00 2001 From: Benedict Date: Sun, 31 Jul 2016 21:20:35 +0200 Subject: completed set 2 challenge 13 --- set2/Makefile | 8 ++++++-- set2/task11.c | 61 +++++++---------------------------------------------------- set2/task13.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 56 deletions(-) create mode 100644 set2/task13.c (limited to 'set2') diff --git a/set2/Makefile b/set2/Makefile index 9c5f43e..a2d66d4 100644 --- a/set2/Makefile +++ b/set2/Makefile @@ -3,7 +3,7 @@ CC=gcc CFLAGS := -g $(CFLAGS) CLIBS=`pkg-config --cflags --libs libcrypto` -all: task9 task10 task15 +all: task9 task10 task11 task12 task13 task15 task9: $(CC) $(CFLAGS) task9.c $(LIB) $(CLIBS) -o task9 @@ -11,7 +11,11 @@ task10: $(CC) $(CFLAGS) task10.c $(LIB) $(CLIBS) -o task10 task11: $(CC) $(CFLAGS) task11.c $(LIB) $(CLIBS) -o task11 +task12: + $(CC) $(CFLAGS) task12.c $(LIB) $(CLIBS) -o task12 +task13: + $(CC) $(CFLAGS) task13.c $(LIB) $(CLIBS) -o task13 task15: $(CC) $(CFLAGS) task15.c $(LIB) $(CLIBS) -o task15 clean: - rm task9 task10 task15 + rm task9 task10 task11 task12 task13 task15 diff --git a/set2/task11.c b/set2/task11.c index 60483e0..e344a60 100644 --- a/set2/task11.c +++ b/set2/task11.c @@ -1,83 +1,36 @@ #include "../lib/lib2.h" #include "../lib/lib.h" -int random_number_between(int min, int max) -{ - return (rand() % (max-min) + min); -} - - -int generate_random_bytes(char *buf, int length_key_bytes) -{ - int random_number; - int i; - for(i=0;i