summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-05-01 17:30:11 +0200
committerJeremy Allison <jra@samba.org>2016-05-16 19:52:22 +0200
commitc4504bd7e344773f5d1b8cb16c398e43de3d2390 (patch)
treedce96d65abce238a1418942865e864741af349f4
parent8c332f46e4efc93e2b3aa810eff6b4e5778bb156 (diff)
downloadsamba-c4504bd7e344773f5d1b8cb16c398e43de3d2390.tar.gz
lib: Fix some whitespace
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--lib/crypto/arcfour.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/crypto/arcfour.c b/lib/crypto/arcfour.c
index 00054d32152..af9b20cc01e 100644
--- a/lib/crypto/arcfour.c
+++ b/lib/crypto/arcfour.c
@@ -1,20 +1,20 @@
-/*
+/*
Unix SMB/CIFS implementation.
An implementation of the arcfour algorithm
Copyright (C) Andrew Tridgell 1998
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -23,19 +23,19 @@
#include "../lib/crypto/arcfour.h"
/* initialise the arcfour sbox with key */
-_PUBLIC_ void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key)
+_PUBLIC_ void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key)
{
size_t ind;
uint8_t j = 0;
for (ind = 0; ind < sizeof(state->sbox); ind++) {
state->sbox[ind] = (uint8_t)ind;
}
-
+
for (ind = 0; ind < sizeof(state->sbox); ind++) {
uint8_t tc;
-
+
j += (state->sbox[ind] + key->data[ind%key->length]);
-
+
tc = state->sbox[ind];
state->sbox[ind] = state->sbox[j];
state->sbox[j] = tc;
@@ -45,10 +45,11 @@ _PUBLIC_ void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key)
}
/* crypt the data with arcfour */
-_PUBLIC_ void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data, int len)
+_PUBLIC_ void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data,
+ int len)
{
int ind;
-
+
for (ind = 0; ind < len; ind++) {
uint8_t tc;
uint8_t t;
@@ -59,7 +60,7 @@ _PUBLIC_ void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data, int
tc = state->sbox[state->index_i];
state->sbox[state->index_i] = state->sbox[state->index_j];
state->sbox[state->index_j] = tc;
-
+
t = state->sbox[state->index_i] + state->sbox[state->index_j];
data[ind] = data[ind] ^ state->sbox[t];
}
@@ -68,7 +69,7 @@ _PUBLIC_ void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data, int
/*
arcfour encryption with a blob key
*/
-_PUBLIC_ void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key)
+_PUBLIC_ void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key)
{
struct arcfour_state state;
arcfour_init(&state, key);