EvilZone

Programming and Scripting => C - C++ => : EpicOut November 24, 2014, 02:45:51 PM

: Vernam's implementation
: EpicOut November 24, 2014, 02:45:51 PM
Hi today i'm sharing  with you my vernam's implementation i made in C, i hope you will enjoy it, if you have any questions about the code or whatever related, feel free to ask, go on :-)


http://pastebin.com/iwLuetvU
: Re: Vernam's implementation
: immortalghost November 24, 2014, 02:55:08 PM
It looks cut off at the bottom
: Re: Vernam's implementation
: EpicOut November 24, 2014, 02:58:21 PM
it isn't :p
: Re: Vernam's implementation
: immortalghost November 24, 2014, 03:01:21 PM
it isn't :p
then you forgot to close main, or I'm missing something. Care to explain?
: Re: Vernam's implementation
: EpicOut November 24, 2014, 03:57:49 PM
Eaxtly i forgot to close my main but otherwise this is not cut off ^^
: Re: Vernam's implementation
: ArkPhaze December 20, 2014, 02:45:30 AM
Eaxtly i forgot to close my main but otherwise this is not cut off ^^

That doesn't make any sense. You've just proved that it is cut off. The source is not complete, and that's the fact. You missed a closing bracket -- it's cut off.

You shouldn't be seeding the rng from a function which sets the random values to a pre-allocated buffer like that. You've defeated the whole point of 'randomness' if you intend for this function to be called multiple times (and it looks like it *should* semantically be set up to do that).

In C you aren't required to cast the return from functions like malloc() which return void*.