• Damian Gryski's avatar
    runtime: add runtime.cputicks() and seed fastrand with it · 8e765da9
    Damian Gryski authored
    This patch adds a function to get the current cpu ticks.  This is
    deemed to be 'sufficiently random' to use to seed fastrand to mitigate
    the algorithmic complexity attacks on the hash table implementation.
    
    On AMD64 we use the RDTSC instruction.  For 386, this instruction,
    while valid, is not recognized by 8a so I've inserted the opcode by
    hand.  For ARM, this routine is currently stubbed to return a constant
    0 value.
    
    Future work: update 8a to recognize RDTSC.
    
    Fixes #2630.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/5606048
    8e765da9
Name
Last commit
Last update
..
buildscript Loading commit data...
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.ccmd Loading commit data...
Make.clib Loading commit data...
Make.cmd Loading commit data...
Make.common Loading commit data...
Make.ctool Loading commit data...
Make.inc Loading commit data...
all-qemu.bash Loading commit data...
all.bash Loading commit data...
buildinfo.sh Loading commit data...
buildscript.sh Loading commit data...
clean.bash Loading commit data...
env.bash Loading commit data...
make.bash Loading commit data...
quietgcc.bash Loading commit data...
run.bash Loading commit data...
sudo.bash Loading commit data...
version.bash Loading commit data...