summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt
diff options
context:
space:
mode:
authorhshoexer <>2004-11-02 17:23:26 +0000
committerhshoexer <>2004-11-02 17:23:26 +0000
commiteeb5f0564f943243ceb2c1aa42adae0e03ac32ba (patch)
treeb4305287decc3b25656615b6e2b056ac34ee026d /src/lib/libc/crypt
parent3d26b52fa07481c5e5ea45aadb74ca49ad7d2ea1 (diff)
downloadopenbsd-eeb5f0564f943243ceb2c1aa42adae0e03ac32ba.tar.gz
openbsd-eeb5f0564f943243ceb2c1aa42adae0e03ac32ba.tar.bz2
openbsd-eeb5f0564f943243ceb2c1aa42adae0e03ac32ba.zip
ansi, indentation, etc.
ok markus@ krw@ cloder@ millert@
Diffstat (limited to 'src/lib/libc/crypt')
-rw-r--r--src/lib/libc/crypt/blowfish.c25
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
66void 66void
67Blowfish_encipher(c, xl, xr) 67Blowfish_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
94void 91void
95Blowfish_decipher(c, xl, xr) 92Blowfish_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
122void 116void
123Blowfish_initstate(c) 117Blowfish_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
405u_int32_t 395u_int32_t
406Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, u_int16_t *current) 396Blowfish_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
463void 454void
464Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, 455Blowfish_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;