List Archive

Thread

Thread Index

Message

From: Andreas Falkenhahn <andreas%falkenhahn.com@localhost>
To: libzip mailing list <libzip-discuss%nih.at@localhost>
Subject: Porting zip_random() to non-Unix platform
Date: Thu, 9 Nov 2017 16:11:22 +0100

I don't know anything about cryptography so I'm not sure if this is a
good idea:

    bool zip_random(zip_uint8_t *buffer, zip_uint16_t length)
    {
       srand(time(NULL));
        while(length--) *buffer++ = rand() % 256;
       return true;
    }

If this is not a good idea, does anybody have an idea on a
good way of porting zip_random() to a platform that only has
the ANSI C runtime plus a few POSIX functions?
 
-- 
Best regards,
 Andreas Falkenhahn                          
mailto:andreas%falkenhahn.com@localhost

Made by MHonArc.