diff options
| author | hshoexer <> | 2004-11-02 17:23:26 +0000 |
|---|---|---|
| committer | hshoexer <> | 2004-11-02 17:23:26 +0000 |
| commit | eeb5f0564f943243ceb2c1aa42adae0e03ac32ba (patch) | |
| tree | b4305287decc3b25656615b6e2b056ac34ee026d /src/lib/libc | |
| parent | 3d26b52fa07481c5e5ea45aadb74ca49ad7d2ea1 (diff) | |
| download | openbsd-eeb5f0564f943243ceb2c1aa42adae0e03ac32ba.tar.gz openbsd-eeb5f0564f943243ceb2c1aa42adae0e03ac32ba.tar.bz2 openbsd-eeb5f0564f943243ceb2c1aa42adae0e03ac32ba.zip | |
ansi, indentation, etc.
ok markus@ krw@ cloder@ millert@
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/crypt/blowfish.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/lib/libc/crypt/blowfish.c b/src/lib/libc/crypt/blowfish.c index 12226b5215..c337df8a0a 100644 --- a/src/lib/libc/crypt/blowfish.c +++ b/src/lib/libc/crypt/blowfish.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: blowfish.c,v 1.17 2003/04/09 21:46:02 markus Exp $ */ | 1 | /* $OpenBSD: blowfish.c,v 1.18 2004/11/02 17:23:26 hshoexer Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Blowfish block cipher for OpenBSD | 3 | * Blowfish block cipher for OpenBSD |
| 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
| @@ -64,10 +64,7 @@ | |||
| 64 | #define BLFRND(s,p,i,j,n) (i ^= F(s,j) ^ (p)[n]) | 64 | #define BLFRND(s,p,i,j,n) (i ^= F(s,j) ^ (p)[n]) |
| 65 | 65 | ||
| 66 | void | 66 | void |
| 67 | Blowfish_encipher(c, xl, xr) | 67 | Blowfish_encipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) |
| 68 | blf_ctx *c; | ||
| 69 | u_int32_t *xl; | ||
| 70 | u_int32_t *xr; | ||
| 71 | { | 68 | { |
| 72 | u_int32_t Xl; | 69 | u_int32_t Xl; |
| 73 | u_int32_t Xr; | 70 | u_int32_t Xr; |
| @@ -92,10 +89,7 @@ Blowfish_encipher(c, xl, xr) | |||
| 92 | } | 89 | } |
| 93 | 90 | ||
| 94 | void | 91 | void |
| 95 | Blowfish_decipher(c, xl, xr) | 92 | Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) |
| 96 | blf_ctx *c; | ||
| 97 | u_int32_t *xl; | ||
| 98 | u_int32_t *xr; | ||
| 99 | { | 93 | { |
| 100 | u_int32_t Xl; | 94 | u_int32_t Xl; |
| 101 | u_int32_t Xr; | 95 | u_int32_t Xr; |
| @@ -120,14 +114,11 @@ Blowfish_decipher(c, xl, xr) | |||
| 120 | } | 114 | } |
| 121 | 115 | ||
| 122 | void | 116 | void |
| 123 | Blowfish_initstate(c) | 117 | Blowfish_initstate(blf_ctx *c) |
| 124 | blf_ctx *c; | ||
| 125 | { | 118 | { |
| 126 | 119 | /* P-box and S-box tables initialized with digits of Pi */ | |
| 127 | /* P-box and S-box tables initialized with digits of Pi */ | ||
| 128 | 120 | ||
| 129 | static const blf_ctx initstate = | 121 | static const blf_ctx initstate = |
| 130 | |||
| 131 | { { | 122 | { { |
| 132 | { | 123 | { |
| 133 | 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, | 124 | 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, |
| @@ -399,11 +390,11 @@ Blowfish_initstate(c) | |||
| 399 | } }; | 390 | } }; |
| 400 | 391 | ||
| 401 | *c = initstate; | 392 | *c = initstate; |
| 402 | |||
| 403 | } | 393 | } |
| 404 | 394 | ||
| 405 | u_int32_t | 395 | u_int32_t |
| 406 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, u_int16_t *current) | 396 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, |
| 397 | u_int16_t *current) | ||
| 407 | { | 398 | { |
| 408 | u_int8_t i; | 399 | u_int8_t i; |
| 409 | u_int16_t j; | 400 | u_int16_t j; |
| @@ -462,7 +453,7 @@ Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) | |||
| 462 | 453 | ||
| 463 | void | 454 | void |
| 464 | Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, | 455 | Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, |
| 465 | const u_int8_t *key, u_int16_t keybytes) | 456 | const u_int8_t *key, u_int16_t keybytes) |
| 466 | { | 457 | { |
| 467 | u_int16_t i; | 458 | u_int16_t i; |
| 468 | u_int16_t j; | 459 | u_int16_t j; |
