#include "os.h" #include "libsec.h" extern s32 getpid(void); static void init(Chachastate *cs) { ulong seed[11]; int i; for(i=0; iinput[4], 32, &c); if(++cs->input[13] == 0) if(++cs->input[14] == 0) ++cs->input[15]; chacha_encrypt(p, n, &c); memset(&c, 0, sizeof(c)); } /*void genrandom(uchar *p, int n) { static QLock lk; static Chachastate cs; qlock(&lk); if(cs.rounds == 0) init(&cs); cs.input[4] ^= getpid(); *//* fork protection *//* fill(&cs, p, n); qunlock(&lk); }*/