diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-03-23 22:07:42 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-03-23 22:07:42 +0000 |
commit | 4fe12823a6c86e647cfd8ad32feedf50ad6f06bf (patch) | |
tree | 4a5e6cc6a464341731cfd3807f344d6e783cf349 /sys/uvm/uvm_swap_encrypt.c | |
parent | bfec2c4397630d66d4a7037c0f0e4ddbe16352b3 (diff) |
turn a for (i = 0; i < size; i++) arc4random(); loop into arc4random_buf().
Since that function is now so small (2 lines), inline it into it's only user.
Shaves some bytes (104 on amd64).
ok deraadt@, blambert@. djm@ liked an earlier diff.
Diffstat (limited to 'sys/uvm/uvm_swap_encrypt.c')
-rw-r--r-- | sys/uvm/uvm_swap_encrypt.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/sys/uvm/uvm_swap_encrypt.c b/sys/uvm/uvm_swap_encrypt.c index b3b22385680..66acf3880ae 100644 --- a/sys/uvm/uvm_swap_encrypt.c +++ b/sys/uvm/uvm_swap_encrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap_encrypt.c,v 1.14 2005/03/26 16:06:46 deraadt Exp $ */ +/* $OpenBSD: uvm_swap_encrypt.c,v 1.15 2009/03/23 22:07:41 oga Exp $ */ /* * Copyright 1999 Niels Provos <provos@citi.umich.edu> @@ -89,19 +89,6 @@ swap_encrypt_ctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, } void -swap_key_create(struct swap_key *key) -{ - int i; - u_int32_t *p = key->key; - - key->refcount = 0; - for (i = 0; i < sizeof(key->key) / sizeof(u_int32_t); i++) - *p++ = arc4random(); - - uvm_swpkeyscreated++; -} - -void swap_key_delete(struct swap_key *key) { /* Make sure that this key gets removed if we just used it */ |