CVS log for src/lib/libc/gen/arc4random.c
Up to [cvs.NetBSD.org] / src / lib / libc / gen
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Revision 1.33.2.1: download - view: text, markup, annotated - select for diffs
Wed Oct 9 13:25:10 2024 UTC (3 months, 1 week ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-1-RELEASE
Diff to: previous 1.33: preferred, colored; next MAIN 1.34: preferred, colored
Changes since revision 1.33: +80 -23
lines
Pull up following revision(s) (requested by riastradh in ticket #939):
distrib/sets/lists/debug/module.md.amd64: revision 1.18
sys/modules/Makefile: revision 1.292
lib/libc/gen/arc4random.c: revision 1.34
lib/libc/gen/arc4random.c: revision 1.35
lib/libc/gen/arc4random.c: revision 1.36
lib/libc/gen/arc4random.c: revision 1.37
sys/kern/kern_entropy.c: revision 1.70
lib/libc/gen/arc4random.c: revision 1.38
sys/kern/kern_entropy.c: revision 1.71
lib/libc/gen/getentropy.3: revision 1.8
distrib/sets/lists/modules/md.amd64: revision 1.103
share/man/man4/rnd.4: revision 1.42
share/man/man4/rnd.4: revision 1.44
lib/libc/include/arc4random.h: revision 1.1
distrib/sets/lists/man/mi: revision 1.1786
sys/arch/i386/conf/GENERIC: revision 1.1258
sys/modules/acpivmgenid/acpivmgenid.ioconf: revision 1.1
sys/arch/amd64/conf/ALL: revision 1.190
distrib/sets/lists/debug/mi: revision 1.446
sys/arch/i386/conf/ALL: revision 1.521
lib/libc/gen/Makefile.inc: revision 1.219
distrib/sets/lists/debug/module.md.i386: revision 1.12
sys/dev/acpi/acpi_vmgenid.c: revision 1.1
sys/dev/acpi/acpi_vmgenid.c: revision 1.2
lib/libc/include/reentrant.h: revision 1.22
sys/arch/evbarm/conf/GENERIC64: revision 1.219
share/man/man4/Makefile: revision 1.735
distrib/sets/lists/modules/md.i386: revision 1.100
distrib/sets/lists/tests/mi: revision 1.1334
lib/libc/gen/arc4random.3: revision 1.22
sys/dev/acpi/files.acpi: revision 1.133
lib/libc/gen/arc4random.3: revision 1.23
tests/lib/libc/gen/t_arc4random.c: revision 1.1
sys/sys/entropy.h: revision 1.6
sys/arch/amd64/conf/GENERIC: revision 1.614
sys/modules/acpivmgenid/Makefile: revision 1.1
share/man/man4/acpivmgenid.4: revision 1.1
lib/libc/gen/Makefile.inc: revision 1.220
tests/lib/libc/gen/Makefile: revision 1.56
share/man/man4/acpivmgenid.4: revision 1.2
share/man/man4/acpivmgenid.4: revision 1.3
(all via patch)
Catch up with all the lint warnings since exit on warning was disabled.
Disable 'missing header declaration' and 'nested extern' warnings for now.
acpivmgenid(4): New driver for virtual machine generation ID.
Added to amd64/ALL and i386/ALL kernel configurations, and made
available as a loadable module acpivmgenid.kmod on x86, for now.
TBD: Add to all ACPI-supporting GENERIC kernels.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
entropy(9): Factor out subroutines to reset and gather entropy.
`Reset' means we keep the data in the pool, but assume it had zero
entropy. `Gather' means we request samples from all on-demand
sources and wait for the synchronous ones to complete.
No functional change intended, other than to expose new symbols --
just preparation to expose these to acpivmgenid(4), so it can use
these when the VM host notifies us that we, the guest, have been
cloned.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
acpivmgenid(4): Reset and gather entropy on VM clone notification.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
arc4random(3): Reseed if system entropy epoch changes.
This can happen, for example, if the system is a VM instance, and the
VM is cloned.
This incurs the cost of a system call on every arc4random call, which
is unfortunate, but
1. we don't currently have a (machine-independent) mechanism for
exposing a read-only page to userland shared by the kernel to
enable a cheaper access path to the entropy epoch; and
2. the algorithm here -- a simple application of ChaCha -- is likely
also a bottleneck and could be much cheaper by
(a) using sys/crypto/chacha for machine-dependent vectorized
ChaCha code, and
(b) filling a buffer (somewhere between a cipher block and a page)
in a batch at a time, instead of running ChaCha to generate
only 32 bytes at a time.
So although this might be a performance hit, the security benefit is
worthwhile and we have a clear path to do better than reversing the
performance hit later.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
acpivmgenid(4): Nix BUGS that have been squashed.
Reference kern.entropy.epoch for the remaining bug (which is a
performance issue, not a security issue).
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
entropy(9): Allow unprivileged reads of sysctl kern.entropy.epoch.
Applications need this in order to know when to reseed. (We should
also expose it through a page shared read-only with userland for
cheaper access, but until we do, let's let applications get at it
through sysctl.)
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
arc4random.c: Fix test program.
This isn't wired up anywhere, but let's reduce the bitrot. It was
helpful in reminding me that kern.entropy.epoch was, for reasons I
can't remember, restricted to privileged access.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
amd64, evbarm, i386: Add acpivmgenid(4) to GENERIC.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
rnd(4): Document kern.entropy.epoch is unprivileged and elaborate.
Cross-reference acpivmgenid(4).
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
arc4random(3): Note that arc4random respects kern.entropy.epoch.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Add debug info for new acpivmgenid module
arc4random(3): Add automatic tests.
This verifies that:
- arc4random zeroes its state and reseeds itself on fork
- arc4random reseeds itself on entropy consolidation (e.g., VM clone)
- arc4random falls back to global state if it can't allocate local
state because address space limits cause mmap to fail
NOTE: This adds a new libc symbol __arc4random_global, but it's in
the reserved namespace and only used by t_arc4random, so no libc
minor bump.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
getentropy(3): Note intent to reseed on VM clone, and caveats.
Tidy markup and pacify some mandoc -Tlint complaints while here.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Bump dates on man pages recently updated to mention VM clones.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
arc4random(3): Pacify some of lint's complaints.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
arc4random: suppress another lint warning
Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu Aug 29 13:39:42 2024 UTC (4 months, 3 weeks ago) by riastradh
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -7
lines
arc4random(3): Pacify some of lint's complaints.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Revision 1.37: download - view: text, markup, annotated - select for diffs
Tue Aug 27 13:43:02 2024 UTC (4 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +7 -18
lines
arc4random(3): Add automatic tests.
This verifies that:
- arc4random zeroes its state and reseeds itself on fork
- arc4random reseeds itself on entropy consolidation (e.g., VM clone)
- arc4random falls back to global state if it can't allocate local
state because address space limits cause mmap to fail
NOTE: This adds a new libc symbol __arc4random_global, but it's in
the reserved namespace and only used by t_arc4random, so no libc
minor bump.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Aug 26 15:50:26 2024 UTC (4 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +14 -4
lines
arc4random.c: Fix test program.
This isn't wired up anywhere, but let's reduce the bitrot. It was
helpful in reminding me that kern.entropy.epoch was, for reasons I
can't remember, restricted to privileged access.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon Aug 26 15:19:22 2024 UTC (4 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +63 -5
lines
arc4random(3): Reseed if system entropy epoch changes.
This can happen, for example, if the system is a VM instance, and the
VM is cloned.
This incurs the cost of a system call on every arc4random call, which
is unfortunate, but
1. we don't currently have a (machine-independent) mechanism for
exposing a read-only page to userland shared by the kernel to
enable a cheaper access path to the entropy epoch; and
2. the algorithm here -- a simple application of ChaCha -- is likely
also a bottleneck and could be much cheaper by
(a) using sys/crypto/chacha for machine-dependent vectorized
ChaCha code, and
(b) filling a buffer (somewhere between a cipher block and a page)
in a batch at a time, instead of running ChaCha to generate
only 32 bytes at a time.
So although this might be a performance hit, the security benefit is
worthwhile and we have a clear path to do better than reversing the
performance hit later.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat Jan 20 14:52:47 2024 UTC (12 months ago) by christos
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630,
perseant-exfatfs-base,
perseant-exfatfs
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -3
lines
Catch up with all the lint warnings since exit on warning was disabled.
Disable 'missing header declaration' and 'nested extern' warnings for now.
Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Apr 19 20:32:15 2022 UTC (2 years, 9 months ago) by rillig
Branches: MAIN
CVS tags: netbsd-10-base,
netbsd-10-0-RELEASE,
netbsd-10-0-RC6,
netbsd-10-0-RC5,
netbsd-10-0-RC4,
netbsd-10-0-RC3,
netbsd-10-0-RC2,
netbsd-10-0-RC1
Branch point for: netbsd-10
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -3
lines
lib: remove CONSTCOND comment
Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
Revision 1.31.16.1: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:03:09 2020 UTC (4 years, 9 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.31: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31: +6 -5
lines
Mostly merge changes from HEAD upto 20200411
Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Sep 23 18:17:03 2019 UTC (5 years, 4 months ago) by christos
Branches: MAIN
CVS tags: phil-wifi-20200421,
phil-wifi-20200411,
phil-wifi-20200406,
phil-wifi-20191119,
is-mlppp-base,
is-mlppp,
cjep_sun2x-base1,
cjep_sun2x-base,
cjep_sun2x,
cjep_staticlib_x-base1,
cjep_staticlib_x-base,
cjep_staticlib_x
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +6 -5
lines
lint is not smart enough to figure out that ilog2() is constant.
Revision 1.31: download - view: text, markup, annotated - select for diffs
Fri Mar 25 22:13:23 2016 UTC (8 years, 9 months ago) by riastradh
Branches: MAIN
CVS tags: prg-localcount2-base3,
prg-localcount2-base2,
prg-localcount2-base1,
prg-localcount2-base,
prg-localcount2,
phil-wifi-base,
phil-wifi-20190609,
pgoyette-localcount-base,
pgoyette-localcount-20170426,
pgoyette-localcount-20170320,
pgoyette-localcount-20170107,
pgoyette-localcount-20161104,
pgoyette-localcount-20160806,
pgoyette-localcount-20160726,
pgoyette-localcount,
pgoyette-compat-merge-20190127,
pgoyette-compat-base,
pgoyette-compat-20190127,
pgoyette-compat-20190118,
pgoyette-compat-1226,
pgoyette-compat-1126,
pgoyette-compat-1020,
pgoyette-compat-0930,
pgoyette-compat-0906,
pgoyette-compat-0728,
pgoyette-compat-0625,
pgoyette-compat-0521,
pgoyette-compat-0502,
pgoyette-compat-0422,
pgoyette-compat-0415,
pgoyette-compat-0407,
pgoyette-compat-0330,
pgoyette-compat-0322,
pgoyette-compat-0315,
pgoyette-compat,
perseant-stdc-iso10646-base,
perseant-stdc-iso10646,
netbsd-9-base,
netbsd-9-4-RELEASE,
netbsd-9-3-RELEASE,
netbsd-9-2-RELEASE,
netbsd-9-1-RELEASE,
netbsd-9-0-RELEASE,
netbsd-9-0-RC2,
netbsd-9-0-RC1,
netbsd-9,
netbsd-8-base,
netbsd-8-3-RELEASE,
netbsd-8-2-RELEASE,
netbsd-8-1-RELEASE,
netbsd-8-1-RC1,
netbsd-8-0-RELEASE,
netbsd-8-0-RC2,
netbsd-8-0-RC1,
netbsd-8,
matt-nb8-mediatek-base,
matt-nb8-mediatek,
localcount-20160914,
bouyer-socketcan-base1,
bouyer-socketcan-base,
bouyer-socketcan
Branch point for: phil-wifi
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +6 -4
lines
KNF
Revision 1.30: download - view: text, markup, annotated - select for diffs
Wed May 13 23:15:57 2015 UTC (9 years, 8 months ago) by justin
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3
lines
Missing MAP_PRIVATE on mmap
Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Mar 19 05:46:25 2015 UTC (9 years, 10 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -8
lines
Remove #ifdef MAP_INHERIT_ZERO.
This is essential for fork-safety, so don't merely #warn about it.
Attaining fork-safety without it requires restructuring things -- in
particular, there's no clear way to make it per-thread and fork-safe
without some global list of states to zero on fork.
Revision 1.25.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 18 07:50:01 2015 UTC (9 years, 10 months ago) by snj
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116,
netbsd-7-nhusb-base,
netbsd-7-nhusb,
netbsd-7-2-RELEASE,
netbsd-7-1-RELEASE,
netbsd-7-1-RC2,
netbsd-7-1-RC1,
netbsd-7-1-2-RELEASE,
netbsd-7-1-1-RELEASE,
netbsd-7-1,
netbsd-7-0-RELEASE,
netbsd-7-0-RC3,
netbsd-7-0-RC2,
netbsd-7-0-RC1,
netbsd-7-0-2-RELEASE,
netbsd-7-0-1-RELEASE,
netbsd-7-0
Diff to: previous 1.25: preferred, colored; next MAIN 1.26: preferred, colored
Changes since revision 1.25: +673 -222
lines
Pull up following revision(s) (requested by riastradh in ticket #597):
lib/libc/gen/arc4random.c: revisions 1.26-1.28
lib/libc/gen/arc4random.3:: revisions 1.10-1.19
Rewrite arc4random(3) with ChaCha20-based PRNG and per-thread state.
Explain the security model in the man page.
No more RC4!
--
Grammar.
--
Note relation of arc4random(3) to rand(3)/random(3).
--
Ruminate on security model choices and API design in arc4random(3).
--
Amplify comment about how quickly RC4 was known to be bad.
--
Markup for BUGS note about arc4random_uniform.
--
Cross-reference rnd(4).
--
Remove unnecessary Ns before punctuation. Fix a line.
--
Fix Google Groups link.
--
Tweak wording, define `output', remove misplaced scaremongering.
--
Fix non _REENTRANT build.
--
Use ChaCha20 here as advertised, not ChaCha8.
Oops.
Fortunately, there is no public cryptanalysis even of ChaCha8: the
best published attack is on ChaCha7 with time complexity 2^248.
Revision 1.28: download - view: text, markup, annotated - select for diffs
Wed Jan 21 02:47:39 2015 UTC (10 years ago) by riastradh
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3
lines
Use ChaCha20 here as advertised, not ChaCha8.
Oops.
Fortunately, there is no public cryptanalysis even of ChaCha8: the
best published attack is on ChaCha7 with time complexity 2^248.
Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue Jan 20 18:31:25 2015 UTC (10 years ago) by christos
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +7 -12
lines
Fix non _REENTRANT build.
Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Nov 16 20:33:04 2014 UTC (10 years, 2 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +678 -222
lines
Rewrite arc4random(3) with ChaCha20-based PRNG and per-thread state.
Explain the security model in the man page.
No more RC4!
XXX pullup to netbsd-6, netbsd-5
Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:02:14 2014 UTC (10 years, 5 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20: +82 -27
lines
Rebase to HEAD as of a few days ago.
Revision 1.21.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:51:50 2014 UTC (10 years, 5 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21: +81 -26
lines
Rebase.
Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Jul 19 14:53:22 2014 UTC (10 years, 6 months ago) by roy
Branches: MAIN
CVS tags: tls-maxphys-base,
tls-earlyentropy-base,
netbsd-7-base
Branch point for: netbsd-7
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +8 -2
lines
Document that our use of pthread_mutex_unlock(3) is async-signal-safe
and as such can be used in a phtread_atfork(3) child handler.
Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Jun 12 19:12:19 2014 UTC (10 years, 7 months ago) by apb
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +3 -3
lines
fix missing backslash in previous
Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Jun 12 19:05:37 2014 UTC (10 years, 7 months ago) by apb
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +12 -6
lines
Wrap complex macros in do { ... } while (0). Also replace the magic
number 1600000 with a macro.
Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Jun 7 20:55:47 2014 UTC (10 years, 7 months ago) by roy
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +69 -26
lines
Re-stir after forking, fixes PR lib/25367.
Re-stir after consuming 1600000 bytes, fixes PR lib/45952.
Revision 1.10.4.3: download - view: text, markup, annotated - select for diffs
Thu May 22 11:36:52 2014 UTC (10 years, 8 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.10.4.2: preferred, colored; branchpoint 1.10: preferred, colored; next MAIN 1.11: preferred, colored
Changes since revision 1.10.4.2: +3 -3
lines
sync with head.
for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Oct 17 23:56:17 2013 UTC (11 years, 3 months ago) by christos
Branches: MAIN
CVS tags: yamt-pagecache-base9,
riastradh-xf86-video-intel-2-7-1-pre-2-21-15,
riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -3
lines
remove always inline because new gcc bitches.
Revision 1.10.4.2: download - view: text, markup, annotated - select for diffs
Tue Oct 30 18:58:44 2012 UTC (12 years, 2 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.10.4.1: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.1: +99 -142
lines
sync with head
Revision 1.20: download - view: text, markup, annotated - select for diffs
Mon Aug 20 21:38:09 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
CVS tags: yamt-pagecache-base8,
yamt-pagecache-base7,
yamt-pagecache-base6,
riastradh-drm2-base2,
riastradh-drm2-base1,
riastradh-drm2-base,
riastradh-drm2,
agc-symver-base,
agc-symver
Branch point for: tls-maxphys
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +6 -2
lines
I'm fairly sure the libc rules require that arc4random_addrandom,
arc4random_buf, arc4random_stir and arc4random_uniform be weak.
Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Aug 20 20:32:09 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +2 -10
lines
arc4 is a random number sequence, there is no point using its own
output values to determine a number of output values to skip.
Skipping values on any possibly random event might be worth while, as
might using the keying algorithm to stir in a possibly random value.
Revision 1.18: download - view: text, markup, annotated - select for diffs
Mon Aug 20 20:27:46 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +30 -33
lines
Since 'rs' is statically initialised (not bss) its s[] might as well be
compile-time initialised as well.
arc4_init) is the same as arc4_stir().
Initialise rs.i to 0xff (not 0) so that the first key byte is processed
with rs.i == 0 without the splurios rs.i-- in arc4_addrandom().
Remove the assignment rs.j = rs.i at the end of arc4_addrandom(), it isn't
necessary and I can see no justificationm for it.
Replace RSIZE with __arraycount(as->s), however it is manifestly 256 (more
correctly the number of values in rs.i and rs.j).
Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat Aug 18 15:55:07 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +27 -13
lines
cache rs.i and rs.j in arc4random_buf() since the compiler can't be
told that buf[] dosn't alias them.
Reduces the number of instructions inside the loop.
All the other functions are ok.
Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Aug 18 15:04:53 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +47 -98
lines
Change the logic used for thread locking to make the code more readable.
The effect on the object code is to replace a function call with a
branch that will predict correctly in the non-threaded case.
Minor optimise of some other paths.
Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Aug 18 14:42:46 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +18 -20
lines
Use an inline function to check for initialisation, and an non-inlined
one to do the actual initialise.
Fixes lib/46751 by removing all the replicated tests in each function.
Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Jul 29 14:44:13 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +10 -7
lines
Make this compile with the compiler I'm using.
Move variable defs to top of function.
Don't use const static mib[] - run time initialisation won't matter,
and not using static data may actually help in a .so.
Revision 1.10.4.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:05:18 2012 UTC (12 years, 9 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +128 -81
lines
sync with head
Revision 1.10.6.1: download - view: text, markup, annotated - select for diffs
Thu Mar 8 17:23:35 2012 UTC (12 years, 10 months ago) by riz
Branches: netbsd-6
CVS tags: netbsd-6-1-RELEASE,
netbsd-6-1-RC4,
netbsd-6-1-RC3,
netbsd-6-1-RC2,
netbsd-6-1-RC1,
netbsd-6-1-5-RELEASE,
netbsd-6-1-4-RELEASE,
netbsd-6-1-3-RELEASE,
netbsd-6-1-2-RELEASE,
netbsd-6-1-1-RELEASE,
netbsd-6-1,
netbsd-6-0-RELEASE,
netbsd-6-0-RC2,
netbsd-6-0-RC1,
netbsd-6-0-6-RELEASE,
netbsd-6-0-5-RELEASE,
netbsd-6-0-4-RELEASE,
netbsd-6-0-3-RELEASE,
netbsd-6-0-2-RELEASE,
netbsd-6-0-1-RELEASE,
netbsd-6-0,
matt-nb6-plus-nbase,
matt-nb6-plus-base,
matt-nb6-plus
Diff to: previous 1.10: preferred, colored; next MAIN 1.11: preferred, colored
Changes since revision 1.10: +124 -70
lines
Pull up following revision(s) (requested by tls in ticket #92):
lib/libc/gen/arc4random.c: revision 1.11
lib/libc/gen/arc4random.c: revision 1.12
Make arc4random far less greedy for entropy. Make arc4random actually
implement arc4 when used by threaded programs.
Fix bug in previous: don't reinitialize on every call! Fix arc4random_buf so it actually ever initializes -- a security problem with revisions 1.9 and 1.10.
Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Mar 5 19:40:08 2012 UTC (12 years, 10 months ago) by christos
Branches: MAIN
CVS tags: yamt-pagecache-base5,
yamt-pagecache-base4
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +12 -19
lines
misc cleanups:
- const for mibs
- #define for magic constants
- casts
Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Mar 4 00:36:43 2012 UTC (12 years, 10 months ago) by tls
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +23 -13
lines
Fix bug in previous: don't reinitialize on every call! Fix arc4random_buf so it actually ever initializes -- a security problem with revisions 1.9 and 1.10.
Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Feb 27 04:25:12 2012 UTC (12 years, 10 months ago) by tls
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +110 -66
lines
Make arc4random far less greedy for entropy. Make arc4random actually
implement arc4 when used by threaded programs.
Revision 1.9.40.1: download - view: text, markup, annotated - select for diffs
Tue Feb 8 16:18:59 2011 UTC (13 years, 11 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.9: preferred, colored; next MAIN 1.10: preferred, colored
Changes since revision 1.9: +89 -30
lines
Sync with HEAD
Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Feb 4 22:07:07 2011 UTC (13 years, 11 months ago) by christos
Branches: MAIN
CVS tags: yamt-pagecache-base3,
yamt-pagecache-base2,
yamt-pagecache-base,
netbsd-6-base,
cherry-xenmp-base,
cherry-xenmp,
bouyer-quota2-nbase,
bouyer-quota2-base
Branch point for: yamt-pagecache,
netbsd-6
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +89 -30
lines
add arc4random_{buf,uniform}, from OpenBSD.
Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Dec 24 21:11:16 2005 UTC (19 years, 1 month ago) by perry
Branches: MAIN
CVS tags: yamt-pf42-baseX,
yamt-pf42-base4,
yamt-pf42-base3,
yamt-pf42-base2,
yamt-pf42-base,
yamt-pf42,
wrstuden-revivesa-base-3,
wrstuden-revivesa-base-2,
wrstuden-revivesa-base-1,
wrstuden-revivesa-base,
wrstuden-revivesa,
wrstuden-fixsa-newbase,
wrstuden-fixsa-base-1,
wrstuden-fixsa-base,
wrstuden-fixsa,
netbsd-5-base,
netbsd-5-2-RELEASE,
netbsd-5-2-RC1,
netbsd-5-2-3-RELEASE,
netbsd-5-2-2-RELEASE,
netbsd-5-2-1-RELEASE,
netbsd-5-2,
netbsd-5-1-RELEASE,
netbsd-5-1-RC4,
netbsd-5-1-RC3,
netbsd-5-1-RC2,
netbsd-5-1-RC1,
netbsd-5-1-5-RELEASE,
netbsd-5-1-4-RELEASE,
netbsd-5-1-3-RELEASE,
netbsd-5-1-2-RELEASE,
netbsd-5-1-1-RELEASE,
netbsd-5-1,
netbsd-5-0-RELEASE,
netbsd-5-0-RC4,
netbsd-5-0-RC3,
netbsd-5-0-RC2,
netbsd-5-0-RC1,
netbsd-5-0-2-RELEASE,
netbsd-5-0-1-RELEASE,
netbsd-5-0,
netbsd-5,
netbsd-4-base,
netbsd-4-0-RELEASE,
netbsd-4-0-RC5,
netbsd-4-0-RC4,
netbsd-4-0-RC3,
netbsd-4-0-RC2,
netbsd-4-0-RC1,
netbsd-4-0-1-RELEASE,
netbsd-4-0,
netbsd-4,
mjf-devfs2-base,
mjf-devfs2,
matt-premerge-20091211,
matt-nb5-pq3-base,
matt-nb5-pq3,
matt-nb5-mips64-u2-k2-k4-k7-k8-k9,
matt-nb5-mips64-u1-k1-k5,
matt-nb5-mips64-premerge-20101231,
matt-nb5-mips64-premerge-20091211,
matt-nb5-mips64-k15,
matt-nb5-mips64,
matt-nb4-mips64-k7-u2a-k9b,
matt-mips64-premerge-20101231,
matt-mips64-base2,
matt-mips64-base,
matt-mips64,
matt-armv6-prevmlocking,
matt-armv6-nbase,
matt-armv6-base,
matt-armv6,
keiichi-mipv6-base,
keiichi-mipv6,
jym-xensuspend-nbase,
jym-xensuspend-base,
jym-xensuspend,
hpcarm-cleanup-nbase,
hpcarm-cleanup-base,
hpcarm-cleanup,
cube-autoconf-base,
cube-autoconf,
christos-time_t-nbase,
christos-time_t-base,
christos-time_t,
abandoned-netbsd-4-base,
abandoned-netbsd-4
Branch point for: bouyer-quota2
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -8
lines
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Jun 12 05:21:27 2005 UTC (19 years, 7 months ago) by lukem
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +6 -1
lines
Add missing __RCSID()
Revision 1.7: download - view: text, markup, annotated - select for diffs
Wed Feb 9 21:35:46 2005 UTC (19 years, 11 months ago) by kleink
Branches: MAIN
CVS tags: netbsd-3-base,
netbsd-3-1-RELEASE,
netbsd-3-1-RC4,
netbsd-3-1-RC3,
netbsd-3-1-RC2,
netbsd-3-1-RC1,
netbsd-3-1-1-RELEASE,
netbsd-3-1,
netbsd-3-0-RELEASE,
netbsd-3-0-RC6,
netbsd-3-0-RC5,
netbsd-3-0-RC4,
netbsd-3-0-RC3,
netbsd-3-0-RC2,
netbsd-3-0-RC1,
netbsd-3-0-3-RELEASE,
netbsd-3-0-2-RELEASE,
netbsd-3-0-1-RELEASE,
netbsd-3-0,
netbsd-3
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +6 -1
lines
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Feb 9 12:09:08 2005 UTC (19 years, 11 months ago) by kleink
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +2 -2
lines
Declare rs_initialized static.
Revision 1.5.2.2: download - view: text, markup, annotated - select for diffs
Fri Mar 26 22:52:50 2004 UTC (20 years, 10 months ago) by jmc
Branches: netbsd-1-6
CVS tags: netbsd-1-6-base
Diff to: previous 1.5.2.1: preferred, colored; branchpoint 1.5: preferred, colored; next MAIN 1.6: preferred, colored
Changes since revision 1.5.2.1: +213 -0
lines
Pullup rev 1.1-1.5 (requested by provos in ticket #1386)
Introduce bcrypt password scheme. Adds the arc4random API for creating
cryptographically strong random numbers.
Revision 1.3.2.4: download - view: text, markup, annotated - select for diffs
Mon Nov 11 22:22:01 2002 UTC (22 years, 2 months ago) by nathanw
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.3.2.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.3: +4 -3
lines
Catch up to -current
Revision 1.5.2.1
Mon Nov 11 01:13:07 2002 UTC (22 years, 2 months ago) by jmc
Branches: netbsd-1-6
FILE REMOVED
Changes since revision 1.5: +0 -213
lines
file arc4random.c was added on branch netbsd-1-6 on 2004-03-26 22:52:50 +0000
Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Nov 11 01:13:07 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
CVS tags: netbsd-2-base,
netbsd-2-1-RELEASE,
netbsd-2-1-RC6,
netbsd-2-1-RC5,
netbsd-2-1-RC4,
netbsd-2-1-RC3,
netbsd-2-1-RC2,
netbsd-2-1-RC1,
netbsd-2-1,
netbsd-2-0-base,
netbsd-2-0-RELEASE,
netbsd-2-0-RC5,
netbsd-2-0-RC4,
netbsd-2-0-RC3,
netbsd-2-0-RC2,
netbsd-2-0-RC1,
netbsd-2-0-3-RELEASE,
netbsd-2-0-2-RELEASE,
netbsd-2-0-1-RELEASE,
netbsd-2-0,
netbsd-2,
nathanw_sa_before_merge,
nathanw_sa_base,
fvdl_fs64_base
Branch point for: netbsd-1-6
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +4 -3
lines
Fix signed/unsigned comparison warnings.
Revision 1.3.2.3: download - view: text, markup, annotated - select for diffs
Thu Aug 1 03:28:09 2002 UTC (22 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.3.2.2: preferred, colored
Changes since revision 1.3.2.2: +3 -3
lines
Catch up to -current.
Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Jul 2 17:10:19 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -3
lines
use sysctl(kern.urandom) if /dev/urandom is not present (like chroot jail)
Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Fri Jun 21 18:18:07 2002 UTC (22 years, 7 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.3.2.1: preferred, colored
Changes since revision 1.3.2.1: +212 -0
lines
Catch up to -current.
Revision 1.3.2.1
Fri Jun 14 03:11:24 2002 UTC (22 years, 7 months ago) by nathanw
Branches: nathanw_sa
FILE REMOVED
Changes since revision 1.3: +0 -212
lines
file arc4random.c was added on branch nathanw_sa on 2002-06-21 18:18:07 +0000
Revision 1.3: download - view: text, markup, annotated - select for diffs
Fri Jun 14 03:11:24 2002 UTC (22 years, 7 months ago) by itojun
Branches: MAIN
Branch point for: nathanw_sa
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +10 -1
lines
discard first 256 words when we stir.
Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri May 24 04:53:07 2002 UTC (22 years, 8 months ago) by itojun
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -2
lines
/dev/arandom does not exist in netbsd. use /dev/urandom.
Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri May 24 04:01:44 2002 UTC (22 years, 8 months ago) by itojun
Branches: MAIN
add arc4random(3). from openbsd
CVSweb <webmaster@jp.NetBSD.org>