summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/camellia/cmll_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/camellia/cmll_misc.c')
-rw-r--r--lib/libcrypto/camellia/cmll_misc.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/lib/libcrypto/camellia/cmll_misc.c b/lib/libcrypto/camellia/cmll_misc.c
index 5caa7a98747..68b8dc44ff2 100644
--- a/lib/libcrypto/camellia/cmll_misc.c
+++ b/lib/libcrypto/camellia/cmll_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmll_misc.c,v 1.4 2014/07/09 11:10:50 bcook Exp $ */
+/* $OpenBSD: cmll_misc.c,v 1.5 2014/07/12 20:11:45 miod Exp $ */
/* ====================================================================
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
*
@@ -54,25 +54,28 @@
#include <openssl/camellia.h>
#include "cmll_locl.h"
-int private_Camellia_set_key(const unsigned char *userKey, const int bits,
- CAMELLIA_KEY *key)
- {
- if(!userKey || !key)
+int
+Camellia_set_key(const unsigned char *userKey, const int bits,
+ CAMELLIA_KEY *key)
+{
+ if (userKey == NULL || key == NULL)
return -1;
- if(bits != 128 && bits != 192 && bits != 256)
+ if (bits != 128 && bits != 192 && bits != 256)
return -2;
- key->grand_rounds = Camellia_Ekeygen(bits , userKey, key->u.rd_key);
+ key->grand_rounds = Camellia_Ekeygen(bits, userKey, key->u.rd_key);
return 0;
- }
+}
-void Camellia_encrypt(const unsigned char *in, unsigned char *out,
- const CAMELLIA_KEY *key)
- {
- Camellia_EncryptBlock_Rounds(key->grand_rounds, in , key->u.rd_key , out);
- }
+void
+Camellia_encrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key)
+{
+ Camellia_EncryptBlock_Rounds(key->grand_rounds, in, key->u.rd_key, out);
+}
-void Camellia_decrypt(const unsigned char *in, unsigned char *out,
- const CAMELLIA_KEY *key)
- {
- Camellia_DecryptBlock_Rounds(key->grand_rounds, in , key->u.rd_key , out);
- }
+void
+Camellia_decrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key)
+{
+ Camellia_DecryptBlock_Rounds(key->grand_rounds, in, key->u.rd_key, out);
+}