]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
global style change (now * is attached to identifier not to type)
authorbg <daniel.otte@rub.de>
Sun, 17 Feb 2013 09:44:36 +0000 (10:44 +0100)
committerbg <daniel.otte@rub.de>
Sun, 17 Feb 2013 09:44:36 +0000 (10:44 +0100)
393 files changed:
a51/A5_1.c
a51/A5_1.h
aes/aes128_dec.c
aes/aes128_dec.h
aes/aes128_enc.c
aes/aes128_enc.h
aes/aes192_dec.c
aes/aes192_dec.h
aes/aes192_enc.c
aes/aes192_enc.h
aes/aes256_dec.c
aes/aes256_dec.h
aes/aes256_enc.c
aes/aes256_enc.h
aes/aes_dec-asm.S
aes/aes_dec-asm_faster.S
aes/aes_dec.c
aes/aes_dec.h
aes/aes_enc-asm.S
aes/aes_enc.c
aes/aes_enc.h
aes/aes_keyschedule-asm.S
aes/aes_keyschedule.c
aes/aes_keyschedule.h
base64/base64_dec.c
base64/base64_dec.h
base64/base64_enc.c
base64/base64_enc.h
bcal/bcal-basic.c
bcal/bcal-basic.h
bcal/bcal-cbc.c
bcal/bcal-cbc.h
bcal/bcal-cfb_bit.c
bcal/bcal-cfb_bit.h
bcal/bcal-cfb_byte.c
bcal/bcal-cfb_byte.h
bcal/bcal-cmac.c
bcal/bcal-cmac.h
bcal/bcal-ctr.c
bcal/bcal-ctr.h
bcal/bcal-eax.c
bcal/bcal-eax.h
bcal/bcal-nessie.c
bcal/bcal-nessie.h
bcal/bcal-ofb.c
bcal/bcal-ofb.h
bcal/bcal-performance.c
bcal/bcal-performance.h
bcal/bcal_des.c
bcal/bcal_rc5.c
bcal/bcal_tdes.c
bcal/bcal_tdes2.c
bcal/bcal_threefish1024.c
bcal/bcal_threefish256.c
bcal/bcal_threefish512.c
bcal/bcal_xtea.c
bigint/bigint-stub.c
bigint/bigint.c
bigint/bigint.h
bigint/bigint_adjust.S
bigint/bigint_asm.S
bigint/bigint_io.c
bigint/bigint_io.h
blake/blake_large.c
blake/blake_large.h
blake/blake_small.c
blake/blake_small.h
blockcipher_descriptor.h
bmw/bmw_224-tinyasm.S
bmw/bmw_256-tinyasm.S
bmw/bmw_large.c
bmw/bmw_large.h
bmw/bmw_small-asm.S
bmw/bmw_small-tinyasm.S
bmw/bmw_small.c
bmw/bmw_small.h
camellia/camellia-asm.S
camellia/camellia.h
camellia/camellia128-stub.c
camellia/camellia_C.c
cast5/cast5.c
cast5/cast5.h
cast6/cast6.c
cast6/cast6.h
cscipher/cscipher.h
cscipher/cscipher_small.c
cscipher/cscipher_tiny_asm.S
cubehash/cubehash.c
cubehash/cubehash.h
cubehash/xchg.h
des/des.c
des/des.h
dsa/dsa.h
dsa/dsa_key_blob.c
dsa/dsa_key_blob.h
dsa/dsa_sign.c
dsa/dsa_verify.c
ecdsa/ecc.h
ecdsa/ecc_chudnovsky.c
ecdsa/ecdsa.h
ecdsa/ecdsa_sign.c
ecdsa/ecdsa_sign.h
echo/aes_enc_round-asm.S
echo/aes_enc_round.h
echo/echo.c
echo/echo.h
entropium/entropium.c
entropium/entropium.h
grain/grain.c
grain/grain.h
groestl/groestl_large.c
groestl/groestl_large.h
groestl/groestl_small.c
groestl/groestl_small.h
hashfunction_descriptor.h
hfal/hfal-basic.c
hfal/hfal-basic.h
hfal/hfal-hmac.c
hfal/hfal-hmac.h
hfal/hfal-nessie.c
hfal/hfal-nessie.h
hfal/hfal-performance.c
hfal/hfal-performance.h
hfal/hfal-test.c
hfal/hfal-test.h
hfal/hfal_skein1024.c
hfal/hfal_skein256.c
hfal/hfal_skein512.c
hmac-md5/hmac-md5.c
hmac-md5/hmac-md5.h
hmac-sha1/hmac-sha1.c
hmac-sha1/hmac-sha1.h
hmac-sha256/hmac-sha256.c
hmac-sha256/hmac-sha256.h
host/gf256_table_gen.c
jh/jh_simple.h
jh/jh_simple_aux.c
jh/jh_simple_small_core.c
jh/jh_simple_speed_core.c
keccak/keccak-asm.S
keccak/keccak.c
keccak/keccak.h
khazad/khazad.c
khazad/khazad.h
md5/md5-asm.S
md5/md5.c
md5/md5.h
memxor/memxor.S
memxor/memxor.h
memxor/memxor_c.c
memxor/memxor_p.S
mgf1/mgf1.c
mgf1/mgf1.h
mickey128/mickey128.c
mickey128/mickey128.h
mqq-sign/mqq160-sign-asm.S
mqq-sign/mqq160-sign.c
mqq-sign/mqq160-sign.h
mqq-sign/mqq160-sign_P-asm.S
mqq-sign/mqq160-sign_P-stub.c
mqq-sign/mqq160-sign_P.c
mqq-sign/mqq160-sign_P.h
mqq-sign/mqq160-sign_testkey.c
mqq-sign/mqq160-sign_testkey.h
mugi/mugi.c
mugi/mugi.h
noekeon/noekeon.c
noekeon/noekeon.h
noekeon/noekeon_asm.S
noekeon/noekeon_cbc_enc.S
noekeon/noekeon_cbc_enc.h
noekeon/noekeon_ctr.S
noekeon/noekeon_ctr.h
noekeon/noekeon_prng.c
noekeon/noekeon_prng.h
noekeon/omac_noekeon.S
noekeon/omac_noekeon.h
noekeon/omac_noekeon_C.c
present/present128.c
present/present128.h
present/present80.c
present/present80.h
present/present_common.c
present/present_common.h
present/present_speed.c
present/present_speed.h
rabbit/rabbit.h
rabbit/rabbit_c.c
rc5/rc5.c
rc5/rc5.h
rc6/rc6.c
rc6/rc6.h
rsa/rsa_basic.c
rsa/rsa_basic.h
rsa/rsaes_oaep.c
rsa/rsaes_oaep.h
rsa/rsaes_pkcs1v15.c
rsa/rsaes_pkcs1v15.h
salsa20/salsa20.c
salsa20/salsa20.h
scal/scal-basic.c
scal/scal-basic.h
scal/scal-nessie.c
scal/scal-nessie.h
seed/seed-asm.S
seed/seed_C.c
serpent/serpent-asm.S
serpent/serpent-sboxes-bitslice.c
serpent/serpent-sboxes_c.c
serpent/serpent.c
serpent/serpent.h
sha1/sha1.c
sha1/sha1.h
sha2/sha224.c
sha2/sha224.h
sha2/sha256.c
sha2/sha256.h
sha2/sha2_large_common.c
sha2/sha2_large_common.h
sha2/sha2_small_common.c
sha2/sha2_small_common.h
sha2/sha384.c
sha2/sha384.h
sha2/sha512.c
sha2/sha512.h
sha256/sha256.c
sha256/sha256.h
shabal/shabal-asm.S
shabal/shabal.c
shabal/shabal.h
shabal/shabal192-asm.S
shabal/shabal192.c
shabal/shabal224.c
shabal/shabal256.c
shabal/shabal384.c
shabal/shabal512.c
shacal1/shacal1_enc.c
shacal1/shacal1_enc.h
shacal2/shacal2_enc.c
shacal2/shacal2_enc.h
skein/skein.h
skein/skein1024.c
skein/skein1024_asm.S
skein/skein256.c
skein/skein256_asm.S
skein/skein512.c
skein/skein512_asm.S
skein/threefish.h
skein/threefish1024_dec.c
skein/threefish1024_dec_asm.S
skein/threefish1024_dec_cstub.c
skein/threefish1024_enc.c
skein/threefish1024_enc_asm.S
skein/threefish256_dec.c
skein/threefish256_dec_asm.S
skein/threefish256_dec_cstub.c
skein/threefish256_enc.c
skein/threefish256_enc_asm.S
skein/threefish256_enc_small.S
skein/threefish512_dec.c
skein/threefish512_dec_asm.S
skein/threefish512_dec_cstub.c
skein/threefish512_enc.c
skein/threefish512_enc_asm.S
skein/threefish_invmix.S
skein/threefish_invmix_4c.S
skein/threefish_invmix_c.c
skein/threefish_mix.S
skein/threefish_mix_4c.S
skein/threefish_mix_c.c
skein/ubi.h
skein/ubi1024.c
skein/ubi1024_asm.S
skein/ubi256.c
skein/ubi256_asm.S
skein/ubi512.c
skein/ubi512_asm.S
skipjack/skipjack.c
skipjack/skipjack.h
skipjack/skipjack_nofix.c
stack_measuring.h
streamcipher_descriptor.h
string-extras.h
test_src/circularbytebuffer-asm.S
test_src/circularbytebuffer.h
test_src/cli-core.S
test_src/cli-hexdump.S
test_src/cli-stub.c
test_src/cli.h
test_src/cmacvs.c
test_src/cmacvs.h
test_src/dbz_strings.c
test_src/dbz_strings.h
test_src/debug.c
test_src/dump-asm.S
test_src/dump-decl.c
test_src/dump.h
test_src/main-a5_1-test.c
test_src/main-aes-test.c
test_src/main-arcfour-test.c
test_src/main-base64-test.c
test_src/main-bigint-test.c
test_src/main-blake-test.c
test_src/main-bmw-test.c
test_src/main-camellia-test.c
test_src/main-cast5-test.c
test_src/main-cast6-test.c
test_src/main-cscipher-test.c
test_src/main-cubehash-test.c
test_src/main-des-test.c
test_src/main-dsa-test.c
test_src/main-ecdsa-test.c
test_src/main-echo-test.c
test_src/main-entropium-test.c
test_src/main-grain-test.c
test_src/main-groestl-test.c
test_src/main-hmac-md5-test.c
test_src/main-hmac-sha1-test.c
test_src/main-hmac-sha256-test.c
test_src/main-jh-test.c
test_src/main-keccak-test.c
test_src/main-khazad-test.c
test_src/main-md5-test.c
test_src/main-mickey128-test.c
test_src/main-mqq160-sign-test.c
test_src/main-mugi-test.c
test_src/main-noekeon-test.c
test_src/main-omac-noekeon-test.c
test_src/main-present-test.c
test_src/main-rabbit-test.c
test_src/main-rc5-test.c
test_src/main-rc6-test.c
test_src/main-rsaes_oaep-test.c
test_src/main-rsaes_pkcs1v15-test.c
test_src/main-salsa20-test.c
test_src/main-seed-test.c
test_src/main-serpent-test.c
test_src/main-sha1-test.c
test_src/main-sha2-test.c
test_src/main-sha256-test.c
test_src/main-shabal-test.c
test_src/main-shabea-test.c
test_src/main-shacal1_enc-test.c
test_src/main-shacal2_enc-test.c
test_src/main-skein-test.c
test_src/main-skipjack-test.c
test_src/main-tdes-test.c
test_src/main-test-common.c
test_src/main-test-common.h
test_src/main-threefish-test.c
test_src/main-trivium-test.c
test_src/main-twister-test.c
test_src/main-ubi-test.c
test_src/main-whirlpool-0-test.c
test_src/main-whirlpool-t-test.c
test_src/main-whirlpool-test.c
test_src/main-xtea-test.c
test_src/nessie_bc_test.c
test_src/nessie_bc_test.h
test_src/nessie_common.c
test_src/nessie_common.h
test_src/nessie_hash_test.c
test_src/nessie_hash_test.h
test_src/nessie_mac_test.c
test_src/nessie_mac_test.h
test_src/nessie_stream_test.c
test_src/nessie_stream_test.h
test_src/performance_test.c
test_src/performance_test.h
test_src/shavs.c
test_src/shavs.h
test_src/string-extras-asm.S
test_src/string-extras.h
trivium/trivium.c
trivium/trivium.h
twister/twister-asm.S
twister/twister-large-asm.S
twister/twister-large.c
twister/twister-large.h
twister/twister-small-asm.S
twister/twister-small-stub.c
twister/twister-small.c
twister/twister-small.h
twister/twister.c
twister/twister.h
twister/twister224.S
twister/twister256.S
twister/twister384.S
twister/twister512.S
whirlpool/whirlpool.c
whirlpool/whirlpool.h
xtea/xtea.c
xtea/xtea.h

index 64b44f73ff865b381ab77bb62a39ec4b977fc40e..a8bbf3da8513566dcd947064a229362c4082b481 100644 (file)
@@ -39,7 +39,7 @@ uint8_t a5_1_clock_core(a5_1_ctx_t *c, uint8_t clockoverride);
  * length is length of key in bits!
  */
 
-void a5_1_init(a5_1_ctx_t *c, void* key, uint8_t keylength_b, void* iv, uint8_t ivlength_b){
+void a5_1_init(a5_1_ctx_t *c, void *key, uint8_t keylength_b, void *iv, uint8_t ivlength_b){
        uint8_t i,t;
        memset(c->r1, 0, 3);
        memset(c->r2, 0, 3);
@@ -65,7 +65,7 @@ void a5_1_init(a5_1_ctx_t *c, void* key, uint8_t keylength_b, void* iv, uint8_t
 }
 
 static
-void shiftreg(uint8_td){
+void shiftreg(uint8_t *d){
        uint8_t c, c2;
        c=d[0]>>7;
        d[0] <<= 1;
index fab01719149c30c7a803ab34367eae887940b2a2..4e3e667cd0f0ce2b52acc17a49dc3a21aa32c63d 100644 (file)
@@ -58,7 +58,7 @@ typedef struct {
 } a5_1_ctx_t;
  
 
-void           a5_1_init(a5_1_ctx_t *c, void* key, uint8_t keylength_b, void* iv, uint8_t ivlength_b);
+void           a5_1_init(a5_1_ctx_t *c, void *key, uint8_t keylength_b, void *iv, uint8_t ivlength_b);
 uint8_t                a5_1_clock(a5_1_ctx_t *c);
 uint8_t        a5_1_gen(a5_1_ctx_t *c);
 
index f3746a76a38b44409e9447ac4884f98939fbeaaa..083aa9a4af775712e7fdf02ba932aa03e3985629 100644 (file)
@@ -28,7 +28,7 @@
 #include "aes.h"
 #include "aes_dec.h"
 
-void aes128_dec(void* buffer, aes128_ctx_t* ctx){
+void aes128_dec(void *buffer, aes128_ctx_t *ctx){
        aes_decrypt_core(buffer, (aes_genctx_t*)ctx, 10);
 }
 
index b5df9df702ae3c5f3ed8d17d7f8a4c0a9e8fe697..1f4e7f804d4db409467a2fbe1a0fd9c1e8947049 100644 (file)
@@ -39,7 +39,7 @@
  * \param buffer pointer to the block to decrypt
  * \param ctx    pointer to the key schedule
  */
-void aes128_dec(void* buffer, aes128_ctx_t* ctx);
+void aes128_dec(void *buffer, aes128_ctx_t *ctx);
 
 
 
index 37908546991ce923206a55bac6b5d25fdee5a90a..b629c757ebe209a568b2e043eea8825d6ba742e6 100644 (file)
@@ -28,7 +28,7 @@
 #include "aes.h"
 #include "aes_enc.h"
 
-void aes128_enc(void* buffer, aes128_ctx_t* ctx){
+void aes128_enc(void *buffer, aes128_ctx_t *ctx){
        aes_encrypt_core(buffer, (aes_genctx_t*)ctx, 10);
 }
 
index 98a8cc21c8f1e08ad616617a9f36d20822601a2b..0ac7b0aeb7459ad8ebfa859b804b2b533c01c30d 100644 (file)
@@ -40,7 +40,7 @@
  * \param buffer pointer to the block to encrypt
  * \param ctx    pointer to the key schedule
  */
-void aes128_enc(void* buffer, aes128_ctx_t* ctx);
+void aes128_enc(void *buffer, aes128_ctx_t *ctx);
 
 
 
index 99cc1b1ae56b2f95b68c631824b44bf6345cc2b8..ce762d075629cd0614e350b1c710e24d8f2ca994 100644 (file)
@@ -28,7 +28,7 @@
 #include "aes.h"
 #include "aes_dec.h"
 
-void aes192_dec(void* buffer, aes192_ctx_t* ctx){
+void aes192_dec(void *buffer, aes192_ctx_t *ctx){
        aes_decrypt_core(buffer, (aes_genctx_t*)ctx, 12);
 }
 
index 577ab44fa97ad3c7d5bca0834e82fac37604811b..05ff664f87005792fef2a3519d17e680b5d05bc5 100644 (file)
@@ -39,7 +39,7 @@
  * \param buffer pointer to the block to decrypt
  * \param ctx    pointer to the key schedule
  */
-void aes192_dec(void* buffer, aes192_ctx_t* ctx);
+void aes192_dec(void *buffer, aes192_ctx_t *ctx);
 
 
 
index 05cb71b3b4f4e0afe98b84fd80f4c5bba3116ecb..6fc7fa3ada32d78cca7babd5a4f0962e0dba304c 100644 (file)
@@ -28,7 +28,7 @@
 #include "aes.h"
 #include "aes_enc.h"
 
-void aes192_enc(void* buffer, aes192_ctx_t* ctx){
+void aes192_enc(void *buffer, aes192_ctx_t *ctx){
        aes_encrypt_core(buffer, (aes_genctx_t*)ctx, 12);
 }
 
index 1c39aa02cdbe77f4ea03c10e3bf0191e826a7c25..a1ad1e94a1e2b6f1c95a4bae2c43991f23892dbd 100644 (file)
@@ -40,7 +40,7 @@
  * \param buffer pointer to the block to encrypt
  * \param ctx    pointer to the key schedule
  */
-void aes192_enc(void* buffer, aes192_ctx_t* ctx);
+void aes192_enc(void *buffer, aes192_ctx_t *ctx);
 
 
 
index 9bbb016a1714f60a0fef23e1cc636ccdb65b3625..6425eb2eb09e32d4736d5cb7b0ae679862b96905 100644 (file)
@@ -28,7 +28,7 @@
 #include "aes.h"
 #include "aes_dec.h"
 
-void aes256_dec(void* buffer, aes256_ctx_t* ctx){
+void aes256_dec(void *buffer, aes256_ctx_t *ctx){
        aes_decrypt_core(buffer, (aes_genctx_t*)ctx, 14);
 }
 
index 14b8a0a22aaf64c12a1b0c423ebfa469587973f5..0b354db7adfe832dec4b621c00c1a04c4db645c3 100644 (file)
@@ -39,7 +39,7 @@
  * \param buffer pointer to the block to decrypt
  * \param ctx    pointer to the key schedule
  */
-void aes256_dec(void* buffer, aes256_ctx_t* ctx);
+void aes256_dec(void *buffer, aes256_ctx_t *ctx);
 
 
 
index cb2f3ffdbdaf1154cc08028a425c67b9bcab490f..3e3e379299a59e1ea41ba446dc2f843177c0a1eb 100644 (file)
@@ -28,7 +28,7 @@
 #include "aes.h"
 #include "aes_enc.h"
 
-void aes256_enc(void* buffer, aes256_ctx_t* ctx){
+void aes256_enc(void *buffer, aes256_ctx_t *ctx){
        aes_encrypt_core(buffer, (aes_genctx_t*)ctx, 14);
 }
 
index a890cd3e9ac191cb79cd0c73591b96ed2176cc2a..bcda6c3310901f2f94d983c7e7e76d3106169dd9 100644 (file)
@@ -40,7 +40,7 @@
  * \param buffer pointer to the block to encrypt
  * \param ctx    pointer to the key schedule
  */
-void aes256_enc(void* buffer, aes256_ctx_t* ctx);
+void aes256_enc(void *buffer, aes256_ctx_t *ctx);
 
 
 
index 78dffad52a2ca265127e135dfe872962f46f0788..4edbb63692f3453b75cc34c8949c061e179cd8c7 100644 (file)
@@ -65,7 +65,7 @@ aes128_dec:
 
 
 /*
-  void aes_decrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds)
+  void aes_decrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds)
 */
 T0= 2
 T1= 3
index e743678ff21e88d2a80dd4c5daebc974a5601032..4796f4ed549e5716372c855ad7d9f532eff04e05 100644 (file)
@@ -47,7 +47,7 @@ aes128_dec:
 
 
 /*
-  void aes_decrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds)
+  void aes_decrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds)
 */
 T0= 2
 T1= 3
index 8c476de0dbe70d3105eda6412befb75f334e78ba..5db465ba5a90f3bc33602a5f23ae65dfd4fe9b09 100644 (file)
@@ -25,7 +25,7 @@
 #include "aes_dec.h"
 #include <avr/pgmspace.h>
 
-void aes_invshiftrow(voiddata, uint8_t shift){
+void aes_invshiftrow(void *data, uint8_t shift){
        uint8_t tmp[4];
        tmp[0] = ((uint8_t*)data)[(4+0-shift)&3];
        tmp[1] = ((uint8_t*)data)[(4+1-shift)&3];
@@ -34,7 +34,7 @@ void aes_invshiftrow(void* data, uint8_t shift){
        memcpy(data, tmp, 4);
 }
 
-void aes_invshiftcol(voiddata, uint8_t shift){
+void aes_invshiftcol(void *data, uint8_t shift){
        uint8_t tmp[4];
        tmp[0] = ((uint8_t*)data)[ 0];
        tmp[1] = ((uint8_t*)data)[ 4];
@@ -46,7 +46,7 @@ void aes_invshiftcol(void* data, uint8_t shift){
        ((uint8_t*)data)[12] = tmp[(4-shift+3)&3];
 }
 static
-void aes_dec_round(aes_cipher_state_t* state, const aes_roundkey_t* k){
+void aes_dec_round(aes_cipher_state_t *state, const aes_roundkey_t *k){
        uint8_t tmp[16];
        uint8_t i;
        uint8_t t,u,v,w;
@@ -102,7 +102,7 @@ void aes_dec_round(aes_cipher_state_t* state, const aes_roundkey_t* k){
 
 
 static
-void aes_dec_firstround(aes_cipher_state_t* state, const aes_roundkey_t* k){
+void aes_dec_firstround(aes_cipher_state_t *state, const aes_roundkey_t *k){
        uint8_t i;
        /* keyAdd */
        for(i=0; i<16; ++i){
@@ -118,7 +118,7 @@ void aes_dec_firstround(aes_cipher_state_t* state, const aes_roundkey_t* k){
        }
 }
 
-void aes_decrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds){
+void aes_decrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds){
        uint8_t i;
        aes_dec_firstround(state, &(ks->key[i=rounds]));
        for(;rounds>1;--rounds){
index 0517bd910a2bf4909c246a17816753762885866e..e267170e5bb3adc4ed2da39f1fe32ccc4b1777a2 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdint.h>
 
 
-void aes_decrypt_core(aes_cipher_state_t* state,const aes_genctx_t* ks, uint8_t rounds);
+void aes_decrypt_core(aes_cipher_state_t *state,const aes_genctx_t *ks, uint8_t rounds);
 
 
 #endif
index 77c333623e9de86f29c6811b50493ada0190818f..83c6d554e9e3d4cbdeb406f35c0f242122985be5 100644 (file)
@@ -54,7 +54,7 @@ aes128_enc:
 
 
 /*
-  void aes_encrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds)
+  void aes_encrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds)
 */
 T0= 2
 T1= 3
index dadf9f45a63d7d875e2bde7441a8741469392278..6b6804cebf169b8bd2e04c936ade10078af7a21d 100644 (file)
@@ -33,7 +33,7 @@
 #include "aes_enc.h"
 #include <avr/pgmspace.h>
 
-void aes_shiftcol(voiddata, uint8_t shift){
+void aes_shiftcol(void *data, uint8_t shift){
        uint8_t tmp[4];
        tmp[0] = ((uint8_t*)data)[ 0];
        tmp[1] = ((uint8_t*)data)[ 4];
@@ -50,7 +50,7 @@ void aes_shiftcol(void* data, uint8_t shift){
 #define GF256MUL_3(a) (gf256mul(3, (a), 0x1b))
 
 static
-void aes_enc_round(aes_cipher_state_t* state, const aes_roundkey_t* k){
+void aes_enc_round(aes_cipher_state_t *state, const aes_roundkey_t *k){
        uint8_t tmp[16], t;
        uint8_t i;
        /* subBytes */
@@ -90,7 +90,7 @@ void aes_enc_round(aes_cipher_state_t* state, const aes_roundkey_t* k){
 
 
 static
-void aes_enc_lastround(aes_cipher_state_t* state,const aes_roundkey_t* k){
+void aes_enc_lastround(aes_cipher_state_t *state,const aes_roundkey_t *k){
        uint8_t i;
        /* subBytes */
        for(i=0; i<16; ++i){
@@ -106,7 +106,7 @@ void aes_enc_lastround(aes_cipher_state_t* state,const aes_roundkey_t* k){
        }
 }
 
-void aes_encrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds){
+void aes_encrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds){
        uint8_t i;
        for(i=0; i<16; ++i){
                state->s[i] ^= ks->key[0].ks[i];
index fb25764a181a1e8e7552b381a82f9a6c807c579b..1dc519e9245813c29cd14841889a8aeeb097efc5 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdint.h>
 
 
-void aes_encrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds);
+void aes_encrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds);
 
 
 #endif
index c5d69ea5308e8e2bbb0a090ff1377017cd8ee1b9..74595d93483c2b1458d11e0b0c0eb33d9d2f4fdf 100644 (file)
@@ -48,7 +48,7 @@ aes128_init:
        ldi r22, 128
 
 /* 
-void aes_init(const void* key, uint16_t keysize_b, aes_genctx_t* ctx){
+void aes_init(const void *key, uint16_t keysize_b, aes_genctx_t *ctx){
        uint8_t hi,i,nk, next_nk;
        uint8_t rc=1;
        uint8_t tmp[4];
index fff0700150c63f190c5c6a0ce6042aa744d5426a..94182b43f9e82f6545b2b7f30914bf115eef9832 100644 (file)
@@ -33,7 +33,7 @@
 #include <avr/pgmspace.h>
 
 static
-void aes_rotword(voida){
+void aes_rotword(void *a){
        uint8_t t;
        t=((uint8_t*)a)[0];
        ((uint8_t*)a)[0] = ((uint8_t*)a)[1];
@@ -46,7 +46,7 @@ const uint8_t rc_tab[] PROGMEM = { 0x01, 0x02, 0x04, 0x08,
                              0x10, 0x20, 0x40, 0x80,
                              0x1b, 0x36 };
 
-void aes_init(const void* key, uint16_t keysize_b, aes_genctx_t* ctx){
+void aes_init(const void *key, uint16_t keysize_b, aes_genctx_t *ctx){
        uint8_t hi,i,nk, next_nk;
        uint8_t rc=0;
        union {
@@ -81,14 +81,14 @@ void aes_init(const void* key, uint16_t keysize_b, aes_genctx_t* ctx){
        }
 }
 
-void aes128_init(const void* key, aes128_ctx_t* ctx){
+void aes128_init(const void *key, aes128_ctx_t *ctx){
        aes_init(key, 128, (aes_genctx_t*)ctx);
 }
 
-void aes192_init(const void* key, aes192_ctx_t* ctx){
+void aes192_init(const void *key, aes192_ctx_t *ctx){
        aes_init(key, 192, (aes_genctx_t*)ctx);
 }
 
-void aes256_init(const void* key, aes256_ctx_t* ctx){
+void aes256_init(const void *key, aes256_ctx_t *ctx){
        aes_init(key, 256, (aes_genctx_t*)ctx);
 }
index ab5786ab602bb1d706df99109b7078a513e8d8a3..7c3e46e013914668574ff1c9c2725e878f541d7c 100644 (file)
@@ -39,7 +39,7 @@
  * \param keysize_b length of the key in bits (valid are 128, 192 and 256)
  * \param ctx       pointer to the context where the keyschedule should be stored
  */
-void aes_init(const void* key, uint16_t keysize_b, aes_genctx_t* ctx);
+void aes_init(const void *key, uint16_t keysize_b, aes_genctx_t *ctx);
 
 /**
  * \brief initialize the keyschedule for 128 bit key
@@ -49,7 +49,7 @@ void aes_init(const void* key, uint16_t keysize_b, aes_genctx_t* ctx);
  * \param key       pointer to the key material
  * \param ctx       pointer to the context where the keyschedule should be stored
  */
-void aes128_init(const void* key, aes128_ctx_t* ctx);
+void aes128_init(const void *key, aes128_ctx_t *ctx);
 
 /**
  * \brief initialize the keyschedule for 192 bit key
@@ -59,7 +59,7 @@ void aes128_init(const void* key, aes128_ctx_t* ctx);
  * \param key       pointer to the key material
  * \param ctx       pointer to the context where the keyschedule should be stored
  */
-void aes192_init(const void* key, aes192_ctx_t* ctx);
+void aes192_init(const void *key, aes192_ctx_t *ctx);
 
 /**
  * \brief initialize the keyschedule for 256 bit key
@@ -69,7 +69,7 @@ void aes192_init(const void* key, aes192_ctx_t* ctx);
  * \param key       pointer to the key material
  * \param ctx       pointer to the context where the keyschedule should be stored
  */
-void aes256_init(const void* key, aes256_ctx_t* ctx);
+void aes256_init(const void *key, aes256_ctx_t *ctx);
 
 #endif /* AES_KEYSCHEDULE_H_ */
 
index 5a0dcca292d0e1bf4f8851442ee964af811a3ba5..2a6e94141868b8e86a3e94847fe6dd9825572bf3 100644 (file)
@@ -131,7 +131,7 @@ uint8_t ascii2bit6(uint8_t a){
 
 #endif
 
-int base64_binlength(charstr, uint8_t strict){
+int base64_binlength(char *str, uint8_t strict){
        int l=0;
        uint8_t term=0;
        for(;;){
@@ -187,7 +187,7 @@ int base64_binlength(char* str, uint8_t strict){
 
 */
 
-int base64dec(void* dest, const char* b64str, uint8_t strict){
+int base64dec(void *dest, const char *b64str, uint8_t strict){
        uint8_t buffer[4];
        uint8_t idx=0;
        uint8_t term=0;
index 1c9f1d958d23e5604a408fed67a06c1c064ef348..0f9cb96edc8020841c5f0425186761680b18f14e 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <stdint.h>
 
-int base64_binlength(charstr, uint8_t strict);
-int base64dec(void* dest, const char* b64str, uint8_t strict);
+int base64_binlength(char *str, uint8_t strict);
+int base64dec(void *dest, const char *b64str, uint8_t strict);
 
 #endif /*BASE64_DEC_H_*/
index ae0612756a55745f6c6b2c07f2eeaef9ce813e82..57ae7f345639a58acb2ac9b3d3d8344ca3eef9af 100644 (file)
@@ -75,7 +75,7 @@ char bit6toAscii(uint8_t a){
 
 #endif
 
-void base64enc(char* dest,const void* src, uint16_t length){
+void base64enc(char *dest,const void *src, uint16_t length){
        uint16_t i,j;
        uint8_t a[4];
        for(i=0; i<length/3; ++i){
index 89a5f863d3f503f73e826bb2149e19b80f2abe92..17b403209260d7eb017f3f8d6c1ac0979f9d1c4c 100644 (file)
@@ -23,6 +23,6 @@
 
 #include <stdint.h>
 
-void base64enc(char* dest, const void* src, uint16_t length);
+void base64enc(char *dest, const void *src, uint16_t length);
 
 #endif /*BASE64_ENC_H_*/
index 3d7a65c41b8f30c490b0e0ce606756ad0cb7ec0c..2dec6cff84e95dcad5d261606762d36af2ff253b 100644 (file)
@@ -24,8 +24,8 @@
 #include "blockcipher_descriptor.h"
 #include "keysize_descriptor.h"
 
-uint8_t bcal_cipher_init(const bcdesc_tcipher_descriptor,
-                         const void* key, uint16_t keysize_b, bcgen_ctx_t* ctx){
+uint8_t bcal_cipher_init(const bcdesc_t *cipher_descriptor,
+                         const void *key, uint16_t keysize_b, bcgen_ctx_t *ctx){
        if(!is_valid_keysize_P((PGM_VOID_P)pgm_read_word(&(cipher_descriptor->valid_keysize_desc)),
                               keysize_b)){
                return 1;
@@ -52,7 +52,7 @@ uint8_t bcal_cipher_init(const bcdesc_t* cipher_descriptor,
        return 0;
 }
 
-void bcal_cipher_free(bcgen_ctx_tctx){
+void bcal_cipher_free(bcgen_ctx_t *ctx){
        if(!ctx)
                return;
        bc_free_fpt free_fpt;
@@ -62,7 +62,7 @@ void bcal_cipher_free(bcgen_ctx_t* ctx){
        free(ctx->ctx);
 }
 
-void bcal_cipher_enc(void* block, const bcgen_ctx_t* ctx){
+void bcal_cipher_enc(void *block, const bcgen_ctx_t *ctx){
        bc_enc_fpt enc_fpt;
        enc_fpt.encvoid = (void_fpt)pgm_read_word(&(ctx->desc_ptr->enc.encvoid));
        if(!enc_fpt.encvoid){
@@ -73,7 +73,7 @@ void bcal_cipher_enc(void* block, const bcgen_ctx_t* ctx){
        
 }
 
-void bcal_cipher_dec(void* block, const bcgen_ctx_t* ctx){
+void bcal_cipher_dec(void *block, const bcgen_ctx_t *ctx){
        bc_dec_fpt dec_fpt;
        dec_fpt.decvoid = (void_fpt)pgm_read_word(&(ctx->desc_ptr->dec.decvoid));
        if(!dec_fpt.decvoid){
@@ -83,11 +83,11 @@ void bcal_cipher_dec(void* block, const bcgen_ctx_t* ctx){
        dec_fpt.dec1(block, (ctx->ctx));
 }
 
-uint16_t bcal_cipher_getBlocksize_b(const bcdesc_tdesc){
+uint16_t bcal_cipher_getBlocksize_b(const bcdesc_t *desc){
        return pgm_read_word(&(desc->blocksize_b));
 }
 
-PGM_VOID_P bcal_cipher_getKeysizeDesc(const bcdesc_tdesc){
+PGM_VOID_P bcal_cipher_getKeysizeDesc(const bcdesc_t *desc){
        return (PGM_VOID_P)pgm_read_word(&(desc->valid_keysize_desc));
 }
 
index e45b9b8d624c0bf12ca77f2604759b5a8649ce73..3f8260ae7b0f0df2af04fcdc6d56355d9a90f0b2 100644 (file)
 #include "keysize_descriptor.h"
 #include <avr/pgmspace.h>
 
-uint8_t bcal_cipher_init(const bcdesc_tcipher_descriptor,
-                         const void* key, uint16_t keysize_b, bcgen_ctx_t* ctx);
-void bcal_cipher_free(bcgen_ctx_tctx);
-void bcal_cipher_enc(void* block, const bcgen_ctx_t* ctx);
-void bcal_cipher_dec(void* block, const bcgen_ctx_t* ctx);
-uint16_t bcal_cipher_getBlocksize_b(const bcdesc_tdesc);
-PGM_VOID_P bcal_cipher_getKeysizeDesc(const bcdesc_tdesc);
+uint8_t bcal_cipher_init(const bcdesc_t *cipher_descriptor,
+                         const void *key, uint16_t keysize_b, bcgen_ctx_t *ctx);
+void bcal_cipher_free(bcgen_ctx_t *ctx);
+void bcal_cipher_enc(void *block, const bcgen_ctx_t *ctx);
+void bcal_cipher_dec(void *block, const bcgen_ctx_t *ctx);
+uint16_t bcal_cipher_getBlocksize_b(const bcdesc_t *desc);
+PGM_VOID_P bcal_cipher_getKeysizeDesc(const bcdesc_t *desc);
 #endif /* BCAL_BASIC_H_ */
index c5ff9d6f801e8f0500798861a7a18c8050971f39..718838762fe4a24d63a7490edd69c762dea59d48 100644 (file)
@@ -23,7 +23,7 @@
 #include "bcal-basic.h"
 #include "memxor.h"
 
-uint8_t bcal_cbc_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_cbc_ctx_t* ctx){
+uint8_t bcal_cbc_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_cbc_ctx_t *ctx){
        ctx->desc = (bcdesc_t*)desc;
        ctx->blocksize_B = (bcal_cipher_getBlocksize_b(desc)+7)/8;
        ctx->prev_block = malloc(ctx->blocksize_B);
@@ -34,37 +34,37 @@ uint8_t bcal_cbc_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b,
        return bcal_cipher_init(desc, key, keysize_b, &(ctx->cctx));
 }
 
-void bcal_cbc_free(bcal_cbc_ctx_tctx){
+void bcal_cbc_free(bcal_cbc_ctx_t *ctx){
        bcal_cipher_free(&(ctx->cctx));
        free(ctx->prev_block);
 }
 
 
-void bcal_cbc_loadIV(const void* iv, bcal_cbc_ctx_t* ctx){
+void bcal_cbc_loadIV(const void *iv, bcal_cbc_ctx_t *ctx){
        if(iv){
                memcpy(ctx->prev_block, iv, ctx->blocksize_B);
        }
 }
 
-void bcal_cbc_encNext(void* block, bcal_cbc_ctx_t* ctx){
+void bcal_cbc_encNext(void *block, bcal_cbc_ctx_t *ctx){
        memxor(block, ctx->prev_block, ctx->blocksize_B);
        bcal_cipher_enc(block, &(ctx->cctx));
        memcpy(ctx->prev_block, block, ctx->blocksize_B);
 }
 
-void bcal_cbc_decNext(void* block, bcal_cbc_ctx_t* ctx){
+void bcal_cbc_decNext(void *block, bcal_cbc_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        memcpy(tmp, block, ctx->blocksize_B);
        bcal_cipher_dec(block, &(ctx->cctx));
        memxor(block, ctx->prev_block, ctx->blocksize_B);
        memcpy(ctx->prev_block, tmp, ctx->blocksize_B);
 }
-void bcal_cbc_decRand(void* block, const void* prev_block, bcal_cbc_ctx_t* ctx){
+void bcal_cbc_decRand(void *block, const void *prev_block, bcal_cbc_ctx_t *ctx){
        bcal_cipher_dec(block, &(ctx->cctx));
        memxor(block, prev_block, ctx->blocksize_B);
 }
 
-void bcal_cbc_encMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cbc_ctx_t* ctx){
+void bcal_cbc_encMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cbc_ctx_t *ctx){
        bcal_cbc_loadIV(iv, ctx);
        while(msg_blocks--){
                bcal_cbc_encNext(msg, ctx);
@@ -72,7 +72,7 @@ void bcal_cbc_encMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cbc_ct
        }
 }
 
-void bcal_cbc_decMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cbc_ctx_t* ctx){
+void bcal_cbc_decMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cbc_ctx_t *ctx){
        msg=(uint8_t*)msg + (msg_blocks-1)*ctx->blocksize_B;
        while(msg_blocks > 1){
                bcal_cbc_decRand(msg, (uint8_t*)msg-ctx->blocksize_B, ctx);
index ba20186ff2ff46685a876c319abff0f22b5b552f..3f2c49ffc055e56eef948158583c74ecb648a31d 100644 (file)
@@ -31,14 +31,14 @@ typedef struct{
        uint8_t      blocksize_B;
 } bcal_cbc_ctx_t;
 
-uint8_t bcal_cbc_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_cbc_ctx_t* ctx);
-void bcal_cbc_free(bcal_cbc_ctx_tctx);
-void bcal_cbc_loadIV(const void* iv, bcal_cbc_ctx_t* ctx);
-void bcal_cbc_encNext(void* block, bcal_cbc_ctx_t* ctx);
-void bcal_cbc_decNext(void* block, bcal_cbc_ctx_t* ctx);
-void bcal_cbc_decRand(void* block, const void* prev_block, bcal_cbc_ctx_t* ctx);
-void bcal_cbc_encMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cbc_ctx_t* ctx);
-void bcal_cbc_decMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cbc_ctx_t* ctx);
+uint8_t bcal_cbc_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_cbc_ctx_t *ctx);
+void bcal_cbc_free(bcal_cbc_ctx_t *ctx);
+void bcal_cbc_loadIV(const void *iv, bcal_cbc_ctx_t *ctx);
+void bcal_cbc_encNext(void *block, bcal_cbc_ctx_t *ctx);
+void bcal_cbc_decNext(void *block, bcal_cbc_ctx_t *ctx);
+void bcal_cbc_decRand(void *block, const void *prev_block, bcal_cbc_ctx_t *ctx);
+void bcal_cbc_encMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cbc_ctx_t *ctx);
+void bcal_cbc_decMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cbc_ctx_t *ctx);
 
 
 #endif /* BCALCBC_H_ */
index 2611b658ecca3bb04051a7cfd50fcb621a9ece8f..33e4abfac6f7540065e443d6054e016b9594fc74 100644 (file)
 #include "bcal-cfb_bit.h"
 #include "bcal-basic.h"
 
-static uint8_t read_bit(voidblock, uint32_t index){
+static uint8_t read_bit(void *block, uint32_t index){
        uint8_t r;
        r=((uint8_t*)block)[index/8];
        r=(r&(0x80>>(index&7)))?0xff:0x00;
        return r;
 }
 
-static void write_bit(voidblock, uint32_t index, uint8_t value){
+static void write_bit(void *block, uint32_t index, uint8_t value){
        if(value){
                /* set bit */
                ((uint8_t*)block)[index/8] |= 0x80>>(index&7);
@@ -40,7 +40,7 @@ static void write_bit(void* block, uint32_t index, uint8_t value){
        }
 }
 
-uint8_t bcal_cfb_b_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_b_ctx_t* ctx){
+uint8_t bcal_cfb_b_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_b_ctx_t *ctx){
        ctx->desc = (bcdesc_t*)desc;
        ctx->blocksize_B = (bcal_cipher_getBlocksize_b(desc)+7)/8;
        ctx->in_block=malloc(ctx->blocksize_B);
@@ -54,18 +54,18 @@ uint8_t bcal_cfb_b_init(const bcdesc_t* desc, const void* key, uint16_t keysize_
        return bcal_cipher_init(desc, key, keysize_b, &(ctx->cctx));
 }
 
-void bcal_cfb_b_free(bcal_cfb_b_ctx_tctx){
+void bcal_cfb_b_free(bcal_cfb_b_ctx_t *ctx){
        free(ctx->in_block);
        bcal_cipher_free(&(ctx->cctx));
 }
 
-void bcal_cfb_b_loadIV(const void* iv, bcal_cfb_b_ctx_t* ctx){
+void bcal_cfb_b_loadIV(const void *iv, bcal_cfb_b_ctx_t *ctx){
        if(iv){
                memcpy(ctx->in_block, iv, ctx->blocksize_B);
        }
 }
 
-void bcal_cfb_b_encNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx){
+void bcal_cfb_b_encNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        offset &= 7;
        memcpy(tmp, ctx->in_block, ctx->blocksize_B);
@@ -83,7 +83,7 @@ void bcal_cfb_b_encNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx){
        }
 }
 
-void bcal_cfb_b_decNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx){
+void bcal_cfb_b_decNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        offset &= 7;
        memcpy(tmp, ctx->in_block, ctx->blocksize_B);
@@ -103,7 +103,7 @@ void bcal_cfb_b_decNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx){
        }
 }
 
-void bcal_cfb_b_encMsg(const void* iv, void* msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t* ctx){
+void bcal_cfb_b_encMsg(const void *iv, void *msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t *ctx){
        bcal_cfb_b_loadIV(iv, ctx);
        uint32_t addr;
        addr = ((uint16_t)msg)*8+offset;
@@ -115,7 +115,7 @@ void bcal_cfb_b_encMsg(const void* iv, void* msg, uint8_t offset, uint32_t msg_b
        }
 }
 
-void bcal_cfb_b_decMsg(const void* iv, void* msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t* ctx){
+void bcal_cfb_b_decMsg(const void *iv, void *msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t *ctx){
        bcal_cfb_b_loadIV(iv, ctx);
        uint32_t addr;
        addr = ((uint16_t)msg)*8+offset;
index df62e174ba5dabbfa4f8b3383b2630b4c5c7c647..3f56f5830a7b99c9a333f6c3ae5be3e40b86a041 100644 (file)
@@ -35,13 +35,13 @@ typedef struct{
 } bcal_cfb_b_ctx_t;
 
 
-uint8_t bcal_cfb_b_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_b_ctx_t* ctx);
-void bcal_cfb_b_free(bcal_cfb_b_ctx_tctx);
-void bcal_cfb_b_loadIV(const void* iv, bcal_cfb_b_ctx_t* ctx);
-void bcal_cfb_b_encNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx);
-void bcal_cfb_b_decNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx);
-void bcal_cfb_b_encMsg(const void* iv, void* msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t* ctx);
-void bcal_cfb_b_decMsg(const void* iv, void* msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t* ctx);
+uint8_t bcal_cfb_b_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_b_ctx_t *ctx);
+void bcal_cfb_b_free(bcal_cfb_b_ctx_t *ctx);
+void bcal_cfb_b_loadIV(const void *iv, bcal_cfb_b_ctx_t *ctx);
+void bcal_cfb_b_encNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx);
+void bcal_cfb_b_decNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx);
+void bcal_cfb_b_encMsg(const void *iv, void *msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t *ctx);
+void bcal_cfb_b_decMsg(const void *iv, void *msg, uint8_t offset, uint32_t msg_blocks, bcal_cfb_b_ctx_t *ctx);
 
 
 #endif /* BCALCFB_BIT_H_ */
index e0e5d22ca57080dd01e13af83335ec895a815ad3..00f072ae9ca65efcc481c0f858d26381459d8a3c 100644 (file)
@@ -25,7 +25,7 @@
 #include "memxor.h"
 
 
-uint8_t bcal_cfb_B_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_B_ctx_t* ctx){
+uint8_t bcal_cfb_B_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_B_ctx_t *ctx){
        ctx->desc = (bcdesc_t*)desc;
        ctx->blocksize_B = (bcal_cipher_getBlocksize_b(desc)+7)/8;
        ctx->in_block=malloc(ctx->blocksize_B);
@@ -39,18 +39,18 @@ uint8_t bcal_cfb_B_init(const bcdesc_t* desc, const void* key, uint16_t keysize_
        return bcal_cipher_init(desc, key, keysize_b, &(ctx->cctx));
 }
 
-void bcal_cfb_B_free(bcal_cfb_B_ctx_tctx){
+void bcal_cfb_B_free(bcal_cfb_B_ctx_t *ctx){
        free(ctx->in_block);
        bcal_cipher_free(&(ctx->cctx));
 }
 
-void bcal_cfb_B_loadIV(const void* iv, bcal_cfb_B_ctx_t* ctx){
+void bcal_cfb_B_loadIV(const void *iv, bcal_cfb_B_ctx_t *ctx){
        if(iv){
                memcpy(ctx->in_block, iv, ctx->blocksize_B);
        }
 }
 
-void bcal_cfb_B_encNext(void* block, bcal_cfb_B_ctx_t* ctx){
+void bcal_cfb_B_encNext(void *block, bcal_cfb_B_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        memcpy(tmp, ctx->in_block, ctx->blocksize_B);
        bcal_cipher_enc(tmp, &(ctx->cctx));
@@ -59,7 +59,7 @@ void bcal_cfb_B_encNext(void* block, bcal_cfb_B_ctx_t* ctx){
        memcpy(ctx->in_block+ctx->blocksize_B-ctx->size_B, block, ctx->size_B);
 }
 
-void bcal_cfb_B_decNext(void* block, bcal_cfb_B_ctx_t* ctx){
+void bcal_cfb_B_decNext(void *block, bcal_cfb_B_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        uint8_t xblock[ctx->size_B];
        memcpy(xblock, block, ctx->size_B);
@@ -70,7 +70,7 @@ void bcal_cfb_B_decNext(void* block, bcal_cfb_B_ctx_t* ctx){
        memcpy(ctx->in_block+ctx->blocksize_B-ctx->size_B, xblock, ctx->size_B);
 }
 
-void bcal_cfb_B_encMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t* ctx){
+void bcal_cfb_B_encMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t *ctx){
        bcal_cfb_B_loadIV(iv, ctx);
        while(msg_blocks--){
                bcal_cfb_B_encNext(msg, ctx);
@@ -78,7 +78,7 @@ void bcal_cfb_B_encMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cfb_
        }
 }
 
-void bcal_cfb_B_decMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t* ctx){
+void bcal_cfb_B_decMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t *ctx){
        bcal_cfb_B_loadIV(iv, ctx);
                while(msg_blocks--){
                        bcal_cfb_B_decNext(msg, ctx);
index 276a90493d8433aa4aa88a0605ad5817acfe9e45..4787620e30a55337ae9f546be324f1ff4b028b35 100644 (file)
@@ -34,13 +34,13 @@ typedef struct{
 } bcal_cfb_B_ctx_t;
 
 
-uint8_t bcal_cfb_B_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_B_ctx_t* ctx);
-void bcal_cfb_B_free(bcal_cfb_B_ctx_tctx);
-void bcal_cfb_B_loadIV(const void* iv, bcal_cfb_B_ctx_t* ctx);
-void bcal_cfb_B_encNext(void* block, bcal_cfb_B_ctx_t* ctx);
-void bcal_cfb_B_decNext(void* block, bcal_cfb_B_ctx_t* ctx);
-void bcal_cfb_B_encMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t* ctx);
-void bcal_cfb_B_decMsg(const void* iv, void* msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t* ctx);
+uint8_t bcal_cfb_B_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, uint16_t size_b, bcal_cfb_B_ctx_t *ctx);
+void bcal_cfb_B_free(bcal_cfb_B_ctx_t *ctx);
+void bcal_cfb_B_loadIV(const void *iv, bcal_cfb_B_ctx_t *ctx);
+void bcal_cfb_B_encNext(void *block, bcal_cfb_B_ctx_t *ctx);
+void bcal_cfb_B_decNext(void *block, bcal_cfb_B_ctx_t *ctx);
+void bcal_cfb_B_encMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t *ctx);
+void bcal_cfb_B_decMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cfb_B_ctx_t *ctx);
 
 
 #endif /* BCALCFB_BYTE_H_ */
index abc9dfa95348f051e407023d8f8f4a64a7fafac6..5cf319a676e3fb1a12751a712d66c997ce436669 100644 (file)
@@ -25,7 +25,7 @@
 #include "memxor.h"
 
 
-static uint8_t left_shift_be_block(voidblock, uint8_t blocksize_B){
+static uint8_t left_shift_be_block(void *block, uint8_t blocksize_B){
        uint8_t c1=0, c2;
        do{
                --blocksize_B;
@@ -40,7 +40,7 @@ static uint8_t left_shift_be_block(void* block, uint8_t blocksize_B){
 static const uint8_t const_128 = 0x87;
 static const uint8_t const_64  = 0x1b;
 
-uint8_t bcal_cmac_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_cmac_ctx_t* ctx){
+uint8_t bcal_cmac_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_cmac_ctx_t *ctx){
        uint8_t r;
        ctx->desc = (bcdesc_t*)desc;
        ctx->blocksize_B = bcal_cipher_getBlocksize_b(desc)/8;
@@ -87,14 +87,14 @@ uint8_t bcal_cmac_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b
        return 0;
 }
 
-void bcal_cmac_free(bcal_cmac_ctx_tctx){
+void bcal_cmac_free(bcal_cmac_ctx_t *ctx){
        free(ctx->accu);
        free(ctx->k1);
        free(ctx->k2);
        bcal_cipher_free(&(ctx->cctx));
 }
 
-void bcal_cmac_nextBlock (bcal_cmac_ctx_t* ctx, const void* block){
+void bcal_cmac_nextBlock (bcal_cmac_ctx_t *ctx, const void *block){
        if(ctx->last_set){
                memxor(ctx->accu, ctx->lastblock, ctx->blocksize_B);
                bcal_cipher_enc(ctx->accu, &(ctx->cctx));
@@ -104,7 +104,7 @@ void bcal_cmac_nextBlock (bcal_cmac_ctx_t* ctx, const void* block){
 }
 
 
-void bcal_cmac_lastBlock(bcal_cmac_ctx_t* ctx, const void* block, uint16_t length_b){
+void bcal_cmac_lastBlock(bcal_cmac_ctx_t *ctx, const void *block, uint16_t length_b){
        uint16_t blocksize_b;
        blocksize_b = ctx->blocksize_B*8;
        while(length_b>=blocksize_b){
@@ -131,7 +131,7 @@ void bcal_cmac_lastBlock(bcal_cmac_ctx_t* ctx, const void* block, uint16_t lengt
        bcal_cipher_enc(ctx->accu, &(ctx->cctx));
 }
 
-void bcal_cmac_ctx2mac(void* dest, uint16_t length_b, const bcal_cmac_ctx_t* ctx){
+void bcal_cmac_ctx2mac(void *dest, uint16_t length_b, const bcal_cmac_ctx_t *ctx){
        memcpy(dest, ctx->accu, length_b/8);
        if(length_b&7){
                ((uint8_t*)dest)[length_b/8] &= 0xff>>(length_b&7);
@@ -139,7 +139,7 @@ void bcal_cmac_ctx2mac(void* dest, uint16_t length_b, const bcal_cmac_ctx_t* ctx
        }
 }
 
-void bcal_cmac(void* dest, uint16_t out_length_b, const void* block, uint32_t length_b, bcal_cmac_ctx_t* ctx){
+void bcal_cmac(void *dest, uint16_t out_length_b, const void *block, uint32_t length_b, bcal_cmac_ctx_t *ctx){
        uint16_t blocksize_b;
        blocksize_b = ctx->blocksize_B*8;
        while(length_b>blocksize_b){
index be699b66155ce6f2f0df8a91d13b4574cc02d540..868c6168b6fde8f814d3e26701e372ac859cba94 100644 (file)
@@ -35,11 +35,11 @@ typedef struct{
        uint8_t      blocksize_B;
 } bcal_cmac_ctx_t;
 
-uint8_t bcal_cmac_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_cmac_ctx_t* ctx);
-void bcal_cmac_free(bcal_cmac_ctx_tctx);
-void bcal_cmac_nextBlock(bcal_cmac_ctx_t* ctx, const void* block);
-void bcal_cmac_lastBlock(bcal_cmac_ctx_t* ctx, const void* block, uint16_t length_b);
-void bcal_cmac_ctx2mac(void* dest, uint16_t length_b, const bcal_cmac_ctx_t* ctx);
-void bcal_cmac(void* dest, uint16_t out_length_b, const void* block, uint32_t length_b, bcal_cmac_ctx_t* ctx);
+uint8_t bcal_cmac_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_cmac_ctx_t *ctx);
+void bcal_cmac_free(bcal_cmac_ctx_t *ctx);
+void bcal_cmac_nextBlock(bcal_cmac_ctx_t *ctx, const void *block);
+void bcal_cmac_lastBlock(bcal_cmac_ctx_t *ctx, const void *block, uint16_t length_b);
+void bcal_cmac_ctx2mac(void *dest, uint16_t length_b, const bcal_cmac_ctx_t *ctx);
+void bcal_cmac(void *dest, uint16_t out_length_b, const void *block, uint32_t length_b, bcal_cmac_ctx_t *ctx);
 
 #endif /* BCALCMAC_H_ */
index 694cedd145d294672fba5e2d2664c85b8101d164..c0d7d771e15654a66b68069c036232fe94d55785 100644 (file)
@@ -24,7 +24,7 @@
 #include "bcal-ctr.h"
 #include "memxor.h"
 
-static void increment_be(voidblock, uint8_t size_B){
+static void increment_be(void *block, uint8_t size_B){
        uint16_t c=1;
        do{
                --size_B;
@@ -34,7 +34,7 @@ static void increment_be(void* block, uint8_t size_B){
        }while(size_B);
 }
 
-uint8_t bcal_ctr_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, inc_fp_t inc_func, bcal_ctr_ctx_t* ctx){
+uint8_t bcal_ctr_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, inc_fp_t inc_func, bcal_ctr_ctx_t *ctx){
        ctx->desc = (bcdesc_t*)desc;
        if(inc_func){
                ctx->inc_func = inc_func;
@@ -49,18 +49,18 @@ uint8_t bcal_ctr_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b,
        return bcal_cipher_init(desc, key, keysize_b, &(ctx->cctx));
 }
 
-void bcal_ctr_free(bcal_ctr_ctx_tctx){
+void bcal_ctr_free(bcal_ctr_ctx_t *ctx){
        free(ctx->in_block);
        bcal_cipher_free(&(ctx->cctx));
 }
 
-void bcal_ctr_loadIV(const void* iv, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_loadIV(const void *iv, bcal_ctr_ctx_t *ctx){
        if(iv){
                memcpy(ctx->in_block, iv, ctx->blocksize_B);
        }
 }
 
-void bcal_ctr_encNext(void* block, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_encNext(void *block, bcal_ctr_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        memcpy(tmp, ctx->in_block, ctx->blocksize_B);
        bcal_cipher_enc(tmp, &(ctx->cctx));
@@ -68,11 +68,11 @@ void bcal_ctr_encNext(void* block, bcal_ctr_ctx_t* ctx){
        ctx->inc_func(ctx->in_block, ctx->blocksize_B);
 }
 
-void bcal_ctr_decNext(void* block, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_decNext(void *block, bcal_ctr_ctx_t *ctx){
        bcal_ctr_encNext(block, ctx);
 }
 
-void bcal_ctr_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_encMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ctr_ctx_t *ctx){
        bcal_ctr_loadIV(iv, ctx);
        uint16_t blocksize_b;
        blocksize_b = ctx->blocksize_B*8;
@@ -89,7 +89,7 @@ void bcal_ctr_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx
        memxor(msg, tmp, (msg_len_b+7)/8);
 }
 
-void bcal_ctr_decMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_decMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ctr_ctx_t *ctx){
        bcal_ctr_encMsg(iv, msg, msg_len_b, ctx);
 }
 
index 55de4854e65b78fa8e8e735adb90855f4c8a79aa..8cad997084c6ea6ad139693b75f9eed55d316cdf 100644 (file)
@@ -24,7 +24,7 @@
 #include "bcal-basic.h"
 #include "blockcipher_descriptor.h"
 
-typedef void(*inc_fp_t)(voidblock, uint8_t size_B);
+typedef void(*inc_fp_t)(void *block, uint8_t size_B);
 
 typedef struct{
        bcdesc_t*    desc;
@@ -34,12 +34,12 @@ typedef struct{
        uint8_t      blocksize_B;
 } bcal_ctr_ctx_t;
 
-uint8_t bcal_ctr_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, inc_fp_t inc_func, bcal_ctr_ctx_t* ctx);
-void bcal_ctr_free(bcal_ctr_ctx_tctx);
-void bcal_ctr_loadIV(const void* iv, bcal_ctr_ctx_t* ctx);
-void bcal_ctr_encNext(void* block, bcal_ctr_ctx_t* ctx);
-void bcal_ctr_decNext(void* block, bcal_ctr_ctx_t* ctx);
-void bcal_ctr_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx_t* ctx);
-void bcal_ctr_decMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx_t* ctx);
+uint8_t bcal_ctr_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, inc_fp_t inc_func, bcal_ctr_ctx_t *ctx);
+void bcal_ctr_free(bcal_ctr_ctx_t *ctx);
+void bcal_ctr_loadIV(const void *iv, bcal_ctr_ctx_t *ctx);
+void bcal_ctr_encNext(void *block, bcal_ctr_ctx_t *ctx);
+void bcal_ctr_decNext(void *block, bcal_ctr_ctx_t *ctx);
+void bcal_ctr_encMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ctr_ctx_t *ctx);
+void bcal_ctr_decMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ctr_ctx_t *ctx);
 
 #endif /* BCALCTR_H_ */
index 9dceccdf6a4448226d07773dfdeb26078be3822b..15c80a090a4b80a645998e4e179e40701e68f468 100644 (file)
@@ -26,7 +26,7 @@
 #include "bcal-eax.h"
 #include "memxor.h"
 
-uint8_t bcal_eax_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_eax_ctx_t* ctx){
+uint8_t bcal_eax_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_eax_ctx_t *ctx){
        uint8_t r;
        ctx->blocksize_B = (bcal_cipher_getBlocksize_b(desc)+7)/8;
        ctx->nonce = malloc(ctx->blocksize_B);
@@ -60,7 +60,7 @@ uint8_t bcal_eax_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b,
        return 0;
 }
 
-void bcal_eax_free(bcal_eax_ctx_tctx){
+void bcal_eax_free(bcal_eax_ctx_t *ctx){
        bcal_ctr_free(&(ctx->cipher));
        bcal_cmac_free(&(ctx->ctag));
        bcal_cmac_free(&(ctx->htag));
@@ -68,42 +68,42 @@ void bcal_eax_free(bcal_eax_ctx_t* ctx){
        free(ctx->nonce);
 }
 
-void bcal_eax_loadNonce(const void* nonce, uint16_t length_b, bcal_eax_ctx_t* ctx){
+void bcal_eax_loadNonce(const void *nonce, uint16_t length_b, bcal_eax_ctx_t *ctx){
        bcal_cmac_lastBlock(&(ctx->ntag), nonce, length_b);
        bcal_cmac_ctx2mac(ctx->nonce, ctx->blocksize_B*8, &(ctx->ntag));
        bcal_ctr_loadIV(ctx->nonce, &(ctx->cipher));
 }
 
-void bcal_eax_addNextHeader(const void* header, bcal_eax_ctx_t* ctx){
+void bcal_eax_addNextHeader(const void *header, bcal_eax_ctx_t *ctx){
        bcal_cmac_nextBlock(&(ctx->htag), header);
 }
 
-void bcal_eax_addLastHeader(const void* header, uint16_t length_b, bcal_eax_ctx_t* ctx){
+void bcal_eax_addLastHeader(const void *header, uint16_t length_b, bcal_eax_ctx_t *ctx){
        bcal_cmac_lastBlock(&(ctx->htag), header, length_b);
        ctx->header_set = 1;
 }
 
-void bcal_eax_encNextBlock(void* block, bcal_eax_ctx_t* ctx){
+void bcal_eax_encNextBlock(void *block, bcal_eax_ctx_t *ctx){
        bcal_ctr_encNext(block, &(ctx->cipher));
        bcal_cmac_nextBlock(&(ctx->ctag), block);
 }
 
-void bcal_eax_encLastBlock(void* block, uint16_t length_b, bcal_eax_ctx_t* ctx){
+void bcal_eax_encLastBlock(void *block, uint16_t length_b, bcal_eax_ctx_t *ctx){
        bcal_ctr_encMsg(NULL, block, length_b, &(ctx->cipher));
        bcal_cmac_lastBlock(&(ctx->ctag), block, length_b);
 }
 
-void bcal_eax_decNextBlock(void* block, bcal_eax_ctx_t* ctx){
+void bcal_eax_decNextBlock(void *block, bcal_eax_ctx_t *ctx){
        bcal_cmac_nextBlock(&(ctx->ctag), block);
        bcal_ctr_decNext(block, &(ctx->cipher));
 }
 
-void bcal_eax_decLastBlock(void* block, uint16_t length_b, bcal_eax_ctx_t* ctx){
+void bcal_eax_decLastBlock(void *block, uint16_t length_b, bcal_eax_ctx_t *ctx){
        bcal_cmac_lastBlock(&(ctx->ctag), block, length_b);
        bcal_ctr_decMsg(NULL, block, length_b, &(ctx->cipher));
 }
 
-void bcal_eax_ctx2tag(void* dest, uint16_t length_b, bcal_eax_ctx_t* ctx){
+void bcal_eax_ctx2tag(void *dest, uint16_t length_b, bcal_eax_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        if(ctx->header_set==0){
                bcal_cmac_lastBlock(&(ctx->htag), NULL, 0);
index 190eee9a739aa5b3cb35269d2b5e777ccb320961..08dbe853f247b13182a34b4b34d2a49615dde641 100644 (file)
@@ -37,17 +37,17 @@ typedef struct{
        uint8_t         header_set;
 } bcal_eax_ctx_t;
 
-uint8_t bcal_eax_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_eax_ctx_t* ctx);
-void bcal_eax_free(bcal_eax_ctx_tctx);
-void bcal_eax_loadNonce(const void* nonce, uint16_t length_b, bcal_eax_ctx_t* ctx);
-void bcal_eax_addNextHeader(const void* header, bcal_eax_ctx_t* ctx);
-void bcal_eax_addLastHeader(const void* header, uint16_t length_b, bcal_eax_ctx_t* ctx);
-void bcal_eax_encNextBlock(void* block, bcal_eax_ctx_t* ctx);
-void bcal_eax_encLastBlock(void* block, uint16_t length_b, bcal_eax_ctx_t* ctx);
-void bcal_eax_decNextBlock(void* block, bcal_eax_ctx_t* ctx);
-void bcal_eax_decLastBlock(void* block, uint16_t length_b, bcal_eax_ctx_t* ctx);
-void bcal_eax_ctx2tag(void* dest, uint16_t length_b, bcal_eax_ctx_t* ctx);
-//void bcal_eax(void* dest, uint16_t out_length_b, const void* block, uint32_t length_b, bcal_eax_ctx_t* ctx);
+uint8_t bcal_eax_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_eax_ctx_t *ctx);
+void bcal_eax_free(bcal_eax_ctx_t *ctx);
+void bcal_eax_loadNonce(const void *nonce, uint16_t length_b, bcal_eax_ctx_t *ctx);
+void bcal_eax_addNextHeader(const void *header, bcal_eax_ctx_t *ctx);
+void bcal_eax_addLastHeader(const void *header, uint16_t length_b, bcal_eax_ctx_t *ctx);
+void bcal_eax_encNextBlock(void *block, bcal_eax_ctx_t *ctx);
+void bcal_eax_encLastBlock(void *block, uint16_t length_b, bcal_eax_ctx_t *ctx);
+void bcal_eax_decNextBlock(void *block, bcal_eax_ctx_t *ctx);
+void bcal_eax_decLastBlock(void *block, uint16_t length_b, bcal_eax_ctx_t *ctx);
+void bcal_eax_ctx2tag(void *dest, uint16_t length_b, bcal_eax_ctx_t *ctx);
+//void bcal_eax(void *dest, uint16_t out_length_b, const void *block, uint32_t length_b, bcal_eax_ctx_t *ctx);
 
 #endif /* BCALEAX_H_ */
 
index 00121f00d6cd347380d5b3ee333eaa2b410e904d..f9748a3dfc95388570415015d696c55f43e5b60b 100644 (file)
@@ -26,9 +26,9 @@
 #include <avr/pgmspace.h>
 
 
-void(*bcal_nessie_dummy_init_fpt)(const void* key, void* ctx)=NULL;
+void(*bcal_nessie_dummy_init_fpt)(const void *key, void *ctx)=NULL;
 
-void bcal_nessie_dummy_init(const void* key, uint16_t keysize, void* ctx){
+void bcal_nessie_dummy_init(const void *key, uint16_t keysize, void *ctx){
        if(bcal_nessie_dummy_init_fpt){
                bcal_nessie_dummy_init_fpt(key, ctx);
        }else{
@@ -36,7 +36,7 @@ void bcal_nessie_dummy_init(const void* key, uint16_t keysize, void* ctx){
        }
 }
 
-void bcal_nessie(const bcdesc_tbcd){
+void bcal_nessie(const bcdesc_t *bcd){
        if(pgm_read_byte(&(bcd->type))!=BCDESC_TYPE_BLOCKCIPHER)
                return;
        char name[1+strlen_P((void*)pgm_read_word(&(bcd->name)))];
@@ -69,8 +69,8 @@ void bcal_nessie(const bcdesc_t* bcd){
 
 }
 
-void bcal_nessie_multiple(const bcdesc_t* const* bcd_list){
-       const bcdesc_tbcd;
+void bcal_nessie_multiple(const bcdesc_t *const *bcd_list){
+       const bcdesc_t *bcd;
        for(;;){
                bcd = (void*)pgm_read_word(bcd_list);
                if(!bcd)
index 01209615d75576c97a2356e90434f8af2aafef80..73cff4674465f5937f0001cc1365329ddaaf16a6 100644 (file)
@@ -30,8 +30,8 @@
 
 #include "blockcipher_descriptor.h"
 
-void bcal_nessie(const bcdesc_tbcd);
-void bcal_nessie_multiple(const bcdesc_t* const* bcd_list);
+void bcal_nessie(const bcdesc_t *bcd);
+void bcal_nessie_multiple(const bcdesc_t *const *bcd_list);
 
 
 #endif /* BCALNESSIE_H_ */
index d7ae757e9a485f3f908bbbae36fa0cf980f26712..34dbc8a1d75b54b23e26ea0ede49706a39169db6 100644 (file)
@@ -24,7 +24,7 @@
 #include "memxor.h"
 
 
-uint8_t bcal_ofb_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_ofb_ctx_t* ctx){
+uint8_t bcal_ofb_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_ofb_ctx_t *ctx){
        ctx->desc = (bcdesc_t*)desc;
        ctx->blocksize_B = (bcal_cipher_getBlocksize_b(desc)+7)/8;
        ctx->in_block=malloc(ctx->blocksize_B);
@@ -34,29 +34,29 @@ uint8_t bcal_ofb_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b,
        return bcal_cipher_init(desc, key, keysize_b, &(ctx->cctx));
 }
 
-void bcal_ofb_free(bcal_ofb_ctx_tctx){
+void bcal_ofb_free(bcal_ofb_ctx_t *ctx){
        free(ctx->in_block);
        bcal_cipher_free(&(ctx->cctx));
 }
 
-void bcal_ofb_loadIV(const void* iv, bcal_ofb_ctx_t* ctx){
+void bcal_ofb_loadIV(const void *iv, bcal_ofb_ctx_t *ctx){
        if(iv){
                memcpy(ctx->in_block, iv, ctx->blocksize_B);
        }
 }
 
-void bcal_ofb_encNext(void* block, bcal_ofb_ctx_t* ctx){
+void bcal_ofb_encNext(void *block, bcal_ofb_ctx_t *ctx){
        bcal_cipher_enc(ctx->in_block , &(ctx->cctx));
        memxor(block, ctx->in_block, ctx->blocksize_B);
 }
 
-void bcal_ofb_decNext(void* block, bcal_ofb_ctx_t* ctx){
+void bcal_ofb_decNext(void *block, bcal_ofb_ctx_t *ctx){
        bcal_cipher_enc(ctx->in_block , &(ctx->cctx));
        memxor(block, ctx->in_block, ctx->blocksize_B);
 }
 
 
-void bcal_ofb_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ofb_ctx_t* ctx){
+void bcal_ofb_encMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ofb_ctx_t *ctx){
        uint16_t block_len_b;
        block_len_b = ctx->blocksize_B*8;
        bcal_ofb_loadIV(iv, ctx);
@@ -70,7 +70,7 @@ void bcal_ofb_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ofb_ctx
        memxor(msg, ctx->in_block, (msg_len_b+7)/8);
 }
 
-void bcal_ofb_decMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ofb_ctx_t* ctx){
+void bcal_ofb_decMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ofb_ctx_t *ctx){
        bcal_ofb_encMsg(iv, msg, msg_len_b, ctx);
 }
 
index aa69c05d87dde27ed92fa3233752d37b8849298d..e005fa0b8d16a22ef3cf02415f49142b1dff692b 100644 (file)
@@ -34,13 +34,13 @@ typedef struct{
 } bcal_ofb_ctx_t;
 
 
-uint8_t bcal_ofb_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, bcal_ofb_ctx_t* ctx);
-void bcal_ofb_free(bcal_ofb_ctx_tctx);
-void bcal_ofb_loadIV(const void* iv, bcal_ofb_ctx_t* ctx);
-void bcal_ofb_encNext(void* block, bcal_ofb_ctx_t* ctx);
-void bcal_ofb_decNext(void* block, bcal_ofb_ctx_t* ctx);
-void bcal_ofb_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ofb_ctx_t* ctx);
-void bcal_ofb_decMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ofb_ctx_t* ctx);
+uint8_t bcal_ofb_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, bcal_ofb_ctx_t *ctx);
+void bcal_ofb_free(bcal_ofb_ctx_t *ctx);
+void bcal_ofb_loadIV(const void *iv, bcal_ofb_ctx_t *ctx);
+void bcal_ofb_encNext(void *block, bcal_ofb_ctx_t *ctx);
+void bcal_ofb_decNext(void *block, bcal_ofb_ctx_t *ctx);
+void bcal_ofb_encMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ofb_ctx_t *ctx);
+void bcal_ofb_decMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ofb_ctx_t *ctx);
 
 
 #endif /* BCALOFB_H_ */
index 267ec1c1aa6bde23a6d2520e31711575249d1c39..b5b2db32bb0ffced00d6a9c5cdd253673634388f 100644 (file)
@@ -55,7 +55,7 @@ void printvalue(unsigned long v){
 }
 */
 
-void bcal_performance(const bcdesc_tbcd){
+void bcal_performance(const bcdesc_t *bcd){
        bcdesc_t bc;
        memcpy_P(&bc, bcd, sizeof(bcdesc_t));
        uint8_t ctx[bc.ctxsize_B];
@@ -136,7 +136,7 @@ void bcal_performance(const bcdesc_t* bcd){
        }
 }
 
-void bcal_stacksize(const bcdesc_tbcd){
+void bcal_stacksize(const bcdesc_t *bcd){
        bcdesc_t bc;
        stack_measuring_ctx_t smctx;
        memcpy_P(&bc, bcd, sizeof(bcdesc_t));
@@ -205,8 +205,8 @@ void bcal_stacksize(const bcdesc_t* bcd){
        }
 }
 
-void bcal_performance_multiple(const bcdesc_t* const* bcd_list){
-       const bcdesc_tbcd;
+void bcal_performance_multiple(const bcdesc_t *const *bcd_list){
+       const bcdesc_t *bcd;
        for(;;){
                bcd = (void*)pgm_read_word(bcd_list);
                if(!bcd){
index 19207ea722b30e6b28561f12887ac7144e96ff54..7258854b5ad0ccd3b761bd7d8ecd1555f5c178db 100644 (file)
@@ -31,8 +31,8 @@
 
 #include "blockcipher_descriptor.h"
 
-void bcal_performance(const bcdesc_thd);
-void bcal_performance_multiple(const bcdesc_t* const* hd_list);
+void bcal_performance(const bcdesc_t *hd);
+void bcal_performance_multiple(const bcdesc_t *const *hd_list);
 
 
 #endif /* BCAL_PERFORMANCE_H_ */
index 0e8068b95f8804542bf5a5016490e99d5ed5ae9a..14836609caab825a278a14a497f78585da500e0a 100644 (file)
@@ -36,12 +36,12 @@ const char des_str[]   PROGMEM = "DES";
 const uint8_t des_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(64), 
                                                 KS_TYPE_TERMINATOR    };
 static
-void des_dummy_enc(void* block, void* key){
+void des_dummy_enc(void *block, void *key){
        des_enc(block, block, key);
 }
 
 static
-void des_dummy_dec(void* block, void* key){
+void des_dummy_dec(void *block, void *key){
        des_dec(block, block, key);
 }
 
index 97021687056b4712b6fb3d0976de249af5ba41e2..b6e18f1ea17f3fccbd2f81df71343e72bfc6715d 100644 (file)
@@ -39,7 +39,7 @@ const uint8_t rc5_keysize_desc[] PROGMEM = { KS_TYPE_RANGE, KS_INT(1), KS_INT(20
                                                 KS_TYPE_TERMINATOR    };
 
 static
-void rc5_dummy_init(void* key, uint16_t keysize_b, void* ctx){
+void rc5_dummy_init(void *key, uint16_t keysize_b, void *ctx){
        rc5_init(key, keysize_b, RC5_ROUNDS, ctx);
 }
 
index 6a6f49d465ecee76657da7791b57df203ffa5d84..4ee3e85d548000d3bde621a2036890690e602cd6 100644 (file)
@@ -37,12 +37,12 @@ const uint8_t tdes_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(192),
                                                 KS_TYPE_TERMINATOR    };
 
 static
-void tdes_dummy_enc(void* block, void* key){
+void tdes_dummy_enc(void *block, void *key){
        tdes_enc(block, block, key);
 }
 
 static
-void tdes_dummy_dec(void* block, void* key){
+void tdes_dummy_dec(void *block, void *key){
        tdes_dec(block, block, key);
 }
 
index a39bafab2f7f24ba1aaf660969294b36ee6624f3..19cb85ad90f5511a5ecead233d2125302b6b9abc 100644 (file)
@@ -38,17 +38,17 @@ const uint8_t tdes2_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(128),
                                                 KS_TYPE_TERMINATOR    };
 
 static
-void tdes_dummy_enc(void* block, void* key){
+void tdes_dummy_enc(void *block, void *key){
        tdes_enc(block, block, key);
 }
 
 static
-void tdes_dummy_dec(void* block, void* key){
+void tdes_dummy_dec(void *block, void *key){
        tdes_dec(block, block, key);
 }
 
 static
-void tdes2_init(void* key, void* ctx){
+void tdes2_init(void *key, void *ctx){
        memcpy(ctx, key, 16);
        memcpy((uint8_t*)ctx+16, key, 8);
 }
index 8f1a10856b1142f7873290a992ed9df8fe489226..167cbf99336fbafb8a353bd90dcd6261ba02b350 100644 (file)
@@ -36,7 +36,7 @@ const char threefish1024_str[]   PROGMEM = "Threefish-1024";
 const uint8_t threefish1024_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(1024),
                                                 KS_TYPE_TERMINATOR    };
 
-static void threefish1024_dummy_init(void* key, void* ctx){
+static void threefish1024_dummy_init(void *key, void *ctx){
        threefish1024_init(key, NULL, ctx);
 }
 
index f95f1a2f6c9a9ffb39e70bdeca942d51a1b316d8..817edbff384013ee771aa3c03e68447f153f5d6f 100644 (file)
@@ -36,7 +36,7 @@ const char threefish256_str[]   PROGMEM = "Threefish-256";
 const uint8_t threefish256_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(256),
                                                 KS_TYPE_TERMINATOR    };
 
-static void threefish256_dummy_init(void* key, void* ctx){
+static void threefish256_dummy_init(void *key, void *ctx){
        threefish256_init(key, NULL, ctx);
 }
 
index ff61a74e74ac9b55d72773db65581587a4641b9b..9f7f1bcd8d70a32e543ab5d6f65233b13c67f1af 100644 (file)
@@ -36,7 +36,7 @@ const char threefish512_str[]   PROGMEM = "Threefish-512";
 const uint8_t threefish512_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(512),
                                                 KS_TYPE_TERMINATOR    };
 
-static void threefish512_dummy_init(void* key, void* ctx){
+static void threefish512_dummy_init(void *key, void *ctx){
        threefish512_init(key, NULL, ctx);
 }
 
index bd6263bae38c3002f56588046c067585f9f53185..210c3983a9ae8b181bd3c6fa664267bc690799f9 100644 (file)
@@ -37,12 +37,12 @@ const uint8_t xtea_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(128),
                                                 KS_TYPE_TERMINATOR    };
 
 static
-void xtea_dummy_enc(void* block, void* key){
+void xtea_dummy_enc(void *block, void *key){
        xtea_enc(block, block, key);
 }
 
 static
-void xtea_dummy_dec(void* block, void* key){
+void xtea_dummy_dec(void *block, void *key){
        xtea_dec(block, block, key);
 }
 
index a5dc765fd470f04f3da231162e8825b1443202ba..13c01f05ecfd2063e2dfee201baac02f8aad9d98 100644 (file)
@@ -58,7 +58,7 @@
 
 /******************************************************************************/
 /*
-void bigint_copy(bigint_t* dest, const bigint_t* src){
+void bigint_copy(bigint_t *dest, const bigint_t *src){
        memcpy(dest->wordv, src->wordv, src->length_W);
        dest->length_W = src->length_W;
        dest->info = src->info;
@@ -68,7 +68,7 @@ void bigint_copy(bigint_t* dest, const bigint_t* src){
 
 /* this should be implemented in assembly */
 /*
-void bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_add_u(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint16_t t=0, i;
        if(a->length_W < b->length_W){
                XCHG_PTR(a,b);
@@ -92,7 +92,7 @@ void bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /* this should be implemented in assembly */
 /*
-void bigint_add_scale_u(bigint_t* dest, const bigint_t* a, uint16_t scale){
+void bigint_add_scale_u(bigint_t *dest, const bigint_t *a, uint16_t scale){
        uint16_t i,j=0;
        uint16_t t=0;
        if(scale>dest->length_W)
@@ -122,7 +122,7 @@ void bigint_add_scale_u(bigint_t* dest, const bigint_t* a, uint16_t scale){
 /******************************************************************************/
 
 /* this should be implemented in assembly */
-void bigint_sub_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_sub_u(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        int8_t borrow=0;
        int8_t  r;
        int16_t t;
@@ -183,7 +183,7 @@ void bigint_sub_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-int8_t bigint_cmp_u(const bigint_t* a, const bigint_t* b){
+int8_t bigint_cmp_u(const bigint_t *a, const bigint_t *b){
        if(a->length_W > b->length_W){
                return 1;
        }
@@ -209,7 +209,7 @@ int8_t bigint_cmp_u(const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_add_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_add_s(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint8_t s;
        s  = GET_SIGN(a)?2:0;
        s |= GET_SIGN(b)?1:0;
@@ -235,7 +235,7 @@ void bigint_add_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_sub_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_sub_s(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint8_t s;
        s  = GET_SIGN(a)?2:0;
        s |= GET_SIGN(b)?1:0;
@@ -262,7 +262,7 @@ void bigint_sub_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-int8_t bigint_cmp_s(const bigint_t* a, const bigint_t* b){
+int8_t bigint_cmp_s(const bigint_t *a, const bigint_t *b){
        uint8_t s;
        if(a->length_W==0 && b->length_W==0){
                return 0;
@@ -290,7 +290,7 @@ int8_t bigint_cmp_s(const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_shiftleft(bigint_ta, uint16_t shift){
+void bigint_shiftleft(bigint_t *a, uint16_t shift){
        uint16_t byteshift;
        uint16_t i;
        uint8_t bitshift;
@@ -324,7 +324,7 @@ void bigint_shiftleft(bigint_t* a, uint16_t shift){
 
 /******************************************************************************/
 
-void bigint_shiftright(bigint_ta, uint16_t shift){
+void bigint_shiftright(bigint_t *a, uint16_t shift){
        uint16_t byteshift;
        uint16_t i;
        uint8_t bitshift;
@@ -359,7 +359,7 @@ void bigint_shiftright(bigint_t* a, uint16_t shift){
 
 /******************************************************************************/
 
-void bigint_xor(bigint_t* dest, const bigint_t* a){
+void bigint_xor(bigint_t *dest, const bigint_t *a){
        uint16_t i;
        for(i=0; i<a->length_W; ++i){
                dest->wordv[i] ^= a->wordv[i];
@@ -369,7 +369,7 @@ void bigint_xor(bigint_t* dest, const bigint_t* a){
 
 /******************************************************************************/
 
-void bigint_set_zero(bigint_ta){
+void bigint_set_zero(bigint_t *a){
        a->length_W=0;
 }
 
@@ -377,7 +377,7 @@ void bigint_set_zero(bigint_t* a){
 
 /* using the Karatsuba-Algorithm */
 /* x*y = (xh*yh)*b**2n + ((xh+xl)*(yh+yl) - xh*yh - xl*yl)*b**n + yh*yl */
-void bigint_mul_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_mul_u(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        if(a->length_W==0 || b->length_W==0){
                bigint_set_zero(dest);
                return;
@@ -470,7 +470,7 @@ void bigint_mul_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_mul_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_mul_s(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint8_t s;
        s  = GET_SIGN(a)?2:0;
        s |= GET_SIGN(b)?1:0;
@@ -500,7 +500,7 @@ void bigint_mul_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /* square */
 /* (xh*b^n+xl)^2 = xh^2*b^2n + 2*xh*xl*b^n + xl^2 */
-void bigint_square(bigint_t* dest, const bigint_t* a){
+void bigint_square(bigint_t *dest, const bigint_t *a){
        if(a->length_W<=4){
                uint64_t r=0;
                memcpy(&r, a->wordv, a->length_W);
@@ -538,7 +538,7 @@ void bigint_square(bigint_t* dest, const bigint_t* a){
 
 /******************************************************************************/
 
-void bigint_sub_u_bitscale(bigint_t* a, const bigint_t* b, uint16_t bitscale){
+void bigint_sub_u_bitscale(bigint_t *a, const bigint_t *b, uint16_t bitscale){
        bigint_t tmp;
        uint8_t tmp_b[b->length_W+1];
        uint16_t i,j,byteshift=bitscale/8;
@@ -579,7 +579,7 @@ void bigint_sub_u_bitscale(bigint_t* a, const bigint_t* b, uint16_t bitscale){
 
 /******************************************************************************/
 
-void bigint_reduce(bigint_t* a, const bigint_t* r){
+void bigint_reduce(bigint_t *a, const bigint_t *r){
 //     bigint_adjust(r);
        uint8_t rfbs = GET_FBS(r);
 
@@ -602,7 +602,7 @@ void bigint_reduce(bigint_t* a, const bigint_t* r){
 
 /* calculate dest = a**exp % r */
 /* using square&multiply */
-void bigint_expmod_u(bigint_t* dest, const bigint_t* a, const bigint_t* exp, const bigint_t* r){
+void bigint_expmod_u(bigint_t *dest, const bigint_t *a, const bigint_t *exp, const bigint_t *r){
        if(a->length_W==0 || r->length_W==0){
                return;
        }
@@ -647,7 +647,7 @@ void bigint_expmod_u(bigint_t* dest, const bigint_t* a, const bigint_t* exp, con
 
 /******************************************************************************/
 /* gcd <-- gcd(x,y) a*x+b*y=gcd */
-void bigint_gcdext(bigint_t* gcd, bigint_t* a, bigint_t* b, const bigint_t* x, const bigint_t* y){
+void bigint_gcdext(bigint_t *gcd, bigint_t *a, bigint_t *b, const bigint_t *x, const bigint_t *y){
         bigint_t g, x_, y_, u, v, a_, b_, c_, d_;
         volatile uint16_t i=0;
         if(x->length_W==0 || y->length_W==0){
@@ -744,7 +744,7 @@ void bigint_gcdext(bigint_t* gcd, bigint_t* a, bigint_t* b, const bigint_t* x, c
 
 /******************************************************************************/
 
-void bigint_inverse(bigint_t* dest, const bigint_t* a, const bigint_t* m){
+void bigint_inverse(bigint_t *dest, const bigint_t *a, const bigint_t *m){
        bigint_gcdext(NULL, dest, NULL, a, m);
        while(dest->info&BIGINT_NEG_MASK){
                bigint_add_s(dest, dest, m);
@@ -753,7 +753,7 @@ void bigint_inverse(bigint_t* dest, const bigint_t* a, const bigint_t* m){
 
 /******************************************************************************/
 
-void bigint_changeendianess(bigint_ta){
+void bigint_changeendianess(bigint_t *a){
        uint8_t t, *p, *q;
        p = a->wordv;
        q = p+a->length_W-1;
index 7ba80b3180eee62ac09300b989e8404f85212617..bf854cc841496a355295fbcafbcf8fd9d8c00075 100644 (file)
@@ -61,7 +61,7 @@
 #define GET_SIGN(a) ((a)->info&BIGINT_NEG_MASK)
 
 /******************************************************************************/
-void bigint_adjust(bigint_ta){
+void bigint_adjust(bigint_t *a){
        while(a->length_W!=0 && a->wordv[a->length_W-1]==0){
                a->length_W--;
        }
@@ -81,7 +81,7 @@ void bigint_adjust(bigint_t* a){
 
 /******************************************************************************/
 
-uint16_t bigint_length_b(const bigint_ta){
+uint16_t bigint_length_b(const bigint_t *a){
        if(!a->length_W || a->length_W==0){
                return 0;
        }
@@ -90,13 +90,13 @@ uint16_t bigint_length_b(const bigint_t* a){
 
 /******************************************************************************/
 
-uint16_t bigint_length_B(const bigint_ta){
+uint16_t bigint_length_B(const bigint_t *a){
        return a->length_W * sizeof(bigint_word_t);
 }
 
 /******************************************************************************/
 
-uint32_t bigint_get_first_set_bit(const bigint_ta){
+uint32_t bigint_get_first_set_bit(const bigint_t *a){
        if(a->length_W==0){
                return (uint32_t)(-1);
        }
@@ -106,7 +106,7 @@ uint32_t bigint_get_first_set_bit(const bigint_t* a){
 
 /******************************************************************************/
 
-uint32_t bigint_get_last_set_bit(const bigint_ta){
+uint32_t bigint_get_last_set_bit(const bigint_t *a){
        uint32_t r=0;
        uint8_t b=0;
        bigint_word_t x=1;
@@ -128,7 +128,7 @@ uint32_t bigint_get_last_set_bit(const bigint_t* a){
 
 /******************************************************************************/
 
-void bigint_copy(bigint_t* dest, const bigint_t* src){
+void bigint_copy(bigint_t *dest, const bigint_t *src){
     if(dest->wordv != src->wordv){
            memcpy(dest->wordv, src->wordv, src->length_W * sizeof(bigint_word_t));
     }
@@ -139,7 +139,7 @@ void bigint_copy(bigint_t* dest, const bigint_t* src){
 /******************************************************************************/
 
 /* this should be implemented in assembly */
-void bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_add_u(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint16_t i;
        bigint_wordplus_t t = 0LL;
        if(a->length_W < b->length_W){
@@ -167,7 +167,7 @@ void bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 /******************************************************************************/
 
 /* this should be implemented in assembly */
-void bigint_add_scale_u(bigint_t* dest, const bigint_t* a, uint16_t scale){
+void bigint_add_scale_u(bigint_t *dest, const bigint_t *a, uint16_t scale){
        if(a->length_W == 0){
                return;
        }
@@ -218,7 +218,7 @@ void bigint_add_scale_u(bigint_t* dest, const bigint_t* a, uint16_t scale){
 /******************************************************************************/
 
 /* this should be implemented in assembly */
-void bigint_sub_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_sub_u(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        int8_t borrow=0;
        int8_t  r;
        bigint_wordplus_signed_t t=0LL;
@@ -263,7 +263,7 @@ void bigint_sub_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-int8_t bigint_cmp_u(const bigint_t* a, const bigint_t* b){
+int8_t bigint_cmp_u(const bigint_t *a, const bigint_t *b){
        if(a->length_W > b->length_W){
                return 1;
        }
@@ -289,7 +289,7 @@ int8_t bigint_cmp_u(const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_add_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_add_s(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint8_t s;
        s  = GET_SIGN(a)?2:0;
        s |= GET_SIGN(b)?1:0;
@@ -315,7 +315,7 @@ void bigint_add_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_sub_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_sub_s(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint8_t s;
        s  = GET_SIGN(a)?2:0;
        s |= GET_SIGN(b)?1:0;
@@ -342,7 +342,7 @@ void bigint_sub_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-int8_t bigint_cmp_s(const bigint_t* a, const bigint_t* b){
+int8_t bigint_cmp_s(const bigint_t *a, const bigint_t *b){
        uint8_t s;
        if(a->length_W==0 && b->length_W==0){
                return 0;
@@ -370,7 +370,7 @@ int8_t bigint_cmp_s(const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_shiftleft(bigint_ta, uint16_t shift){
+void bigint_shiftleft(bigint_t *a, uint16_t shift){
        uint16_t byteshift, words_to_shift;
        int16_t i;
        uint8_t bitshift;
@@ -408,7 +408,7 @@ void bigint_shiftleft(bigint_t* a, uint16_t shift){
 
 /******************************************************************************/
 
-void bigint_shiftright(bigint_ta, uint16_t shift){
+void bigint_shiftright(bigint_t *a, uint16_t shift){
        uint16_t byteshift;
        uint16_t i;
        uint8_t bitshift;
@@ -445,7 +445,7 @@ void bigint_shiftright(bigint_t* a, uint16_t shift){
 
 /******************************************************************************/
 
-void bigint_xor(bigint_t* dest, const bigint_t* a){
+void bigint_xor(bigint_t *dest, const bigint_t *a){
        uint16_t i;
        for(i=0; i<a->length_W; ++i){
                dest->wordv[i] ^= a->wordv[i];
@@ -455,7 +455,7 @@ void bigint_xor(bigint_t* dest, const bigint_t* a){
 
 /******************************************************************************/
 
-void bigint_set_zero(bigint_ta){
+void bigint_set_zero(bigint_t *a){
        a->length_W=0;
 }
 
@@ -463,7 +463,7 @@ void bigint_set_zero(bigint_t* a){
 
 /* using the Karatsuba-Algorithm */
 /* x*y = (xh*yh)*b**2n + ((xh+xl)*(yh+yl) - xh*yh - xl*yl)*b**n + yh*yl */
-void bigint_mul_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_mul_u(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        if(a->length_W == 0 || b->length_W == 0){
                bigint_set_zero(dest);
                return;
@@ -564,7 +564,7 @@ void bigint_mul_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){
 
 /******************************************************************************/
 
-void bigint_mul_s(bigint_t* dest, const bigint_t* a, const bigint_t* b){
+void bigint_mul_s(bigint_t *dest, const bigint_t *a, const bigint_t *b){
        uint8_t s;
        s  = GET_SIGN(a)?2:0;
        s |= GET_SIGN(b)?1:0;
@@ -599,7 +599,7 @@ unsigned square_depth = 0;
 
 /* square */
 /* (xh*b^n+xl)^2 = xh^2*b^2n + 2*xh*xl*b^n + xl^2 */
-void bigint_square(bigint_t* dest, const bigint_t* a){
+void bigint_square(bigint_t *dest, const bigint_t *a){
        if(a->length_W * sizeof(bigint_word_t) <= 4){
                uint64_t r = 0;
                memcpy(&r, a->wordv, a->length_W * sizeof(bigint_word_t));
@@ -684,7 +684,7 @@ void bigint_square(bigint_t* dest, const bigint_t* a){
 
 /******************************************************************************/
 
-void bigint_sub_u_bitscale(bigint_t* a, const bigint_t* b, uint16_t bitscale){
+void bigint_sub_u_bitscale(bigint_t *a, const bigint_t *b, uint16_t bitscale){
        bigint_t tmp, x;
        bigint_word_t tmp_b[b->length_W + 1];
        const uint16_t word_shift = bitscale / BIGINT_WORD_SIZE;
@@ -711,7 +711,7 @@ void bigint_sub_u_bitscale(bigint_t* a, const bigint_t* b, uint16_t bitscale){
 
 /******************************************************************************/
 
-void bigint_reduce(bigint_t* a, const bigint_t* r){
+void bigint_reduce(bigint_t *a, const bigint_t *r){
 //     bigint_adjust((bigint_t*)r);
        uint8_t rfbs = GET_FBS(r);
 #if DEBUG
@@ -772,7 +772,7 @@ void bigint_reduce(bigint_t* a, const bigint_t* r){
 
 /* calculate dest = a**exp % r */
 /* using square&multiply */
-void bigint_expmod_u_sam(bigint_t* dest, const bigint_t* a, const bigint_t* exp, const bigint_t* r){
+void bigint_expmod_u_sam(bigint_t *dest, const bigint_t *a, const bigint_t *exp, const bigint_t *r){
        if(a->length_W==0 || r->length_W==0){
                return;
        }
@@ -835,7 +835,7 @@ void bigint_expmod_u_sam(bigint_t* dest, const bigint_t* a, const bigint_t* exp,
 #define printf_P(...)
 #endif
 /* gcd <-- gcd(x,y) a*x+b*y=gcd */
-void bigint_gcdext(bigint_t* gcd, bigint_t* a, bigint_t* b, const bigint_t* x, const bigint_t* y){
+void bigint_gcdext(bigint_t *gcd, bigint_t *a, bigint_t *b, const bigint_t *x, const bigint_t *y){
         uint16_t i = 0;
         printf_P(PSTR("\nDBG: gcdext( "));
         bigint_print_hex(x);
@@ -1009,7 +1009,7 @@ void bigint_gcdext(bigint_t* gcd, bigint_t* a, bigint_t* b, const bigint_t* x, c
 
 /******************************************************************************/
 
-void bigint_inverse(bigint_t* dest, const bigint_t* a, const bigint_t* m){
+void bigint_inverse(bigint_t *dest, const bigint_t *a, const bigint_t *m){
        bigint_gcdext(NULL, dest, NULL, a, m);
        while(dest->info&BIGINT_NEG_MASK){
                bigint_add_s(dest, dest, m);
@@ -1018,7 +1018,7 @@ void bigint_inverse(bigint_t* dest, const bigint_t* a, const bigint_t* m){
 
 /******************************************************************************/
 
-void bigint_changeendianess(bigint_ta){
+void bigint_changeendianess(bigint_t *a){
        uint8_t t, *p, *q;
        p = (uint8_t*)(a->wordv);
        q = p + a->length_W * sizeof(bigint_word_t) - 1;
@@ -1037,7 +1037,7 @@ void bigint_changeendianess(bigint_t* a){
 
 /******************************************************************************/
 
-void bigint_expmod_u(bigint_t* dest, const bigint_t* a, const bigint_t* exp, const bigint_t* r){
+void bigint_expmod_u(bigint_t *dest, const bigint_t *a, const bigint_t *exp, const bigint_t *r){
     bigint_expmod_u_sam(dest, a, exp, r);
 }
 
index 0966f971f6eedc4fd054acd06dead2b0c9a75f94..59dcc353ed97b4450cadb94e8a274a88dc0a3a15 100644 (file)
@@ -47,32 +47,32 @@ typedef struct{
 
 /******************************************************************************/
 
-void   bigint_adjust(bigint_ta);
-uint32_t bigint_get_first_set_bit(const bigint_ta);
-uint32_t bigint_get_last_set_bit(const bigint_ta);
-uint16_t bigint_length_b(const bigint_ta);
-uint16_t bigint_length_B(const bigint_ta);
-void   bigint_copy(bigint_t* dest, const bigint_t* src);
-void   bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b);
-void   bigint_add_scale_u(bigint_t* dest, const bigint_t* a, uint16_t scale);
-void   bigint_sub_u(bigint_t* dest, const bigint_t* a, const bigint_t* b);
+void   bigint_adjust(bigint_t *a);
+uint32_t bigint_get_first_set_bit(const bigint_t *a);
+uint32_t bigint_get_last_set_bit(const bigint_t *a);
+uint16_t bigint_length_b(const bigint_t *a);
+uint16_t bigint_length_B(const bigint_t *a);
+void   bigint_copy(bigint_t *dest, const bigint_t *src);
+void   bigint_add_u(bigint_t *dest, const bigint_t *a, const bigint_t *b);
+void   bigint_add_scale_u(bigint_t *dest, const bigint_t *a, uint16_t scale);
+void   bigint_sub_u(bigint_t *dest, const bigint_t *a, const bigint_t *b);
 int8_t bigint_cmp_u(const bigint_t * a, const bigint_t * b);
-void   bigint_add_s(bigint_t* dest, const bigint_t* a, const bigint_t* b);
-void   bigint_sub_s(bigint_t* dest, const bigint_t* a, const bigint_t* b);
-int8_t bigint_cmp_s(const bigint_t* a, const bigint_t* b);
-void   bigint_shiftleft(bigint_ta, uint16_t shift);
-void   bigint_shiftright(bigint_ta, uint16_t shift);
-void   bigint_xor(bigint_t* dest, const bigint_t* a);
-void   bigint_set_zero(bigint_ta);
-void   bigint_mul_u(bigint_t* dest, const bigint_t* a, const bigint_t* b);
-void   bigint_mul_s(bigint_t* dest, const bigint_t* a, const bigint_t* b);
-void   bigint_square(bigint_t* dest, const bigint_t* a);
-void   bigint_sub_u_bitscale(bigint_t* a, const bigint_t* b, uint16_t bitscale);
-void   bigint_reduce(bigint_t* a, const bigint_t* r);
-void   bigint_expmod_u(bigint_t* dest, const bigint_t* a, const bigint_t* exp, const bigint_t* r);
-void   bigint_gcdext(bigint_t* gcd, bigint_t* a, bigint_t* b, const bigint_t* x, const bigint_t* y);
-void   bigint_inverse(bigint_t* dest, const bigint_t* a, const bigint_t* m);
-void   bigint_changeendianess(bigint_ta);
+void   bigint_add_s(bigint_t *dest, const bigint_t *a, const bigint_t *b);
+void   bigint_sub_s(bigint_t *dest, const bigint_t *a, const bigint_t *b);
+int8_t bigint_cmp_s(const bigint_t *a, const bigint_t *b);
+void   bigint_shiftleft(bigint_t *a, uint16_t shift);
+void   bigint_shiftright(bigint_t *a, uint16_t shift);
+void   bigint_xor(bigint_t *dest, const bigint_t *a);
+void   bigint_set_zero(bigint_t *a);
+void   bigint_mul_u(bigint_t *dest, const bigint_t *a, const bigint_t *b);
+void   bigint_mul_s(bigint_t *dest, const bigint_t *a, const bigint_t *b);
+void   bigint_square(bigint_t *dest, const bigint_t *a);
+void   bigint_sub_u_bitscale(bigint_t *a, const bigint_t *b, uint16_t bitscale);
+void   bigint_reduce(bigint_t *a, const bigint_t *r);
+void   bigint_expmod_u(bigint_t *dest, const bigint_t *a, const bigint_t *exp, const bigint_t *r);
+void   bigint_gcdext(bigint_t *gcd, bigint_t *a, bigint_t *b, const bigint_t *x, const bigint_t *y);
+void   bigint_inverse(bigint_t *dest, const bigint_t *a, const bigint_t *m);
+void   bigint_changeendianess(bigint_t *a);
 /******************************************************************************/
 
 #endif /*BIGINT_H_*/
index 56ff2a1e5c655953064bc7e3cf1f5912608d6b15..5bdfccaaf5a7980417202f3c313e83f6af5e1e26 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 /*
-void bigint_adjust(bigint_ta){
+void bigint_adjust(bigint_t *a){
        while(a->length_B!=0 && a->wordv[a->length_B-1]==0){
                a->length_B--;
        }
@@ -76,7 +76,7 @@ bigint_adjust_ret:
        ret
 
 /*
-void bigint_copy(bigint_t* dest, const bigint_t* src){
+void bigint_copy(bigint_t *dest, const bigint_t *src){
        memcpy(dest->wordv, src->wordv, src->length_B);
        dest->length_B = src->length_B;
        dest->info = src->info;
index 1942fa33e7ff0631d027ba7cf3df9faad8acf2e5..1fe05cb78d5a11a4a3de781a7b25c811c6a54dbf 100644 (file)
@@ -24,7 +24,7 @@
 
 /******************************************************************************/
 /*
-void bigint_add_scale_u(bigint_t* dest, const bigint_t* a, uint16_t scale){
+void bigint_add_scale_u(bigint_t *dest, const bigint_t *a, uint16_t scale){
        uint16_t i,j=0;
        uint16_t t=0;
        if(scale>dest->length_B)
index 9b942ea0f74d2e7d975c05e70df0635c8706030c..4ba078ef1f8220b815ed52793f1a1f606078bab1 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-void bigint_print_hex(const bigint_ta){
+void bigint_print_hex(const bigint_t *a){
        if(a->length_W==0){
                cli_putc('0');
                return;
@@ -94,7 +94,7 @@ static uint16_t read_byte(void){
        return (t1<<4)|t2;
 }
 
-uint8_t bigint_read_hex_echo(bigint_ta){
+uint8_t bigint_read_hex_echo(bigint_t *a){
        uint16_t allocated=0;
        uint8_t  shift4=0;
        uint16_t  t, idx = 0;
index e82247ecc65a9d4526ad12e22564081102008af0..2187ffea98cad3dcefcca5a44752c4db37fd6900 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "bigint.h"
 
-void    bigint_print_hex(const bigint_ta);
-uint8_t bigint_read_hex_echo(bigint_ta);
+void    bigint_print_hex(const bigint_t *a);
+uint8_t bigint_read_hex_echo(bigint_t *a);
 
 #endif /* BIGINT_IO_H_ */
index 9dc118bd1512cff454e24a3b581d31c64d2d12d6..916970e6d254f7ca0e836f1cd56c1e503786afe8 100644 (file)
@@ -33,7 +33,7 @@
 #include "blake_common.h"
 
 static
-uint64_t pgm_read_qword(const voidp){
+uint64_t pgm_read_qword(const void *p){
        union{
                uint64_t v64;
                uint32_t v32[2];
@@ -65,7 +65,7 @@ const uint64_t blake_c[] PROGMEM = {
                                                    (a)>>24 )
 
 static
-void blake_large_expand(uint64_t* v, const blake_large_ctx_t* ctx){
+void blake_large_expand(uint64_t *v, const blake_large_ctx_t *ctx){
        uint8_t i;
        memcpy(v, ctx->h, 8*8);
        for(i=0; i<8; ++i){
@@ -76,7 +76,7 @@ void blake_large_expand(uint64_t* v, const blake_large_ctx_t* ctx){
 }
 
 static
-void blake_large_changeendian(void* dest, const void* src){
+void blake_large_changeendian(void *dest, const void *src){
        uint8_t i;
        uint32_t tmp;
        for(i=0; i<32; i+=2){
@@ -87,7 +87,7 @@ void blake_large_changeendian(void* dest, const void* src){
 }
 
 static
-void blake_large_compress(uint64_t* v,const void* m){
+void blake_large_compress(uint64_t *v,const void *m){
        uint8_t r,i;
        uint8_t a,b,c,d, s0, s1, sigma_idx=0;
        for(r=0; r<16; ++r){
@@ -116,14 +116,14 @@ void blake_large_compress(uint64_t* v,const void* m){
 }
 
 static
-void blake_large_collapse(blake_large_ctx_t* ctx, uint64_t* v){
+void blake_large_collapse(blake_large_ctx_t *ctx, uint64_t *v){
        uint8_t i;
        for(i=0; i<8; ++i){
                ctx->h[i] ^= ctx->s[i%4] ^ v[i] ^ v[8+i];
        }
 }
 
-void blake_large_nextBlock(blake_large_ctx_t* ctx, const void* msg){
+void blake_large_nextBlock(blake_large_ctx_t *ctx, const void *msg){
        uint64_t v[16];
        uint64_t m[16];
        union {
@@ -140,7 +140,7 @@ void blake_large_nextBlock(blake_large_ctx_t* ctx, const void* msg){
        blake_large_collapse(ctx, v);
 }
 
-void blake_large_lastBlock(blake_large_ctx_t* ctx, const void* msg, uint16_t length_b){
+void blake_large_lastBlock(blake_large_ctx_t *ctx, const void *msg, uint16_t length_b){
        while(length_b>=BLAKE_LARGE_BLOCKSIZE){
                blake_large_nextBlock(ctx, msg);
                msg = (uint8_t*)msg + BLAKE_LARGE_BLOCKSIZE_B;
@@ -186,7 +186,7 @@ const uint64_t blake512_iv[] PROGMEM = {
     0x1F83D9ABFB41BD6BLL, 0x5BE0CD19137E2179LL
 };
 
-void blake512_init(blake512_ctx_tctx){
+void blake512_init(blake512_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<8; ++i){
                ctx->h[i] = pgm_read_qword(&(blake512_iv[i]));
@@ -203,7 +203,7 @@ const uint64_t blake384_iv[] PROGMEM = {
     0xDB0C2E0D64F98FA7LL, 0x47B5481DBEFA4FA4LL
 };
 
-void blake384_init(blake384_ctx_tctx){
+void blake384_init(blake384_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<8; ++i){
                ctx->h[i] = pgm_read_qword(&(blake384_iv[i]));
@@ -213,7 +213,7 @@ void blake384_init(blake384_ctx_t* ctx){
        ctx->appendone = 0;
 }
 
-void blake512_ctx2hash(void* dest, const blake512_ctx_t* ctx){
+void blake512_ctx2hash(void *dest, const blake512_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<8; ++i){
                ((uint32_t*)dest)[2*i+0] = CHANGE_ENDIAN32((ctx->h[i])>>32);
@@ -221,7 +221,7 @@ void blake512_ctx2hash(void* dest, const blake512_ctx_t* ctx){
        }
 }
 
-void blake384_ctx2hash(void* dest, const blake384_ctx_t* ctx){
+void blake384_ctx2hash(void *dest, const blake384_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<6; ++i){
                ((uint32_t*)dest)[2*i+0] = CHANGE_ENDIAN32((ctx->h[i])>>32);
@@ -229,23 +229,23 @@ void blake384_ctx2hash(void* dest, const blake384_ctx_t* ctx){
        }
 }
 
-void blake512_nextBlock(blake512_ctx_t* ctx, const void* block){
+void blake512_nextBlock(blake512_ctx_t *ctx, const void *block){
        blake_large_nextBlock(ctx, block);
 }
 
-void blake384_nextBlock(blake384_ctx_t* ctx, const void* block){
+void blake384_nextBlock(blake384_ctx_t *ctx, const void *block){
        blake_large_nextBlock(ctx, block);
 }
 
-void blake512_lastBlock(blake512_ctx_t* ctx, const void* block, uint16_t length_b){
+void blake512_lastBlock(blake512_ctx_t *ctx, const void *block, uint16_t length_b){
        blake_large_lastBlock(ctx, block, length_b);
 }
 
-void blake384_lastBlock(blake384_ctx_t* ctx, const void* block, uint16_t length_b){
+void blake384_lastBlock(blake384_ctx_t *ctx, const void *block, uint16_t length_b){
        blake_large_lastBlock(ctx, block, length_b);
 }
 
-void blake512(void* dest, const void* msg, uint32_t length_b){
+void blake512(void *dest, const void *msg, uint32_t length_b){
        blake_large_ctx_t ctx;
        blake512_init(&ctx);
        while(length_b>=BLAKE_LARGE_BLOCKSIZE){
@@ -257,7 +257,7 @@ void blake512(void* dest, const void* msg, uint32_t length_b){
        blake512_ctx2hash(dest, &ctx);
 }
 
-void blake384(void* dest, const void* msg, uint32_t length_b){
+void blake384(void *dest, const void *msg, uint32_t length_b){
        blake_large_ctx_t ctx;
        blake384_init(&ctx);
        while(length_b>=BLAKE_LARGE_BLOCKSIZE){
index 0ad66ea511121775e6d16aa9e670f65a31bc7592..472e164ddd8f70900a94252354ab2d96eca03276 100644 (file)
@@ -46,22 +46,22 @@ typedef struct {
 typedef blake_large_ctx_t blake384_ctx_t;
 typedef blake_large_ctx_t blake512_ctx_t;
 
-void blake384_init(blake384_ctx_tctx);
-void blake512_init(blake512_ctx_tctx);
+void blake384_init(blake384_ctx_t *ctx);
+void blake512_init(blake512_ctx_t *ctx);
 
-void blake_large_nextBlock(blake_large_ctx_t* ctx, const void* block);
-void blake_large_lastBlock(blake_large_ctx_t* ctx, const void* block, uint16_t length_b);
+void blake_large_nextBlock(blake_large_ctx_t *ctx, const void *block);
+void blake_large_lastBlock(blake_large_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void blake384_nextBlock(blake384_ctx_t* ctx, const void* block);
-void blake384_lastBlock(blake384_ctx_t* ctx, const void* block, uint16_t length_b);
+void blake384_nextBlock(blake384_ctx_t *ctx, const void *block);
+void blake384_lastBlock(blake384_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void blake512_nextBlock(blake512_ctx_t* ctx, const void* block);
-void blake512_lastBlock(blake512_ctx_t* ctx, const void* block, uint16_t length_b);
+void blake512_nextBlock(blake512_ctx_t *ctx, const void *block);
+void blake512_lastBlock(blake512_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void blake384_ctx2hash(void* dest, const blake384_ctx_t* ctx);
-void blake512_ctx2hash(void* dest, const blake512_ctx_t* ctx);
+void blake384_ctx2hash(void *dest, const blake384_ctx_t *ctx);
+void blake512_ctx2hash(void *dest, const blake512_ctx_t *ctx);
 
-void blake384(void* dest, const void* msg, uint32_t length_b);
-void blake512(void* dest, const void* msg, uint32_t length_b);
+void blake384(void *dest, const void *msg, uint32_t length_b);
+void blake512(void *dest, const void *msg, uint32_t length_b);
 
 #endif /* BLAKE_LARGE_H_ */
index fafea3994f5cf649216c968914b4086ed1c50a1b..9467b04e622641ee49e0b83fbe185a9ef94810e4 100644 (file)
@@ -51,7 +51,7 @@ const uint32_t blake_c[] PROGMEM = {
                                                    ((0x00ff0000&(a))>>8)| \
                                                    (a)>>24 )
 static
-void blake_small_expand(uint32_t* v, const blake_small_ctx_t* ctx){
+void blake_small_expand(uint32_t *v, const blake_small_ctx_t *ctx){
        uint8_t i;
        memcpy(v, ctx->h, 8*4);
        for(i=0; i<8; ++i){
@@ -62,7 +62,7 @@ void blake_small_expand(uint32_t* v, const blake_small_ctx_t* ctx){
 }
 
 static
-void blake_small_changeendian(void* dest, const void* src){
+void blake_small_changeendian(void *dest, const void *src){
        uint8_t i;
        for(i=0; i<16; ++i){
                ((uint32_t*)dest)[i] = CHANGE_ENDIAN32(((uint32_t*)src)[i]);
@@ -70,7 +70,7 @@ void blake_small_changeendian(void* dest, const void* src){
 }
 
 static
-void blake_small_compress(uint32_t* v,const void* m){
+void blake_small_compress(uint32_t *v,const void *m){
        uint8_t r,i;
        uint8_t a,b,c,d, s0, s1, sigma_idx=0;
        uint32_t lv[4];
@@ -109,14 +109,14 @@ void blake_small_compress(uint32_t* v,const void* m){
 }
 
 static
-void blake_small_collapse(blake_small_ctx_t* ctx, uint32_t* v){
+void blake_small_collapse(blake_small_ctx_t *ctx, uint32_t *v){
        uint8_t i;
        for(i=0; i<8; ++i){
                ctx->h[i] ^= ctx->s[i%4] ^ v[i] ^ v[8+i];
        }
 }
 
-void blake_small_nextBlock(blake_small_ctx_t* ctx, const void* msg){
+void blake_small_nextBlock(blake_small_ctx_t *ctx, const void *msg){
        uint32_t v[16];
        uint32_t m[16];
        union {
@@ -135,7 +135,7 @@ void blake_small_nextBlock(blake_small_ctx_t* ctx, const void* msg){
        blake_small_collapse(ctx, v);
 }
 
-void blake_small_lastBlock(blake_small_ctx_t* ctx, const void* msg, uint16_t length_b){
+void blake_small_lastBlock(blake_small_ctx_t *ctx, const void *msg, uint16_t length_b){
        while(length_b>=BLAKE_SMALL_BLOCKSIZE){
                blake_small_nextBlock(ctx, msg);
                msg = (uint8_t*)msg + BLAKE_SMALL_BLOCKSIZE_B;
@@ -189,7 +189,7 @@ const uint32_t blake256_iv[] PROGMEM = {
        0x1F83D9ABL, 0x5BE0CD19
 };
 
-void blake256_init(blake256_ctx_tctx){
+void blake256_init(blake256_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<8; ++i){
                ctx->h[i] = pgm_read_dword(&(blake256_iv[i]));
@@ -206,7 +206,7 @@ const uint32_t blake224_iv[] PROGMEM = {
        0x64F98FA7, 0xBEFA4FA4
 };
 
-void blake224_init(blake224_ctx_tctx){
+void blake224_init(blake224_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<8; ++i){
                ctx->h[i] = pgm_read_dword(&(blake224_iv[i]));
@@ -216,37 +216,37 @@ void blake224_init(blake224_ctx_t* ctx){
        ctx->appendone = 0;
 }
 
-void blake256_ctx2hash(void* dest, const blake256_ctx_t* ctx){
+void blake256_ctx2hash(void *dest, const blake256_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<8; ++i){
                ((uint32_t*)dest)[i] = CHANGE_ENDIAN32(ctx->h[i]);
        }
 }
 
-void blake224_ctx2hash(void* dest, const blake224_ctx_t* ctx){
+void blake224_ctx2hash(void *dest, const blake224_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<7; ++i){
                ((uint32_t*)dest)[i] = CHANGE_ENDIAN32(ctx->h[i]);
        }
 }
 
-void blake256_nextBlock(blake256_ctx_t* ctx, const void* block){
+void blake256_nextBlock(blake256_ctx_t *ctx, const void *block){
        blake_small_nextBlock(ctx, block);
 }
 
-void blake224_nextBlock(blake224_ctx_t* ctx, const void* block){
+void blake224_nextBlock(blake224_ctx_t *ctx, const void *block){
        blake_small_nextBlock(ctx, block);
 }
 
-void blake256_lastBlock(blake256_ctx_t* ctx, const void* block, uint16_t length_b){
+void blake256_lastBlock(blake256_ctx_t *ctx, const void *block, uint16_t length_b){
        blake_small_lastBlock(ctx, block, length_b);
 }
 
-void blake224_lastBlock(blake224_ctx_t* ctx, const void* block, uint16_t length_b){
+void blake224_lastBlock(blake224_ctx_t *ctx, const void *block, uint16_t length_b){
        blake_small_lastBlock(ctx, block, length_b);
 }
 
-void blake256(void* dest, const void* msg, uint32_t length_b){
+void blake256(void *dest, const void *msg, uint32_t length_b){
        blake_small_ctx_t ctx;
        blake256_init(&ctx);
        while(length_b>=BLAKE_SMALL_BLOCKSIZE){
@@ -258,7 +258,7 @@ void blake256(void* dest, const void* msg, uint32_t length_b){
        blake256_ctx2hash(dest, &ctx);
 }
 
-void blake224(void* dest, const void* msg, uint32_t length_b){
+void blake224(void *dest, const void *msg, uint32_t length_b){
        blake_small_ctx_t ctx;
        blake224_init(&ctx);
        while(length_b>=BLAKE_SMALL_BLOCKSIZE){
index 3d96cf7530c9c1058bba9e7d74429ca56b0a5fce..2fa49b17c101addca46373e728f9cda22e8f784f 100644 (file)
@@ -46,22 +46,22 @@ typedef struct {
 typedef blake_small_ctx_t blake224_ctx_t;
 typedef blake_small_ctx_t blake256_ctx_t;
 
-void blake224_init(blake224_ctx_tctx);
-void blake256_init(blake256_ctx_tctx);
+void blake224_init(blake224_ctx_t *ctx);
+void blake256_init(blake256_ctx_t *ctx);
 
-void blake_small_nextBlock(blake_small_ctx_t* ctx, const void* block);
-void blake_small_lastBlock(blake_small_ctx_t* ctx, const void* block, uint16_t length_b);
+void blake_small_nextBlock(blake_small_ctx_t *ctx, const void *block);
+void blake_small_lastBlock(blake_small_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void blake224_nextBlock(blake224_ctx_t* ctx, const void* block);
-void blake224_lastBlock(blake224_ctx_t* ctx, const void* block, uint16_t length_b);
+void blake224_nextBlock(blake224_ctx_t *ctx, const void *block);
+void blake224_lastBlock(blake224_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void blake256_nextBlock(blake256_ctx_t* ctx, const void* block);
-void blake256_lastBlock(blake256_ctx_t* ctx, const void* block, uint16_t length_b);
+void blake256_nextBlock(blake256_ctx_t *ctx, const void *block);
+void blake256_lastBlock(blake256_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void blake224_ctx2hash(void* dest, const blake224_ctx_t* ctx);
-void blake256_ctx2hash(void* dest, const blake256_ctx_t* ctx);
+void blake224_ctx2hash(void *dest, const blake224_ctx_t *ctx);
+void blake256_ctx2hash(void *dest, const blake256_ctx_t *ctx);
 
-void blake224(void* dest, const void* msg, uint32_t length_b);
-void blake256(void* dest, const void* msg, uint32_t length_b);
+void blake224(void *dest, const void *msg, uint32_t length_b);
+void blake256(void *dest, const void *msg, uint32_t length_b);
 
 #endif /* BLAKE_SMALL_H_ */
index 1fbeab8d04dba7e65573eadc852e8be94e79eee6..33a9ba3c71b18bd3efe22e996f34c55266699600 100644 (file)
@@ -90,7 +90,7 @@ typedef struct {
 } bcdesc_t; /* blockcipher descriptor type */
 
 typedef struct{
-       bcdesc_tdesc_ptr;
+       bcdesc_t *desc_ptr;
        uint16_t  keysize;
        void*     ctx;
 } bcgen_ctx_t;
index 5b3c65715abd0b23893cfe35504fe212b89481f8..8f4c1f65935bdd45bb4e9de4793b4e313bc4b8be 100644 (file)
@@ -279,7 +279,7 @@ f0_hacktable:
 
 
 /*******************************************************************************
-* uint32_t addelment(uint8_t j, const uint32_t* m, const uint32_t* h){
+* uint32_t addelment(uint8_t j, const uint32_t *m, const uint32_t *h){
 *      uint32_t r;
 *      r  = pgm_read_dword(k_lut+j);
 *      r += rotl_addel(((uint32_t*)m)[j&0xf], j+0);
@@ -1017,7 +1017,7 @@ bmw256_lastBlock:
 
 
 /*******************************************************************************
-* void bmw224_ctx2hash(void* dest, const bmw224_ctx_t* ctx){
+* void bmw224_ctx2hash(void *dest, const bmw224_ctx_t *ctx){
 *      memcpy(dest, &(ctx->h[9]), 224/8);
 * }
 *
@@ -1038,7 +1038,7 @@ bmw224_ctx2hash:
 
 
 /*******************************************************************************
-* void bmw224(void* dest, const void* msg, uint32_t length_b){
+* void bmw224(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw224_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
@@ -1102,7 +1102,7 @@ bmw224:
        rjmp pop9
 
 /*******************************************************************************
-* void bmw224_init(bmw224_ctx_tctx){
+* void bmw224_init(bmw224_ctx_t *ctx){
 *      uint8_t i;
 *      ctx->h[0] = 0x00010203;
 *      for(i=1; i<16; ++i){
index ef23de2b56d01050385e3b95979dd656d5ba4ec6..fbef4694c5c80af94d755bab121c225715e01714 100644 (file)
@@ -279,7 +279,7 @@ f0_hacktable:
 
 
 /*******************************************************************************
-* uint32_t addelment(uint8_t j, const uint32_t* m, const uint32_t* h){
+* uint32_t addelment(uint8_t j, const uint32_t *m, const uint32_t *h){
 *      uint32_t r;
 *      r  = pgm_read_dword(k_lut+j);
 *      r += rotl_addel(((uint32_t*)m)[j&0xf], j+0);
@@ -1019,7 +1019,7 @@ bmw256_lastBlock:
 
 
 /*******************************************************************************
-* void bmw256_ctx2hash(void* dest, const bmw256_ctx_t* ctx){
+* void bmw256_ctx2hash(void *dest, const bmw256_ctx_t *ctx){
 *      memcpy(dest, &(ctx->h[8]), 256/8);
 * }
 *
@@ -1039,7 +1039,7 @@ bmw256_ctx2hash:
        ret
 
 /*******************************************************************************
-* void bmw256(void* dest, const void* msg, uint32_t length_b){
+* void bmw256(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw256_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
@@ -1068,7 +1068,7 @@ dst1 =  11
 
 
 /*******************************************************************************
-* void bmw224(void* dest, const void* msg, uint32_t length_b){
+* void bmw224(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw224_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
index 45a449fdc1f22bd106b02496ce13bbbc1f91c519..d247273efb2b9a89e905a5bcbc476040b5971f99 100644 (file)
@@ -43,7 +43,7 @@
 #if DEBUG
  #include "cli.h"
 
- void ctx_dump(const bmw_large_ctx_tctx){
+ void ctx_dump(const bmw_large_ctx_t *ctx){
        uint8_t i;
        cli_putstr_P(PSTR("\r\n==== ctx dump ===="));
        for(i=0; i<16;++i){
@@ -56,7 +56,7 @@
        cli_hexdump(&(ctx->counter), 4);
  }
 
- void dump_x(const uint64_tq, uint8_t elements, char x){
+ void dump_x(const uint64_t *q, uint8_t elements, char x){
        uint8_t i;
        cli_putstr_P(PSTR("\r\n==== "));
        cli_putc(x);
@@ -220,7 +220,7 @@ const uint64_t k_lut[] PROGMEM = {
        0xa55555555555554bLL };
 
 static
-uint64_t bmw_large_expand1(uint8_t j, const uint64_t* q, const void* m, const void* h){
+uint64_t bmw_large_expand1(uint8_t j, const uint64_t *q, const void *m, const void *h){
        uint64_t(*s[])(uint64_t) = {bmw_large_s1, bmw_large_s2, bmw_large_s3, bmw_large_s0};
        uint64_t a = 0;
        union{
@@ -250,7 +250,7 @@ uint64_t bmw_large_expand1(uint8_t j, const uint64_t* q, const void* m, const vo
 }
 
 static
-uint64_t bmw_large_expand2(uint8_t j, const uint64_t* q, const void* m, const void* h){
+uint64_t bmw_large_expand2(uint8_t j, const uint64_t *q, const void *m, const void *h){
        uint64_t(*rf[])(uint64_t) = {bmw_large_r1, bmw_large_r2, bmw_large_r3,
                                     bmw_large_r4, bmw_large_r5, bmw_large_r6,
                                                             bmw_large_r7};
@@ -313,7 +313,7 @@ static const uint8_t  offset_table[5] PROGMEM = { 4+16, 6+16, 9+16, 12+16, 13+16
 
 
 static
-void bmw_large_f0(uint64_t* q, const uint64_t* h, const void* m){
+void bmw_large_f0(uint64_t *q, const uint64_t *h, const void *m){
        uint16_t hack_reg;
        uint8_t i,j,c;
        uint64_t(*s[])(uint64_t)={ bmw_large_s0, bmw_large_s1, bmw_large_s2,
@@ -375,7 +375,7 @@ const uint8_t f0_lut[] PROGMEM ={
 };
 
 static
-void bmw_large_f0(uint64_t* q, const uint64_t* h, const void* m){
+void bmw_large_f0(uint64_t *q, const uint64_t *h, const void *m){
        uint8_t i,j=-1,v,sign,l=0;
        uint64_t(*s[])(uint64_t)={ bmw_large_s0, bmw_large_s1, bmw_large_s2,
                                   bmw_large_s3, bmw_large_s4 };
@@ -417,7 +417,7 @@ void bmw_large_f0(uint64_t* q, const uint64_t* h, const void* m){
 
 #if F0_HACK==0
 static
-void bmw_large_f0(uint64_t* q, const uint64_t* h, const void* m){
+void bmw_large_f0(uint64_t *q, const uint64_t *h, const void *m){
        uint8_t i;
        uint64_t(*s[])(uint64_t)={ bmw_large_s0, bmw_large_s1, bmw_large_s2,
                                   bmw_large_s3, bmw_large_s4 };
@@ -458,7 +458,7 @@ void bmw_large_f0(uint64_t* q, const uint64_t* h, const void* m){
 #endif /* F0_HACK==0 */
 
 static
-void bmw_large_f1(uint64_t* q, const void* m, const uint64_t* h){
+void bmw_large_f1(uint64_t *q, const void *m, const uint64_t *h){
        uint8_t i;
        q[16] = bmw_large_expand1(0, q, m, h);
        q[17] = bmw_large_expand1(1, q, m, h);
@@ -468,7 +468,7 @@ void bmw_large_f1(uint64_t* q, const void* m, const uint64_t* h){
 }
 
 static
-void bmw_large_f2(uint64_t* h, const uint64_t* q, const void* m){
+void bmw_large_f2(uint64_t *h, const uint64_t *q, const void *m){
        uint64_t xl=0, xh;
        uint8_t i;
        for(i=16;i<24;++i){
@@ -510,7 +510,7 @@ void bmw_large_f2(uint64_t* h, const uint64_t* q, const void* m){
        h[15] += SHR64(xl, 2) ^ q[22] ^ q[15];
 }
 
-void bmw_large_nextBlock(bmw_large_ctx_t* ctx, const void* block){
+void bmw_large_nextBlock(bmw_large_ctx_t *ctx, const void *block){
        uint64_t q[32];
        dump_x(block, 16, 'M');
        bmw_large_f0(q, ctx->h, block);
@@ -522,7 +522,7 @@ void bmw_large_nextBlock(bmw_large_ctx_t* ctx, const void* block){
        ctx_dump(ctx);
 }
 
-void bmw_large_lastBlock(bmw_large_ctx_t* ctx, const void* block, uint16_t length_b){
+void bmw_large_lastBlock(bmw_large_ctx_t *ctx, const void *block, uint16_t length_b){
        union {
                uint8_t   v8[128];
                uint64_t v64[ 16];
@@ -556,7 +556,7 @@ void bmw_large_lastBlock(bmw_large_ctx_t* ctx, const void* block, uint16_t lengt
 #endif
 }
 
-void bmw384_init(bmw384_ctx_tctx){
+void bmw384_init(bmw384_ctx_t *ctx){
        uint8_t i;
        ctx->h[0] = 0x0001020304050607LL;
        for(i=1; i<16; ++i){
@@ -569,7 +569,7 @@ void bmw384_init(bmw384_ctx_t* ctx){
        ctx_dump(ctx);
 }
 
-void bmw512_init(bmw512_ctx_tctx){
+void bmw512_init(bmw512_ctx_t *ctx){
        uint8_t i;
        ctx->h[0] = 0x8081828384858687LL;
        for(i=1; i<16; ++i){
@@ -579,31 +579,31 @@ void bmw512_init(bmw512_ctx_t* ctx){
        ctx_dump(ctx);
 }
 
-void bmw384_nextBlock(bmw384_ctx_t* ctx, const void* block){
+void bmw384_nextBlock(bmw384_ctx_t *ctx, const void *block){
        bmw_large_nextBlock(ctx, block);
 }
 
-void bmw512_nextBlock(bmw512_ctx_t* ctx, const void* block){
+void bmw512_nextBlock(bmw512_ctx_t *ctx, const void *block){
        bmw_large_nextBlock(ctx, block);
 }
 
-void bmw384_lastBlock(bmw384_ctx_t* ctx, const void* block, uint16_t length_b){
+void bmw384_lastBlock(bmw384_ctx_t *ctx, const void *block, uint16_t length_b){
        bmw_large_lastBlock(ctx, block, length_b);
 }
 
-void bmw512_lastBlock(bmw512_ctx_t* ctx, const void* block, uint16_t length_b){
+void bmw512_lastBlock(bmw512_ctx_t *ctx, const void *block, uint16_t length_b){
        bmw_large_lastBlock(ctx, block, length_b);
 }
 
-void bmw384_ctx2hash(void* dest, const bmw384_ctx_t* ctx){
+void bmw384_ctx2hash(void *dest, const bmw384_ctx_t *ctx){
        memcpy(dest, &(ctx->h[10]), 384/8);
 }
 
-void bmw512_ctx2hash(void* dest, const bmw512_ctx_t* ctx){
+void bmw512_ctx2hash(void *dest, const bmw512_ctx_t *ctx){
        memcpy(dest, &(ctx->h[8]), 512/8);
 }
 
-void bmw384(void* dest, const void* msg, uint32_t length_b){
+void bmw384(void *dest, const void *msg, uint32_t length_b){
        bmw_large_ctx_t ctx;
        bmw384_init(&ctx);
        while(length_b>=BMW_LARGE_BLOCKSIZE){
@@ -615,7 +615,7 @@ void bmw384(void* dest, const void* msg, uint32_t length_b){
        bmw384_ctx2hash(dest, &ctx);
 }
 
-void bmw512(void* dest, const void* msg, uint32_t length_b){
+void bmw512(void *dest, const void *msg, uint32_t length_b){
        bmw_large_ctx_t ctx;
        bmw512_init(&ctx);
        while(length_b>=BMW_LARGE_BLOCKSIZE){
index fba01fbf2b4a2a1c1df13af0b93548df470775fc..a810b188a64ca210638082cdaea57a18b4f18695 100644 (file)
@@ -44,22 +44,22 @@ typedef struct {
 typedef bmw_large_ctx_t bmw384_ctx_t;
 typedef bmw_large_ctx_t bmw512_ctx_t;
 
-void bmw384_init(bmw384_ctx_tctx);
-void bmw512_init(bmw512_ctx_tctx);
+void bmw384_init(bmw384_ctx_t *ctx);
+void bmw512_init(bmw512_ctx_t *ctx);
 
-void bmw_large_nextBlock(bmw_large_ctx_t* ctx, const void* block);
-void bmw_large_lastBlock(bmw_large_ctx_t* ctx, const void* block, uint16_t length_b);
+void bmw_large_nextBlock(bmw_large_ctx_t *ctx, const void *block);
+void bmw_large_lastBlock(bmw_large_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void bmw384_nextBlock(bmw384_ctx_t* ctx, const void* block);
-void bmw384_lastBlock(bmw384_ctx_t* ctx, const void* block, uint16_t length_b);
+void bmw384_nextBlock(bmw384_ctx_t *ctx, const void *block);
+void bmw384_lastBlock(bmw384_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void bmw512_nextBlock(bmw512_ctx_t* ctx, const void* block);
-void bmw512_lastBlock(bmw512_ctx_t* ctx, const void* block, uint16_t length_b);
+void bmw512_nextBlock(bmw512_ctx_t *ctx, const void *block);
+void bmw512_lastBlock(bmw512_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void bmw384_ctx2hash(void* dest, const bmw384_ctx_t* ctx);
-void bmw512_ctx2hash(void* dest, const bmw512_ctx_t* ctx);
+void bmw384_ctx2hash(void *dest, const bmw384_ctx_t *ctx);
+void bmw512_ctx2hash(void *dest, const bmw512_ctx_t *ctx);
 
-void bmw384(void* dest, const void* msg, uint32_t length_b);
-void bmw512(void* dest, const void* msg, uint32_t length_b);
+void bmw384(void *dest, const void *msg, uint32_t length_b);
+void bmw512(void *dest, const void *msg, uint32_t length_b);
 
 #endif /* BMW_LARGE_H_ */
index ce8518d93a6f8f5fa0aa9095b48866c7dbfef435..e8902e158f8e588b52118d1b415ae73c1c67ba33 100644 (file)
@@ -510,7 +510,7 @@ const_lut:
        .long 0x9555554c, 0x9aaaaaa1, 0x9ffffff6, 0xa555554b
 
 /*******************************************************************************
-* uint32_t addelment(uint8_t j, const uint32_t* m, const uint32_t* h){
+* uint32_t addelment(uint8_t j, const uint32_t *m, const uint32_t *h){
 *      uint32_t r;
 *      r  = pgm_read_dword(k_lut+j);
 *      r += rotl_addel(((uint32_t*)m)[j&0xf], j+0);
@@ -625,7 +625,7 @@ addelement:
        ret
 
 /*******************************************************************************
-* uint32_t bmw_small_expand1(uint8_t j, const void* m, const void* h, const uint32_t* q){
+* uint32_t bmw_small_expand1(uint8_t j, const void *m, const void *h, const uint32_t *q){
 *      uint32_t(*s[])(uint32_t) = {bmw_small_s1, bmw_small_s2, bmw_small_s3, bmw_small_s0};
 *      uint32_t r;
 *      uint8_t i;
@@ -708,7 +708,7 @@ expand1_exit:
        ret
 
 /*******************************************************************************
-* uint32_t bmw_small_expand2(uint8_t j, const void* m, const void* h, const uint32_t* q){
+* uint32_t bmw_small_expand2(uint8_t j, const void *m, const void *h, const uint32_t *q){
 *      uint32_t(*rf[])(uint32_t) = {bmw_small_r1, bmw_small_r2, bmw_small_r3,
 *                                   bmw_small_r4, bmw_small_r5, bmw_small_r6,
 *                                                           bmw_small_r7};
@@ -781,7 +781,7 @@ bmw_small_expand2:
        rjmp expand1_exit
 
 /*******************************************************************************
-* void bmw_small_f1(uint32_t* q, const void* m, const void* h){
+* void bmw_small_f1(uint32_t *q, const void *m, const void *h){
 *      uint8_t i;
 *      q[16] = bmw_small_expand1(0, m, h, q);
 *      q[17] = bmw_small_expand1(1, m, h, q);
@@ -849,7 +849,7 @@ bmw_small_f1:
 * uint16_t hack_table[5]   PROGMEM = { 0x0311, 0xDDB3, 0x2A79, 0x07AA, 0x51C2 };
 * uint8_t  offset_table[5] PROGMEM = { 4+16, 6+16, 9+16, 12+16, 13+16 };
 *
-* void bmw_small_f0(uint32_t* h, const void* m, uint32_t* q){
+* void bmw_small_f0(uint32_t *h, const void *m, uint32_t *q){
 *      uint16_t hack_reg;
 *      uint8_t c,i,j;
 *      uint32_t(*s[])(uint32_t)={ bmw_small_s0, bmw_small_s1, bmw_small_s2,
@@ -1109,7 +1109,7 @@ bmw_small_f0:
     ret
 
 /*******************************************************************************
-* void bmw_small_f2(uint32_t* h, const uint32_t* q, const void* m){
+* void bmw_small_f2(uint32_t *h, const uint32_t *q, const void *m){
 *      uint32_t xl=0, xh;
 *      uint8_t i;
 *      for(i=16;i<24;++i){
@@ -1699,7 +1699,7 @@ cli_putchar:
 #endif
 
 /*******************************************************************************
-* void bmw_small_nextBlock(bmw_small_ctx_t* ctx, const void* block){
+* void bmw_small_nextBlock(bmw_small_ctx_t *ctx, const void *block){
 *      uint32_t q[32];
 *      dump_x(block, 16, 'M');
 *      bmw_small_f0(ctx->h, block, q);
@@ -1769,7 +1769,7 @@ bmw256_nextBlock:
 
 
 /*******************************************************************************
-* void bmw224_init(bmw224_ctx_tctx){
+* void bmw224_init(bmw224_ctx_t *ctx){
 *      uint8_t i;
 *      ctx->h[0] = 0x00010203;
 *      for(i=1; i<16; ++i){
@@ -1821,7 +1821,7 @@ bmw256_init:
        rjmp bmw_small_init
 
 /*******************************************************************************
-* void bmw_small_lastBlock(bmw_small_ctx_t* ctx, const void* block, uint16_t length_b){
+* void bmw_small_lastBlock(bmw_small_ctx_t *ctx, const void *block, uint16_t length_b){
 *      struct {
 *              uint8_t  buffer[64];
 *              uint32_t ctr;
@@ -2041,7 +2041,7 @@ bmw256_lastBlock:
        ret
 
 /*******************************************************************************
-* void bmw224_ctx2hash(void* dest, const bmw224_ctx_t* ctx){
+* void bmw224_ctx2hash(void *dest, const bmw224_ctx_t *ctx){
 *      memcpy(dest, &(ctx->h[9]), 224/8);
 * }
 *
@@ -2057,7 +2057,7 @@ bmw224_ctx2hash:
        rjmp 1f
 
 /*******************************************************************************
-* void bmw256_ctx2hash(void* dest, const bmw256_ctx_t* ctx){
+* void bmw256_ctx2hash(void *dest, const bmw256_ctx_t *ctx){
 *      memcpy(dest, &(ctx->h[8]), 256/8);
 * }
 *
@@ -2078,7 +2078,7 @@ bmw256_ctx2hash:
        ret
 
 /*******************************************************************************
-* void bmw256(void* dest, const void* msg, uint32_t length_b){
+* void bmw256(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw256_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
@@ -2111,7 +2111,7 @@ bmw256:
        rjmp bmw_small_all
 
 /*******************************************************************************
-* void bmw224(void* dest, const void* msg, uint32_t length_b){
+* void bmw224(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw224_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
index fec6bb0fc42762f7794c77c464e6b1687ba07d6d..ad4ee95ad1621378b484c646ed26f94df30af481 100644 (file)
@@ -279,7 +279,7 @@ f0_hacktable:
 
 
 /*******************************************************************************
-* uint32_t addelment(uint8_t j, const uint32_t* m, const uint32_t* h){
+* uint32_t addelment(uint8_t j, const uint32_t *m, const uint32_t *h){
 *      uint32_t r;
 *      r  = pgm_read_dword(k_lut+j);
 *      r += rotl_addel(((uint32_t*)m)[j&0xf], j+0);
@@ -1021,7 +1021,7 @@ bmw256_lastBlock:
 
 
 /*******************************************************************************
-* void bmw224_ctx2hash(void* dest, const bmw224_ctx_t* ctx){
+* void bmw224_ctx2hash(void *dest, const bmw224_ctx_t *ctx){
 *      memcpy(dest, &(ctx->h[9]), 224/8);
 * }
 *
@@ -1036,7 +1036,7 @@ bmw224_ctx2hash:
        rjmp 1f
 
 /*******************************************************************************
-* void bmw256_ctx2hash(void* dest, const bmw256_ctx_t* ctx){
+* void bmw256_ctx2hash(void *dest, const bmw256_ctx_t *ctx){
 *      memcpy(dest, &(ctx->h[8]), 256/8);
 * }
 *
@@ -1056,7 +1056,7 @@ bmw256_ctx2hash:
        ret
 
 /*******************************************************************************
-* void bmw256(void* dest, const void* msg, uint32_t length_b){
+* void bmw256(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw256_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
@@ -1089,7 +1089,7 @@ bmw256:
 
 
 /*******************************************************************************
-* void bmw224(void* dest, const void* msg, uint32_t length_b){
+* void bmw224(void *dest, const void *msg, uint32_t length_b){
 *      bmw_small_ctx_t ctx;
 *      bmw224_init(&ctx);
 *      while(length_b>=BMW_SMALL_BLOCKSIZE){
@@ -1177,7 +1177,7 @@ c2h_lut:
        rjmp bmw256_ctx2hash
 
 /*******************************************************************************
-* void bmw224_init(bmw224_ctx_tctx){
+* void bmw224_init(bmw224_ctx_t *ctx){
 *      uint8_t i;
 *      ctx->h[0] = 0x00010203;
 *      for(i=1; i<16; ++i){
index b41e923ac2f8d0776951c485667e0fdeee80c571..b807e1562b3d215c252350691aa4ee73e46a9120 100644 (file)
@@ -56,7 +56,7 @@
 #if DEBUG
  #include "cli.h"
 
- void ctx_dump(const bmw_small_ctx_tctx){
+ void ctx_dump(const bmw_small_ctx_t *ctx){
        uint8_t i;
        cli_putstr_P(PSTR("\r\n==== ctx dump ===="));
        for(i=0; i<16;++i){
@@ -69,7 +69,7 @@
        cli_hexdump(&(ctx->counter), 4);
  }
 
- void dump_x(const uint32_tq, uint8_t elements, char x){
+ void dump_x(const uint32_t *q, uint8_t elements, char x){
        uint8_t i;
        cli_putstr_P(PSTR("\r\n==== "));
        cli_putc(x);
@@ -212,7 +212,7 @@ const uint32_t k_lut[] PROGMEM = {
        0xa555554bL };
 
 static
-uint32_t bmw_small_expand1(uint8_t j, const uint32_t* q, const void* m, const void* h){
+uint32_t bmw_small_expand1(uint8_t j, const uint32_t *q, const void *m, const void *h){
        uint32_t(*s[])(uint32_t) = {bmw_small_s1, bmw_small_s2, bmw_small_s3, bmw_small_s0};
        uint32_t r;
        uint8_t i;
@@ -237,7 +237,7 @@ uint32_t bmw_small_expand1(uint8_t j, const uint32_t* q, const void* m, const vo
 }
 
 static
-uint32_t bmw_small_expand2(uint8_t j, const uint32_t* q, const void* m, const void* h){
+uint32_t bmw_small_expand2(uint8_t j, const uint32_t *q, const void *m, const void *h){
        uint32_t(*rf[])(uint32_t) = {bmw_small_r1, bmw_small_r2, bmw_small_r3,
                                     bmw_small_r4, bmw_small_r5, bmw_small_r6,
                                                             bmw_small_r7};
@@ -277,7 +277,7 @@ static const uint16_t hack_table[5] PROGMEM = { 0x0311, 0xDDB3, 0x2A79, 0x07AA,
 static const uint8_t  offset_table[5] PROGMEM = { 4+16, 6+16, 9+16, 12+16, 13+16 };
 
 static
-void bmw_small_f0(uint32_t* q, uint32_t* h, const void* m){
+void bmw_small_f0(uint32_t *q, uint32_t *h, const void *m){
        uint16_t hack_reg;
        uint8_t c,i,j;
        uint32_t(*s[])(uint32_t)={ bmw_small_s0, bmw_small_s1, bmw_small_s2,
@@ -339,7 +339,7 @@ const uint8_t f0_lut[] PROGMEM = {
 };
 
 static
-void bmw_small_f0(uint32_t* q, uint32_t* h, const void* m){
+void bmw_small_f0(uint32_t *q, uint32_t *h, const void *m){
        uint8_t i,j=-1,v,sign,l=0;
        uint32_t(*s[])(uint32_t)={ bmw_small_s0, bmw_small_s1, bmw_small_s2,
                                   bmw_small_s3, bmw_small_s4 };
@@ -381,7 +381,7 @@ void bmw_small_f0(uint32_t* q, uint32_t* h, const void* m){
 
 #if F0_HACK==0
 static
-void bmw_small_f0(uint32_t* q, uint32_t* h, const void* m){
+void bmw_small_f0(uint32_t *q, uint32_t *h, const void *m){
        uint8_t i;
        uint32_t(*s[])(uint32_t)={ bmw_small_s0, bmw_small_s1, bmw_small_s2,
                                   bmw_small_s3, bmw_small_s4 };
@@ -421,7 +421,7 @@ void bmw_small_f0(uint32_t* q, uint32_t* h, const void* m){
 #endif /* F0_HACK==0 */
 
 static
-void bmw_small_f1(uint32_t* q, const void* m, const void* h){
+void bmw_small_f1(uint32_t *q, const void *m, const void *h){
        uint8_t i;
        q[16] = bmw_small_expand1(0, q, m, h);
        q[17] = bmw_small_expand1(1, q, m, h);
@@ -431,7 +431,7 @@ void bmw_small_f1(uint32_t* q, const void* m, const void* h){
 }
 
 static
-void bmw_small_f2(uint32_t* h, uint32_t* q, const void* m){
+void bmw_small_f2(uint32_t *h, uint32_t *q, const void *m){
        uint32_t xl=0, xh;
        uint8_t i;
        for(i=16;i<24;++i){
@@ -486,7 +486,7 @@ void bmw_small_f2(uint32_t* h, uint32_t* q, const void* m){
 
 }
 
-void bmw_small_nextBlock(bmw_small_ctx_t* ctx, const void* block){
+void bmw_small_nextBlock(bmw_small_ctx_t *ctx, const void *block){
        uint32_t q[32];
        dump_x(block, 16, 'M');
        bmw_small_f0(q, ctx->h, block);
@@ -498,7 +498,7 @@ void bmw_small_nextBlock(bmw_small_ctx_t* ctx, const void* block){
        ctx_dump(ctx);
 }
 
-void bmw_small_lastBlock(bmw_small_ctx_t* ctx, const void* block, uint16_t length_b){
+void bmw_small_lastBlock(bmw_small_ctx_t *ctx, const void *block, uint16_t length_b){
        union {
                uint8_t   v8[64];
                uint32_t v32[16];
@@ -538,7 +538,7 @@ void bmw_small_lastBlock(bmw_small_ctx_t* ctx, const void* block, uint16_t lengt
 #endif
 }
 
-void bmw224_init(bmw224_ctx_tctx){
+void bmw224_init(bmw224_ctx_t *ctx){
        uint8_t i;
        ctx->h[0] = 0x00010203;
        for(i=1; i<16; ++i){
@@ -551,7 +551,7 @@ void bmw224_init(bmw224_ctx_t* ctx){
        ctx_dump(ctx);
 }
 
-void bmw256_init(bmw256_ctx_tctx){
+void bmw256_init(bmw256_ctx_t *ctx){
        uint8_t i;
        ctx->h[0] = 0x40414243;
        for(i=1; i<16; ++i){
@@ -561,31 +561,31 @@ void bmw256_init(bmw256_ctx_t* ctx){
        ctx_dump(ctx);
 }
 
-void bmw224_nextBlock(bmw224_ctx_t* ctx, const void* block){
+void bmw224_nextBlock(bmw224_ctx_t *ctx, const void *block){
        bmw_small_nextBlock(ctx, block);
 }
 
-void bmw256_nextBlock(bmw256_ctx_t* ctx, const void* block){
+void bmw256_nextBlock(bmw256_ctx_t *ctx, const void *block){
        bmw_small_nextBlock(ctx, block);
 }
 
-void bmw224_lastBlock(bmw224_ctx_t* ctx, const void* block, uint16_t length_b){
+void bmw224_lastBlock(bmw224_ctx_t *ctx, const void *block, uint16_t length_b){
        bmw_small_lastBlock(ctx, block, length_b);
 }
 
-void bmw256_lastBlock(bmw256_ctx_t* ctx, const void* block, uint16_t length_b){
+void bmw256_lastBlock(bmw256_ctx_t *ctx, const void *block, uint16_t length_b){
        bmw_small_lastBlock(ctx, block, length_b);
 }
 
-void bmw224_ctx2hash(void* dest, const bmw224_ctx_t* ctx){
+void bmw224_ctx2hash(void *dest, const bmw224_ctx_t *ctx){
        memcpy(dest, &(ctx->h[9]), 224/8);
 }
 
-void bmw256_ctx2hash(void* dest, const bmw256_ctx_t* ctx){
+void bmw256_ctx2hash(void *dest, const bmw256_ctx_t *ctx){
        memcpy(dest, &(ctx->h[8]), 256/8);
 }
 
-void bmw224(void* dest, const void* msg, uint32_t length_b){
+void bmw224(void *dest, const void *msg, uint32_t length_b){
        bmw_small_ctx_t ctx;
        bmw224_init(&ctx);
        while(length_b>=BMW_SMALL_BLOCKSIZE){
@@ -597,7 +597,7 @@ void bmw224(void* dest, const void* msg, uint32_t length_b){
        bmw224_ctx2hash(dest, &ctx);
 }
 
-void bmw256(void* dest, const void* msg, uint32_t length_b){
+void bmw256(void *dest, const void *msg, uint32_t length_b){
        bmw_small_ctx_t ctx;
        bmw256_init(&ctx);
        while(length_b>=BMW_SMALL_BLOCKSIZE){
index f314712248920f8439e70c703cf33ada66acd44f..4f875086aef1057c480f98ffd45e19473f5b0466 100644 (file)
@@ -44,22 +44,22 @@ typedef struct {
 typedef bmw_small_ctx_t bmw224_ctx_t;
 typedef bmw_small_ctx_t bmw256_ctx_t;
 
-void bmw224_init(bmw224_ctx_tctx);
-void bmw256_init(bmw256_ctx_tctx);
+void bmw224_init(bmw224_ctx_t *ctx);
+void bmw256_init(bmw256_ctx_t *ctx);
 
-void bmw_small_nextBlock(bmw_small_ctx_t* ctx, const void* block);
-void bmw_small_lastBlock(bmw_small_ctx_t* ctx, const void* block, uint16_t length_b);
+void bmw_small_nextBlock(bmw_small_ctx_t *ctx, const void *block);
+void bmw_small_lastBlock(bmw_small_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void bmw224_nextBlock(bmw224_ctx_t* ctx, const void* block);
-void bmw224_lastBlock(bmw224_ctx_t* ctx, const void* block, uint16_t length_b);
+void bmw224_nextBlock(bmw224_ctx_t *ctx, const void *block);
+void bmw224_lastBlock(bmw224_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void bmw256_nextBlock(bmw256_ctx_t* ctx, const void* block);
-void bmw256_lastBlock(bmw256_ctx_t* ctx, const void* block, uint16_t length_b);
+void bmw256_nextBlock(bmw256_ctx_t *ctx, const void *block);
+void bmw256_lastBlock(bmw256_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void bmw224_ctx2hash(void* dest, const bmw224_ctx_t* ctx);
-void bmw256_ctx2hash(void* dest, const bmw256_ctx_t* ctx);
+void bmw224_ctx2hash(void *dest, const bmw224_ctx_t *ctx);
+void bmw256_ctx2hash(void *dest, const bmw256_ctx_t *ctx);
 
-void bmw224(void* dest, const void* msg, uint32_t length_b);
-void bmw256(void* dest, const void* msg, uint32_t length_b);
+void bmw224(void *dest, const void *msg, uint32_t length_b);
+void bmw256(void *dest, const void *msg, uint32_t length_b);
 
 #endif /* BMW_SMALL_H_ */
index c743997518247b41bfeca78081016311b80baff7..621bd7e4fb420f195ec7495d568e9872ae3c2f6a 100644 (file)
@@ -646,9 +646,9 @@ change_endian:
 #define KEY_ROL17              0x08
 #define KEY_ROL15              0x00
 /*
-void camellia_6rounds(camellia128_ctx_t* s, uint64_t* bl, uint64_t* br, uint8_t roundop, uint8_t keychoice){
+void camellia_6rounds(camellia128_ctx_t *s, uint64_t *bl, uint64_t *br, uint8_t roundop, uint8_t keychoice){
        uint8_t i;
-       uint64_tk[4];
+       uint64_t *k[4];
        k[0] = &(s->kll);
        k[1] = &(s->klr);
        k[2] = &(s->kal);
@@ -827,7 +827,7 @@ main_loop:
        
 ;##############################################################################
 /*     
-void camellia128_init(camellia128_ctx_t* s, uint8_t* key){
+void camellia128_init(camellia128_ctx_t *s, uint8_t *key){
        uint8_t i;
        s->kll = 0; //((uint64_t*)key)[0];
        
index 760961366dcb2a9af80091f10b74f13371f0d784..b591fe278916d192d29517954e939092c09e7278 100644 (file)
@@ -29,9 +29,9 @@ typedef struct camellia128_ctx_s{
 }camellia128_ctx_t;
 
 
-void camellia128_init(const void* key, camellia128_ctx_t* s);
-void camellia128_enc(void* block, const camellia128_ctx_t* s);
-void camellia128_dec(void* block, const camellia128_ctx_t* s);
+void camellia128_init(const void *key, camellia128_ctx_t *s);
+void camellia128_enc(void *block, const camellia128_ctx_t *s);
+void camellia128_dec(void *block, const camellia128_ctx_t *s);
 
 
 #endif /*CAMELLIA_H_*/
index 57ed483a6ff57e68dbbf27d6c55bd24cd08a4e72..5de2a6089a0405f23d8b480008c1f07d4f64ad51 100644 (file)
@@ -39,7 +39,7 @@ uint64_t camellia_fl(uint64_t x, uint64_t k);
 /*****************************************************************************/
 uint64_t camellia_fl_inv(uint64_t y, uint64_t k);
 /*****************************************************************************/
-void change_endian(voiddata, uint8_t length);
+void change_endian(void *data, uint8_t length);
 /*
 uint64_t PROGMEM camellia_sigma[6]={ / * 64 byte table * /
        0xA09E667F3BCC908BLL,
@@ -83,7 +83,7 @@ void camellia128_ctx_dump(camellia128_ctx_t *s){
 /*****************************************************************************/
 /* extern uint64_t camellia_sigma[6]; */
 
-void camellia128_init(const void* key, camellia128_ctx_t* s){
+void camellia128_init(const void *key, camellia128_ctx_t *s){
        uint8_t i;
        s->kll = 0; /* ((uint64_t*)key)[0]; */
        
@@ -113,9 +113,9 @@ void camellia128_init(const void* key, camellia128_ctx_t* s){
 }
 
 /*****************************************************************************/
-void camellia128_keyop(camellia128_ctx_ts, int8_t q);
+void camellia128_keyop(camellia128_ctx_t *s, int8_t q);
 /*****************************************************************************/
-void camellia128_keyop_inv(camellia128_ctx_ts, int8_t q); 
+void camellia128_keyop_inv(camellia128_ctx_t *s, int8_t q); 
 /*****************************************************************************/
 
 #define SEL_KA 1
@@ -133,12 +133,12 @@ void camellia128_keyop_inv(camellia128_ctx_t* s, int8_t q);
 #define KEY_ROL17              0x08
 #define KEY_ROL15              0x00
 
-void camellia_6rounds(const camellia128_ctx_t* s, uint64_t* bl, uint64_t* br, 
+void camellia_6rounds(const camellia128_ctx_t *s, uint64_t *bl, uint64_t *br, 
                       uint8_t roundop, uint8_t keychoice);
 /*****************************************************************************/
 
 
-void camellia128_enc(void* block, const camellia128_ctx_t* s){
+void camellia128_enc(void *block, const camellia128_ctx_t *s){
 
        #define BL (((uint64_t*)block)[0])
        #define BR (((uint64_t*)block)[1])
@@ -192,7 +192,7 @@ void camellia128_enc(void* block, const camellia128_ctx_t* s){
 
 /*****************************************************************************/
 
-void camellia128_dec(void* block, const camellia128_ctx_t* s){
+void camellia128_dec(void *block, const camellia128_ctx_t *s){
 
        #define BL (((uint64_t*)block)[1])
        #define BR (((uint64_t*)block)[0])
index 2f309346fb9a0fb6bf6ed80268409231ddbd9667..5e09701ab27dcd2064e97bd9e49a0681ed91cf40 100644 (file)
@@ -272,7 +272,7 @@ uint64_t camellia_sigma(uint8_t idx){
 }
 /*****************************************************************************/
 
-void camellia128_init(const void* key, camellia128_ctx_t* s){
+void camellia128_init(const void *key, camellia128_ctx_t *s){
        uint8_t i;
        s->kll = 0; //((uint64_t*)key)[0];
        
@@ -306,7 +306,7 @@ void camellia128_init(const void* key, camellia128_ctx_t* s){
 /*****************************************************************************/
 
 static
-void camellia128_keyop(camellia128_ctx_ts, int8_t q){
+void camellia128_keyop(camellia128_ctx_t *s, int8_t q){
        /* first we do 16 bit left-rols for kl and ka (128bit each) */
        uint32_t temp;
        
@@ -323,7 +323,7 @@ void camellia128_keyop(camellia128_ctx_t* s, int8_t q){
 /*****************************************************************************/
 
 static
-void camellia128_keyop_inv(camellia128_ctx_ts, int8_t q){
+void camellia128_keyop_inv(camellia128_ctx_t *s, int8_t q){
        /* first we do 16 bit right-rols for kl and ka (128bit each) */
        uint32_t temp;
        
@@ -355,9 +355,9 @@ void camellia128_keyop_inv(camellia128_ctx_t* s, int8_t q){
 #define KEY_ROL15               0x00
 
 static
-void camellia_6rounds(const camellia128_ctx_t* s, uint64_t* bl, uint64_t* br, uint8_t roundop, uint8_t keychoice){
+void camellia_6rounds(const camellia128_ctx_t *s, uint64_t *bl, uint64_t *br, uint8_t roundop, uint8_t keychoice){
        uint8_t i;
-       uint64_tk[4];
+       uint64_t *k[4];
        k[0] = &(((camellia128_ctx_t*)s)->kll);
        k[1] = &(((camellia128_ctx_t*)s)->klr);
        k[2] = &(((camellia128_ctx_t*)s)->kal);
@@ -384,7 +384,7 @@ void camellia_6rounds(const camellia128_ctx_t* s, uint64_t* bl, uint64_t* br, ui
 /*****************************************************************************/
 
 static
-void change_endian(voiddata, uint8_t length){
+void change_endian(void *data, uint8_t length){
        uint8_t i,a;
        for(i=0; i<length/2; ++i){
                a = ((uint8_t*)data)[i];
@@ -395,7 +395,7 @@ void change_endian(void* data, uint8_t length){
 
 /*****************************************************************************/
 
-void camellia128_enc(void* block, const camellia128_ctx_t* s){
+void camellia128_enc(void *block, const camellia128_ctx_t *s){
 
        #define BL (((uint64_t*)block)[0])
        #define BR (((uint64_t*)block)[1])
@@ -449,7 +449,7 @@ void camellia128_enc(void* block, const camellia128_ctx_t* s){
 
 /*****************************************************************************/
 
-void camellia128_dec(void* block, const camellia128_ctx_t* s){
+void camellia128_dec(void *block, const camellia128_ctx_t *s){
 
        #define BL (((uint64_t*)block)[1])
        #define BR (((uint64_t*)block)[0])
index 00d92aec426491580796efa7b62bf78cb249889f..6118aeeba5c98d966159664df2f00d3d7f401caf 100644 (file)
@@ -129,7 +129,7 @@ void cast5_init_rM(uint8_t *klo, uint8_t *khi, uint8_t offset, uint8_t *src, boo
 
 
 
-void cast5_init(const void* key, uint16_t keylength_b, cast5_ctx_t* s){
+void cast5_init(const void *key, uint16_t keylength_b, cast5_ctx_t *s){
         /* we migth return if the key is valid and if setup was successful */
        uint32_t x[4], z[4];
        #define BPX ((uint8_t*)&(x[0]))
@@ -291,10 +291,10 @@ uint32_t cast5_f3(uint32_t d, uint32_t m, uint8_t r){
 
 /******************************************************************************/
 
-void cast5_enc(voidblock, const cast5_ctx_t *s){
+void cast5_enc(void *block, const cast5_ctx_t *s){
        uint32_t l,r, x, y;
        uint8_t i;
-       cast5_f_tf[]={cast5_f1,cast5_f2,cast5_f3};
+       cast5_f_t *f[]={cast5_f1,cast5_f2,cast5_f3};
        l=((uint32_t*)block)[0];
        r=((uint32_t*)block)[1];
 //     cli_putstr("\r\n round[-1] = ");
@@ -315,10 +315,10 @@ void cast5_enc(void* block, const cast5_ctx_t *s){
 
 /******************************************************************************/
 
-void cast5_dec(voidblock, const cast5_ctx_t *s){
+void cast5_dec(void *block, const cast5_ctx_t *s){
        uint32_t l,r, x, y;
        int8_t i, rounds;
-       cast5_f_tf[]={cast5_f1,cast5_f2,cast5_f3};
+       cast5_f_t *f[]={cast5_f1,cast5_f2,cast5_f3};
        l=((uint32_t*)block)[0];
        r=((uint32_t*)block)[1];
        rounds = (s->shortkey?12:16);
index b014f7c9e8d3174c3c7b9b7cac076b6e6960c7ee..ea5ea9c8a1278d7120deede92c2c12366918306f 100644 (file)
@@ -46,7 +46,7 @@
  * 
  * A variable of this type may hold a keyschedule for the CAST-5 cipher. 
  * This context is regulary generated by the 
- * cast5_init(uint8_t* key, uint8_t keylength_b, cast5_ctx_t* s) function.
+ * cast5_init(uint8_t *key, uint8_t keylength_b, cast5_ctx_t *s) function.
  */
 typedef struct cast5_ctx_st{
        uint32_t        mask[16];
@@ -56,7 +56,7 @@ typedef struct cast5_ctx_st{
 } cast5_ctx_t;
 
 
-/** \fn void cast5_init(const void* key, uint16_t keylength_b, cast5_ctx_t* s);
+/** \fn void cast5_init(const void *key, uint16_t keylength_b, cast5_ctx_t *s);
  * \brief generate keyschedule/contex for CAST-5
  * 
  * This function generates the keyschedule from the supplied key for the 
@@ -65,29 +65,29 @@ typedef struct cast5_ctx_st{
  * \param keylength_b length of the key in bits (maximum 128 bits)
  * \param s pointer to the context
  */
-void cast5_init(const void* key, uint16_t keylength_b, cast5_ctx_t* s);
+void cast5_init(const void *key, uint16_t keylength_b, cast5_ctx_t *s);
 
-/** \fn void cast5_enc(void* block, const cast5_ctx_t* s);
+/** \fn void cast5_enc(void *block, const cast5_ctx_t *s);
  * \brief encrypt a block with the CAST-5 algorithm
  * 
  * This function encrypts a block of 64 bits (8 bytes) with the CAST-5 algorithm.
  * It uses a keyschedule as generated by the 
- * cast5_init(void* key, uint8_t keylength_b, cast5_ctx_t* s) function.
+ * cast5_init(void *key, uint8_t keylength_b, cast5_ctx_t *s) function.
  * \param block pointer to the block which gets encrypted
  * \param s pointer to the keyschedule/context
  */
-void cast5_enc(void* block, const cast5_ctx_t* s);
+void cast5_enc(void *block, const cast5_ctx_t *s);
 
-/** \fn void cast5_dec(void* block, const cast5_ctx_t* s);
+/** \fn void cast5_dec(void *block, const cast5_ctx_t *s);
  * \brief decrypt a block with the CAST-5 algorithm
  * 
  * This function decrypts a block of 64 bits (8 bytes) with the CAST-5 algorithm.
  * It uses a keyschedule as generated by the 
- * cast5_init(void* key, uint8_t keylength_b, cast5_ctx_t* s) function.
+ * cast5_init(void *key, uint8_t keylength_b, cast5_ctx_t *s) function.
  * \param block pointer to the block which gets decrypted
  * \param s pointer to the keyschedule/context
  */
-void cast5_dec(void* block, const cast5_ctx_t* s);
+void cast5_dec(void *block, const cast5_ctx_t *s);
 
 
 
index 5fc7684cd01424d0a7067652b736a6ed36d72d19..5d21e5b5da03b35e8f1d3534398d3b5561e4dc12 100644 (file)
@@ -17,7 +17,7 @@
 
 
 static
-uint8_t kr(uint8_t i, const cast6_ctx_tctx){
+uint8_t kr(uint8_t i, const cast6_ctx_t *ctx){
        uint8_t ret;
        ret = ctx->krx[i/2];
        if(i&1){
@@ -31,7 +31,7 @@ uint8_t kr(uint8_t i, const cast6_ctx_t* ctx){
 }
 
 static
-void set_kr(uint8_t value, uint8_t i, cast6_ctx_tctx){
+void set_kr(uint8_t value, uint8_t i, cast6_ctx_t *ctx){
        value &= 0x1F;
        
        (ctx->krx[i/2]) &= 0xF0>>((i&1)*4); /* clear the location where v should go */
@@ -103,7 +103,7 @@ uint32_t f3(uint32_t v, uint8_t kri, uint32_t kmi){
 #define D (((uint32_t*)buffer)[3])
 
 static
-void q(void* buffer, uint8_t i, const cast6_ctx_t* ctx){
+void q(void *buffer, uint8_t i, const cast6_ctx_t *ctx){
        C ^= f1(D, kr(i*4+0, ctx), ctx->km[i][0]);
        B ^= f2(C, kr(i*4+1, ctx), ctx->km[i][1]);
        A ^= f3(B, kr(i*4+2, ctx), ctx->km[i][2]);
@@ -111,14 +111,14 @@ void q(void* buffer, uint8_t i, const cast6_ctx_t* ctx){
 }
 
 static
-void qbar(void* buffer, uint8_t i, const cast6_ctx_t* ctx){
+void qbar(void *buffer, uint8_t i, const cast6_ctx_t *ctx){
        D ^= f1(A, kr(i*4+3, ctx), ctx->km[i][3]);
        A ^= f3(B, kr(i*4+2, ctx), ctx->km[i][2]);
        B ^= f2(C, kr(i*4+1, ctx), ctx->km[i][1]);
        C ^= f1(D, kr(i*4+0, ctx), ctx->km[i][0]);
 }
 
-void cast6_enc(void* buffer, const cast6_ctx_t* ctx){
+void cast6_enc(void *buffer, const cast6_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<32/4; ++i){
                ((uint32_t*)buffer)[i] = CHANGE_ENDIAN32(((uint32_t*)buffer)[i]);
@@ -134,7 +134,7 @@ void cast6_enc(void* buffer, const cast6_ctx_t* ctx){
        }
 }
 
-void cast6_dec(void* buffer, const cast6_ctx_t* ctx){
+void cast6_dec(void *buffer, const cast6_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<32/4; ++i){
                ((uint32_t*)buffer)[i] = CHANGE_ENDIAN32(((uint32_t*)buffer)[i]);
@@ -168,7 +168,7 @@ void cast6_dec(void* buffer, const cast6_ctx_t* ctx){
 /*
  * we might later make it optional to use this small thing
 static
-void w(void* buffer, uint8_t* tr, uint32_t* tm){
+void w(void *buffer, uint8_t *tr, uint32_t *tm){
        G ^= f1(H, (tr[0]&0x0f)+(tr[5]&0x01)?0x10:0x00, tm[0]);
        F ^= f2(G, (tr[0]>>4)  +(tr[5]&0x02)?0x10:0x00, tm[1]);
        E ^= f3(F, (tr[1]&0x0f)+(tr[5]&0x04)?0x10:0x00, tm[2]);
@@ -180,7 +180,7 @@ void w(void* buffer, uint8_t* tr, uint32_t* tm){
 }
 */
 static
-void w(void* buffer, uint8_t* tr, uint32_t* tm){
+void w(void *buffer, uint8_t *tr, uint32_t *tm){
        G ^= f1(H, tr[0], tm[0]);
        F ^= f2(G, tr[1], tm[1]);
        E ^= f3(F, tr[2], tm[2]);
@@ -192,7 +192,7 @@ void w(void* buffer, uint8_t* tr, uint32_t* tm){
 }
 
 /*
-void dump_ctx(const cast6_ctx_tctx){
+void dump_ctx(const cast6_ctx_t *ctx){
        uint8_t i,t;
        cli_putstr_P(PSTR("\r\n DBG:"));
        for(i=0; i<12; ++i){
@@ -228,7 +228,7 @@ void dump_ctx(const cast6_ctx_t* ctx){
 #define MR 17 
 #define MM 0x6ED9EBA1
 
-void cast6_init(const void* key, uint16_t keysize_b, cast6_ctx_t* ctx){
+void cast6_init(const void *key, uint16_t keysize_b, cast6_ctx_t *ctx){
        uint8_t  buffer[32];
        uint8_t  cr=CR, tr[8];
        uint32_t cm=CM, tm[8];
index dc3c7bb3993e30928e56108ec741425c6fa95225..970bb3b83242747624a294baafe166a7c38a675d 100644 (file)
@@ -13,9 +13,9 @@ typedef struct cast6_ctx_st{
 
 
 
-void cast6_enc(void* buffer, const cast6_ctx_t* ctx);
-void cast6_dec(void* buffer, const cast6_ctx_t* ctx);
-void cast6_init(const void* key, uint16_t keysize_b, cast6_ctx_t* ctx);
+void cast6_enc(void *buffer, const cast6_ctx_t *ctx);
+void cast6_dec(void *buffer, const cast6_ctx_t *ctx);
+void cast6_init(const void *key, uint16_t keysize_b, cast6_ctx_t *ctx);
 
 
 #endif /*CAST6_H_*/
index 717fc0593c67a2f9a281e6775324ef503aa13f08..3832d819353f14ba2fc83624eed8db347fee7e84 100644 (file)
@@ -24,9 +24,9 @@ typedef struct {
        uint8_t keys[9][8];
 } cscipher_ctx_t;
 
-void cscipher_enc(void* buffer, const cscipher_ctx_t* ctx);
-void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx);
-void cscipher_init(const void* key, cscipher_ctx_t* ctx);
+void cscipher_enc(void *buffer, const cscipher_ctx_t *ctx);
+void cscipher_dec(void *buffer, const cscipher_ctx_t *ctx);
+void cscipher_init(const void *key, cscipher_ctx_t *ctx);
 
 
 #endif /* CSCIPHER_H_ */
index 640bcf271bb373408f08d61436d82bf276dc8c67..e68d70d9a8a38263810ec6f809de510c2a05ec16 100644 (file)
@@ -95,7 +95,7 @@ static uint16_t m_inv(uint16_t a){
 }
 
 
-void cscipher_enc(void* buffer, const cscipher_ctx_t* ctx){
+void cscipher_enc(void *buffer, const cscipher_ctx_t *ctx){
        uint8_t i,j,k;
        uint8_t tmp[8];
        for(i=0; i<8; ++i){
@@ -123,7 +123,7 @@ void cscipher_enc(void* buffer, const cscipher_ctx_t* ctx){
        memxor(buffer, ctx->keys[8], 8);
 }
 
-void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx){
+void cscipher_dec(void *buffer, const cscipher_ctx_t *ctx){
        uint8_t i=7,j,k;
        uint8_t tmp[8];
        memxor(buffer, ctx->keys[8], 8);
@@ -146,7 +146,7 @@ void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx){
        }while(i--);
 }
 
-void cscipher_init(const void* key, cscipher_ctx_t* ctx){
+void cscipher_init(const void *key, cscipher_ctx_t *ctx){
        uint8_t tmp_key[16], tmp[8];
        uint8_t i,j,k,t=0;
        memcpy(tmp_key, key, 16);
index bba78f91f65a0d459efd56b26d6f8fe49be9cc44..2a4b1b1c5c991e620436a3d9ffcc0d03fbeab0f2 100644 (file)
@@ -164,7 +164,7 @@ round_const:
 .byte  0xbf, 0x71, 0x58, 0x80, 0x9c, 0xf4, 0xf3, 0xc7
 
 /*
-void cscipher_enc(void* buffer, const cscipher_ctx_t* ctx){
+void cscipher_enc(void *buffer, const cscipher_ctx_t *ctx){
        uint8_t i,j,k;
        uint8_t tmp[8];
        for(i=0; i<8; ++i){
@@ -288,7 +288,7 @@ cscipher_enc:
        rjmp memxor
 
 /*
-void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx){
+void cscipher_dec(void *buffer, const cscipher_ctx_t *ctx){
        uint8_t i=7,j,k;
        uint8_t tmp[8];
        memxor(buffer, ctx->keys[8], 8);
index 0cc62b0945021f521e8bb521e9d8c61c9bc3e139..f5b3077bd0dcb2ed8ba623f5e1bdec8be8508891 100644 (file)
@@ -46,7 +46,7 @@
 â€¢ Swap   x_1jkl0 with    x_1jkl1 , for each (j, k, l).
 */
 
-static void cubehash_round(cubehash_ctx_tctx){
+static void cubehash_round(cubehash_ctx_t *ctx){
        uint8_t i;
        uint32_t t, t2;
        for(i=0; i<16; ++i){
@@ -79,7 +79,7 @@ static void cubehash_round(cubehash_ctx_t* ctx){
        }
 }
 
-void cubehash_init(uint8_t r, uint8_t b, uint16_t h, cubehash_ctx_tctx){
+void cubehash_init(uint8_t r, uint8_t b, uint16_t h, cubehash_ctx_t *ctx){
        memset(ctx->a, 0, 32*4);
        ctx->a[0] = h/8;
        ctx->a[1] = b;
@@ -91,7 +91,7 @@ void cubehash_init(uint8_t r, uint8_t b, uint16_t h, cubehash_ctx_t* ctx){
        }
 }
 
-void cubehash_nextBlock(cubehash_ctx_t* ctx, void* block){
+void cubehash_nextBlock(cubehash_ctx_t *ctx, void *block){
        uint8_t i;
        memxor(ctx->a, block, ctx->blocksize_B);
        for(i=0; i<ctx->rounds; ++i){
@@ -99,7 +99,7 @@ void cubehash_nextBlock(cubehash_ctx_t* ctx, void* block){
        }
 }
 
-void cubehash_lastBlock(cubehash_ctx_t* ctx, void* block, uint16_t length_b){
+void cubehash_lastBlock(cubehash_ctx_t *ctx, void *block, uint16_t length_b){
        while(length_b>=ctx->blocksize_B*8){
                cubehash_nextBlock(ctx, block);
                block = (uint8_t*)block + ctx->blocksize_B;
@@ -117,46 +117,46 @@ void cubehash_lastBlock(cubehash_ctx_t* ctx, void* block, uint16_t length_b){
        }
 }
 
-void cubehash_ctx2hash(void* dest, uint16_t length_b, cubehash_ctx_t* ctx){
+void cubehash_ctx2hash(void *dest, uint16_t length_b, cubehash_ctx_t *ctx){
        memcpy(dest, ctx->a, (length_b+7)/8);
 }
 
 /******************************************************************************/
 
-void cubehash224_init(cubehash_ctx_tctx){
+void cubehash224_init(cubehash_ctx_t *ctx){
        cubehash_init(16, 32, 224, ctx);
 }
 
-void cubehash224_ctx2hash(void* dest, cubehash_ctx_t* ctx){
+void cubehash224_ctx2hash(void *dest, cubehash_ctx_t *ctx){
        cubehash_ctx2hash(dest, 224, ctx);
 }
 
 /******************************************************************************/
 
-void cubehash256_init(cubehash_ctx_tctx){
+void cubehash256_init(cubehash_ctx_t *ctx){
        cubehash_init(16, 32, 256, ctx);
 }
 
-void cubehash256_ctx2hash(void* dest, cubehash_ctx_t* ctx){
+void cubehash256_ctx2hash(void *dest, cubehash_ctx_t *ctx){
        cubehash_ctx2hash(dest, 256, ctx);
 }
 
 /******************************************************************************/
 
-void cubehash384_init(cubehash_ctx_tctx){
+void cubehash384_init(cubehash_ctx_t *ctx){
        cubehash_init(16, 32, 384, ctx);
 }
 
-void cubehash384_ctx2hash(void* dest, cubehash_ctx_t* ctx){
+void cubehash384_ctx2hash(void *dest, cubehash_ctx_t *ctx){
        cubehash_ctx2hash(dest, 384, ctx);
 }
 
 /******************************************************************************/
 
-void cubehash512_init(cubehash_ctx_tctx){
+void cubehash512_init(cubehash_ctx_t *ctx){
        cubehash_init(16, 32, 512, ctx);
 }
 
-void cubehash512_ctx2hash(void* dest, cubehash_ctx_t* ctx){
+void cubehash512_ctx2hash(void *dest, cubehash_ctx_t *ctx){
        cubehash_ctx2hash(dest, 512, ctx);
 }
index 1f7b13a2c51c4c6780a0b6005908f8970b34b560..03c499203adb7b48b512db5bea26bd54b5a23d02 100644 (file)
@@ -37,21 +37,21 @@ typedef struct {
        uint8_t blocksize_B;
 } cubehash_ctx_t;
 
-void cubehash_init(uint8_t r, uint8_t b, uint16_t h, cubehash_ctx_tctx);
-void cubehash_nextBlock(cubehash_ctx_t* ctx, void* block);
-void cubehash_lastBlock(cubehash_ctx_t* ctx, void* block, uint16_t length_b);
-void cubehash_ctx2hash(void* dest, uint16_t length_b, cubehash_ctx_t* ctx);
+void cubehash_init(uint8_t r, uint8_t b, uint16_t h, cubehash_ctx_t *ctx);
+void cubehash_nextBlock(cubehash_ctx_t *ctx, void *block);
+void cubehash_lastBlock(cubehash_ctx_t *ctx, void *block, uint16_t length_b);
+void cubehash_ctx2hash(void *dest, uint16_t length_b, cubehash_ctx_t *ctx);
 
-void cubehash224_init(cubehash_ctx_tctx);
-void cubehash224_ctx2hash(void* dest, cubehash_ctx_t* ctx);
+void cubehash224_init(cubehash_ctx_t *ctx);
+void cubehash224_ctx2hash(void *dest, cubehash_ctx_t *ctx);
 
-void cubehash256_init(cubehash_ctx_tctx);
-void cubehash256_ctx2hash(void* dest, cubehash_ctx_t* ctx);
+void cubehash256_init(cubehash_ctx_t *ctx);
+void cubehash256_ctx2hash(void *dest, cubehash_ctx_t *ctx);
 
-void cubehash384_init(cubehash_ctx_tctx);
-void cubehash384_ctx2hash(void* dest, cubehash_ctx_t* ctx);
+void cubehash384_init(cubehash_ctx_t *ctx);
+void cubehash384_ctx2hash(void *dest, cubehash_ctx_t *ctx);
 
-void cubehash512_init(cubehash_ctx_tctx);
-void cubehash512_ctx2hash(void* dest, cubehash_ctx_t* ctx);
+void cubehash512_init(cubehash_ctx_t *ctx);
+void cubehash512_ctx2hash(void *dest, cubehash_ctx_t *ctx);
 
 #endif /* CUBEHASH_H_ */
index c8c6565584715eaca8bcd9d2e6e281e7fd5d79db..1c4d9e469d7768c051b3687cafb9faf64af55a64 100644 (file)
@@ -22,6 +22,6 @@
 
 #include <stdint.h>
 
-void xchg32_array(void* a, void* b, uint8_t n);
+void xchg32_array(void *a, void *b, uint8_t n);
 
 #endif /* XCHG_H_ */
index 2b30b01d911bcd26b9d5cbac4f9d9f65213fccf6..9aedd29900b547a7e1d781ef31635945cb9dfafd 100644 (file)
--- a/des/des.c
+++ b/des/des.c
@@ -269,7 +269,7 @@ uint8_t substitute(uint8_t a, uint8_t * sbp){
 
 /******************************************************************************/
 
-uint32_t des_f(uint32_t r, uint8_tkr){
+uint32_t des_f(uint32_t r, uint8_t *kr){
        uint8_t i;
        uint32_t t=0,ret;
        uint64_t data;
@@ -297,7 +297,7 @@ uint32_t des_f(uint32_t r, uint8_t* kr){
 
 /******************************************************************************/
 
-void des_enc(void* out, const void* in, const void* key){
+void des_enc(void *out, const void *in, const void *key){
 #define R (data.v32[1])
 #define L (data.v32[0])
 
@@ -333,7 +333,7 @@ void des_enc(void* out, const void* in, const void* key){
 
 /******************************************************************************/
 
-void des_dec(void* out, const void* in, const uint8_t* key){
+void des_dec(void *out, const void *in, const uint8_t *key){
        uint8_t kr[6],k[7];
        union {
                uint8_t v8[8];
@@ -368,7 +368,7 @@ void des_dec(void* out, const void* in, const uint8_t* key){
 
 /******************************************************************************/
 
-void tdes_enc(void* out, void* in, const void* key){
+void tdes_enc(void *out, void *in, const void *key){
        des_enc(out,  in, (uint8_t*)key + 0);
        des_dec(out, out, (uint8_t*)key + 8);
        des_enc(out, out, (uint8_t*)key +16);
@@ -376,7 +376,7 @@ void tdes_enc(void* out, void* in, const void* key){
 
 /******************************************************************************/
 
-void tdes_dec(void* out, void* in, const uint8_t* key){
+void tdes_dec(void *out, void *in, const uint8_t *key){
        des_dec(out,  in, (uint8_t*)key +16);
        des_enc(out, out, (uint8_t*)key + 8);
        des_dec(out, out, (uint8_t*)key + 0);
index 53de98a1a8091c6c585f7cc479c0d8ee7266d949..469e4935a85373fda1536bdadbd62157a95c20ca 100644 (file)
--- a/des/des.h
+++ b/des/des.h
  * Also we only implement the three key mode  */
 
 /** \def tdea_enc
- * \brief defining an alias for void tdes_enc(void* out, const void* in, const void* key)
+ * \brief defining an alias for void tdes_enc(void *out, const void *in, const void *key)
  */
 
 /** \def tdea_dec
- * \brief defining an alias for void tdes_dec(void* out, const void* in, const void* key)
+ * \brief defining an alias for void tdes_dec(void *out, const void *in, const void *key)
  */
 
 #define tdea_enc tdes_enc
 #define tdea_dec tdes_dec
 
-/** \fn void des_enc(void* out, const void* in, const void* key)
+/** \fn void des_enc(void *out, const void *in, const void *key)
  * \brief encrypt a block with DES
  * 
  * This function encrypts a block of 64 bits (8 bytes) with the DES algorithm.
@@ -53,9 +53,9 @@
  * \param in  pointer to the block (64 bit = 8 byte) where the plaintext is read from
  * \param key pointer to the key (64 bit = 8 byte)
  */
-void des_enc(void* out, const void* in, const void* key);
+void des_enc(void *out, const void *in, const void *key);
 
-/** \fn void des_dec(void* out, const void* in, const void* key)
+/** \fn void des_dec(void *out, const void *in, const void *key)
  * \brief decrypt a block with DES
  * 
  * This function decrypts a block of 64 bits (8 bytes) with the DES algorithm.
@@ -67,9 +67,9 @@ void des_enc(void* out, const void* in, const void* key);
  * \param in  pointer to the block (64 bit = 8 byte) where the ciphertext is read from
  * \param key pointer to the key (64 bit = 8 byte)
  */
-void des_dec(void* out, const void* in, const void* key);
+void des_dec(void *out, const void *in, const void *key);
 
-/** \fn void tdes_enc(void* out, const void* in, const void* key)
+/** \fn void tdes_enc(void *out, const void *in, const void *key)
  * \brief encrypt a block with Tripple-DES
  * 
  * This function encrypts a block of 64 bits (8 bytes) with the Tripple-DES (EDE)
@@ -81,9 +81,9 @@ void des_dec(void* out, const void* in, const void* key);
  * \param in  pointer to the block (64 bit = 8 byte) where the plaintext is read from
  * \param key pointer to the key (192 bit = 24 byte)
  */
-void tdes_enc(void* out, const void* in, const void* key);
+void tdes_enc(void *out, const void *in, const void *key);
 
-/** \fn void tdes_dec(void* out, const void* in, const void* key)
+/** \fn void tdes_dec(void *out, const void *in, const void *key)
  * \brief decrypt a block with Tripple-DES
  * 
  * This function decrypts a block of 64 bits (8 bytes) with the Tripple-DES (EDE)
@@ -95,6 +95,6 @@ void tdes_enc(void* out, const void* in, const void* key);
  * \param in  pointer to the block (64 bit = 8 byte) where the ciphertext is read from
  * \param key pointer to the key (192 bit = 24 byte)
  */
- void tdes_dec(void* out, const void* in, const void* key);
+ void tdes_dec(void *out, const void *in, const void *key);
 
 #endif /*DES_H_*/
index b7dacc3faab1398847bd0dc82b4113b5d4fce22e..69fa32d708bb37f9b71c5ce7961aee1d26b0baa1 100644 (file)
--- a/dsa/dsa.h
+++ b/dsa/dsa.h
@@ -49,14 +49,14 @@ typedef uint8_t(*rand_func_ptr_t)(void);
 #define DSA_SIGNATURE_OK 1
 #define DSA_SIGNATURE_FAIL 0
 
-uint8_t dsa_sign_bigint(dsa_signature_t* s, const bigint_t* m,
-                               const dsa_ctx_t* ctx, const bigint_t* k);
-uint8_t dsa_sign_message(dsa_signature_t* s, const void* m, uint16_t m_len_b,
-                               const hfdesc_t* hash_desc, const dsa_ctx_t* ctx,
+uint8_t dsa_sign_bigint(dsa_signature_t *s, const bigint_t *m,
+                               const dsa_ctx_t *ctx, const bigint_t *k);
+uint8_t dsa_sign_message(dsa_signature_t *s, const void *m, uint16_t m_len_b,
+                               const hfdesc_t *hash_desc, const dsa_ctx_t *ctx,
                                const rand_func_ptr_t rand_in);
-uint8_t dsa_verify_bigint(const dsa_signature_t* s, const bigint_t* m,
-                                 const dsa_ctx_tctx);
-uint8_t dsa_verify_message(const dsa_signature_t* s, const void* m, uint16_t m_len_b,
-                                                 const hfdesc_t* hash_desc, const dsa_ctx_t* ctx);
+uint8_t dsa_verify_bigint(const dsa_signature_t *s, const bigint_t *m,
+                                 const dsa_ctx_t *ctx);
+uint8_t dsa_verify_message(const dsa_signature_t *s, const void *m, uint16_t m_len_b,
+                                                 const hfdesc_t *hash_desc, const dsa_ctx_t *ctx);
 
 #endif /* DSA_H_ */
index f6e761c640b227bb556db897fd62c7a3b6e579ae..f7c79161205819e89238392afdab120f7a3844fb 100644 (file)
@@ -270,7 +270,7 @@ static const uint8_t dsa_key_blob[] PROGMEM = {
 };
 #endif
 
-void load_dsa_key_blob(dsa_ctx_tctx){
+void load_dsa_key_blob(dsa_ctx_t *ctx){
        if(ctx->priv.wordv){
                free(ctx->priv.wordv);
        }
index 8099a1e7a549a797a99838ea5599271b0983033e..95d295ca6cd4b9ea443ee2941d7de00f5a4d8758 100644 (file)
@@ -20,6 +20,6 @@
 #ifndef DSA_KEY_BLOB_H_
 #define DSA_KEY_BLOB_H_
 
-void load_dsa_key_blob(dsa_ctx_tctx);
+void load_dsa_key_blob(dsa_ctx_t *ctx);
 
 #endif /* DSA_KEY_BLOB_H_ */
index 7bd57e604e589baabed801445d8cd1712410ca96..b13ec45dc4a7d582ae511b051620a21bcdf4ba14 100644 (file)
@@ -24,8 +24,8 @@
 #include "hashfunction_descriptor.h"
 #include "hfal-basic.h"
 
-uint8_t dsa_sign_bigint(dsa_signature_t* s, const bigint_t* m,
-                               const dsa_ctx_t* ctx, const bigint_t* k){
+uint8_t dsa_sign_bigint(dsa_signature_t *s, const bigint_t *m,
+                               const dsa_ctx_t *ctx, const bigint_t *k){
        bigint_t tmp, tmp2;
        uint8_t tmp_b[ctx->domain.p.length_W+5], tmp2_b[ctx->domain.q.length_W+5];
        tmp.wordv= tmp_b;
@@ -47,8 +47,8 @@ uint8_t dsa_sign_bigint(dsa_signature_t* s, const bigint_t* m,
        return 0;
 }
 
-uint8_t dsa_sign_message(dsa_signature_t* s, const void* m, uint16_t m_len_b,
-                               const hfdesc_t* hash_desc, const dsa_ctx_t* ctx,
+uint8_t dsa_sign_message(dsa_signature_t *s, const void *m, uint16_t m_len_b,
+                               const hfdesc_t *hash_desc, const dsa_ctx_t *ctx,
                                const rand_func_ptr_t rand_in){
        bigint_t z, k;
        uint8_t i, n_B = ctx->domain.q.length_W;
index d0eb4d7f3a12b5a9a4eccdb36e9b72ad2c08614f..3941a2bbfa7a5cd3b091dd737820cfc77e268608 100644 (file)
@@ -22,8 +22,8 @@
 #include "dsa.h"
 #include "hfal-basic.h"
 
-uint8_t dsa_verify_bigint(const dsa_signature_t* s, const bigint_t* m,
-                                 const dsa_ctx_tctx){
+uint8_t dsa_verify_bigint(const dsa_signature_t *s, const bigint_t *m,
+                                 const dsa_ctx_t *ctx){
        if(s->r.length_W==0 || s->s.length_W==0){
                return DSA_SIGNATURE_FAIL;
        }
@@ -54,8 +54,8 @@ uint8_t dsa_verify_bigint(const dsa_signature_t* s, const bigint_t* m,
        return DSA_SIGNATURE_FAIL;
 }
 
-uint8_t dsa_verify_message(const dsa_signature_t* s, const void* m, uint16_t m_len_b,
-                                                 const hfdesc_t* hash_desc, const dsa_ctx_t* ctx){
+uint8_t dsa_verify_message(const dsa_signature_t *s, const void *m, uint16_t m_len_b,
+                                                 const hfdesc_t *hash_desc, const dsa_ctx_t *ctx){
        bigint_t z;
        uint8_t n_B = ctx->domain.q.length_W;
        uint8_t hash_value[(hfal_hash_getHashsize(hash_desc)+7)/8];
index 225b31bb8d844390859d3e47bbd6d597056f556b..a38f32d4a48bf234064c2f59d36ce406597adb57 100644 (file)
@@ -41,15 +41,15 @@ typedef union __attribute__((packed)){
 } ecc_combi_point_t;
 
 typedef struct {
-    bigint_tp;
-    bigint_tb;
+    bigint_t *p;
+    bigint_t *b;
     int (*reduce_p)(bigint_t*);
 } ecc_curve_sp_t;
 
 
-uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_tp, size_t length_B);
+uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_t *p, size_t length_B);
 
-void ecc_chudnovsky_point_free(ecc_chudnovsky_point_tp);
+void ecc_chudnovsky_point_free(ecc_chudnovsky_point_t *p);
 
 void ecc_chudnovsky_point_print(const ecc_chudnovsky_point_t *p);
 
@@ -71,15 +71,15 @@ uint8_t ecc_chudnovsky_point_add_sp(ecc_chudnovsky_point_t *dest,
 uint8_t ecc_chudnovsky_double_and_add(ecc_chudnovsky_point_t *dest,
                                       const bigint_t *k,
                                       const ecc_chudnovsky_point_t *p,
-                                      const ecc_curve_sp_tcurve);
-uint8_t bigint_to_naf(uint8_tdest, uint16_t *length, const bigint_t *src);
+                                      const ecc_curve_sp_t *curve);
+uint8_t bigint_to_naf(uint8_t *dest, uint16_t *length, const bigint_t *src);
 uint8_t ecc_chudnovsky_naf_multiplication(ecc_chudnovsky_point_t *dest,
                                           const bigint_t *k,
                                           const ecc_chudnovsky_point_t *p,
-                                          const ecc_curve_sp_tcurve);
+                                          const ecc_curve_sp_t *curve);
 uint8_t ecc_chudnovsky_multiplication(ecc_chudnovsky_point_t *dest,
                                       const bigint_t *k,
                                       const ecc_chudnovsky_point_t *p,
-                                      const ecc_curve_sp_tcurve);
+                                      const ecc_curve_sp_t *curve);
 
 #endif /* ECC_H_ */
index dd3433a3867c5b8503a965a635dc5a6a8212e702..894125ba57b8decd732c75f010ce5f00992748e9 100644 (file)
@@ -38,7 +38,7 @@
 #define putchar(a)
 #endif
 
-uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_tp, size_t length_B){
+uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_t *p, size_t length_B){
     if(!(p->x.wordv = malloc(length_B))){
         printf_P(PSTR("DBG: XXX <%S %s %d>\n"), PSTR(__FILE__), __func__, __LINE__);
         return 1;
@@ -77,7 +77,7 @@ uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_t* p, size_t length_B){
     return 0;
 }
 
-void ecc_chudnovsky_point_free(ecc_chudnovsky_point_tp){
+void ecc_chudnovsky_point_free(ecc_chudnovsky_point_t *p){
     free(p->x.wordv);
     free(p->y.wordv);
     free(p->z1.wordv);
@@ -378,7 +378,7 @@ uint8_t ecc_chudnovsky_point_add_sp(ecc_chudnovsky_point_t *dest,
 uint8_t ecc_chudnovsky_double_and_add(ecc_chudnovsky_point_t *dest,
                                       const bigint_t *k,
                                       const ecc_chudnovsky_point_t *p,
-                                      const ecc_curve_sp_tcurve){
+                                      const ecc_curve_sp_t *curve){
     uint16_t i;
     uint8_t s = 0;
     bigint_word_t v, t;
@@ -404,7 +404,7 @@ uint8_t ecc_chudnovsky_double_and_add(ecc_chudnovsky_point_t *dest,
     return 0;
 }
 
-uint8_t bigint_to_naf(uint8_tdest, uint16_t *length, const bigint_t *src){
+uint8_t bigint_to_naf(uint8_t *dest, uint16_t *length, const bigint_t *src){
     if(src->length_W == 0){
         *dest = 0;
         *length = 2;
@@ -443,7 +443,7 @@ uint8_t bigint_to_naf(uint8_t* dest, uint16_t *length, const bigint_t *src){
     return 0;
 }
 
-void print_naf(uint8_tnaf, uint16_t length){
+void print_naf(uint8_t *naf, uint16_t length){
     if(!length){
         return;
     }
@@ -466,7 +466,7 @@ void print_naf(uint8_t* naf, uint16_t length){
 uint8_t ecc_chudnovsky_naf_multiplication(ecc_chudnovsky_point_t *dest,
                                           const bigint_t *k,
                                           const ecc_chudnovsky_point_t *p,
-                                          const ecc_curve_sp_tcurve){
+                                          const ecc_curve_sp_t *curve){
     if(k->length_W == 0 || p->y.length_W == 0){
         bigint_set_zero(&dest->y);
         return 0;
@@ -515,7 +515,7 @@ uint8_t ecc_chudnovsky_naf_multiplication(ecc_chudnovsky_point_t *dest,
 uint8_t ecc_chudnovsky_multiplication(ecc_chudnovsky_point_t *dest,
                                       const bigint_t *k,
                                       const ecc_chudnovsky_point_t *p,
-                                      const ecc_curve_sp_tcurve){
+                                      const ecc_curve_sp_t *curve){
     return ecc_chudnovsky_naf_multiplication(dest, k, p, curve);
 }
 
@@ -526,6 +526,6 @@ uint8_t ecc_chudnovsky_multipy_and_sum(ecc_chudnovsky_point_t *dest,
                                       const ecc_chudnovsky_point_t *p,
                                       const bigint_t *l,
                                       const ecc_chudnovsky_point_t *q,
-                                      const ecc_curve_sp_tcurve){
+                                      const ecc_curve_sp_t *curve){
     return ecc_chudnovsky_naf_multiplication(dest, k, p, curve);
 }
index 9559417107389c3ef2227f7ee8a13cf6adadcbec..4f56711998ce85321a3424f98ae0819583b84ed4 100644 (file)
@@ -43,15 +43,15 @@ typedef uint8_t(*rand_func_ptr_t)(void);
 #define ECDSA_SIGNATURE_OK 1
 #define ECDSA_SIGNATURE_FAIL 0
 
-uint8_t ecdsa_sign_bigint(ecdsa_signature_t* s, const bigint_t* m,
-                          const ecdsa_ctx_t* ctx, const bigint_t* k);
-uint8_t ecdsa_sign_message(ecdsa_signature_t* s, const void* m, uint16_t m_len_b,
-                           const hfdesc_t* hash_desc, const ecdsa_ctx_t* ctx,
+uint8_t ecdsa_sign_bigint(ecdsa_signature_t *s, const bigint_t *m,
+                          const ecdsa_ctx_t *ctx, const bigint_t *k);
+uint8_t ecdsa_sign_message(ecdsa_signature_t *s, const void *m, uint16_t m_len_b,
+                           const hfdesc_t *hash_desc, const ecdsa_ctx_t *ctx,
                            const void *rand_in);
-uint8_t ecdsa_verify_bigint(const ecdsa_signature_t* s, const bigint_t* m,
-                            const ecdsa_ctx_tctx);
-uint8_t ecdsa_verify_message(const ecdsa_signature_t* s, const void* m, uint16_t m_len_b,
-                             const hfdesc_t* hash_desc, const ecdsa_ctx_t* ctx);
+uint8_t ecdsa_verify_bigint(const ecdsa_signature_t *s, const bigint_t *m,
+                            const ecdsa_ctx_t *ctx);
+uint8_t ecdsa_verify_message(const ecdsa_signature_t *s, const void *m, uint16_t m_len_b,
+                             const hfdesc_t *hash_desc, const ecdsa_ctx_t *ctx);
 
 
 #endif /* ECDSA_H_ */
index 8bcf4f41bc6be599047285c976893c9d95e25920..e6fe11bd2ec3a052eb3fa16a1c418f80da2879c0 100644 (file)
@@ -31,7 +31,7 @@
 #include "bigint_io.h"
 
 
-uint8_t ecdsa_signature_alloc(ecdsa_signature_ts, size_t length_B){
+uint8_t ecdsa_signature_alloc(ecdsa_signature_t *s, size_t length_B){
     if(!(s->r.wordv = malloc(length_B))){
         printf_P(PSTR("DBG: XXX <%S %s %d>\n"), PSTR(__FILE__), __func__, __LINE__);
         return 1;
@@ -46,13 +46,13 @@ uint8_t ecdsa_signature_alloc(ecdsa_signature_t* s, size_t length_B){
     return 0;
 }
 
-void ecdsa_signature_free(ecdsa_signature_ts){
+void ecdsa_signature_free(ecdsa_signature_t *s){
     free(s->r.wordv);
     free(s->s.wordv);
 }
 
-uint8_t ecdsa_sign_bigint(ecdsa_signature_t* s, const bigint_t* m,
-                          const ecdsa_ctx_t* ctx, const bigint_t* k){
+uint8_t ecdsa_sign_bigint(ecdsa_signature_t *s, const bigint_t *m,
+                          const ecdsa_ctx_t *ctx, const bigint_t *k){
 
     bigint_t t;
     ecc_combi_point_t q;
@@ -111,8 +111,8 @@ uint8_t ecdsa_sign_bigint(ecdsa_signature_t* s, const bigint_t* m,
     return 0;
 }
 
-uint8_t ecdsa_sign_hash(ecdsa_signature_t* s, const void* hash,
-                           size_t hash_len_B, const ecdsa_ctx_tctx,
+uint8_t ecdsa_sign_hash(ecdsa_signature_t *s, const void *hash,
+                           size_t hash_len_B, const ecdsa_ctx_t *ctx,
                            const void *rand_in){
     bigint_t m_int;
     bigint_t r_int;
@@ -169,8 +169,8 @@ uint8_t ecdsa_sign_hash(ecdsa_signature_t* s, const void* hash,
     return r;
 }
 
-uint8_t ecdsa_sign_message(ecdsa_signature_t* s, const void* m, uint16_t m_len_b,
-                       const hfdesc_t* hash_desc, const ecdsa_ctx_t* ctx,
+uint8_t ecdsa_sign_message(ecdsa_signature_t *s, const void *m, uint16_t m_len_b,
+                       const hfdesc_t *hash_desc, const ecdsa_ctx_t *ctx,
                        const void *rand_in){
 
     uint8_t *hash;
index 578461b6a67c690459c62f36c056563f8fa01589..099d48f68a8c3a4f1844ea47bec77f8e23bbf4ff 100644 (file)
 #include "ecdsa.h"
 #include "hfal-basic.h"
 
-uint8_t ecdsa_signature_alloc(ecdsa_signature_ts, size_t length_B);
+uint8_t ecdsa_signature_alloc(ecdsa_signature_t *s, size_t length_B);
 
-void ecdsa_signature_free(ecdsa_signature_ts);
+void ecdsa_signature_free(ecdsa_signature_t *s);
 
-uint8_t ecdsa_sign_bigint(ecdsa_signature_t* s, const bigint_t* m,
-                          const ecdsa_ctx_t* ctx, const bigint_t* k);
+uint8_t ecdsa_sign_bigint(ecdsa_signature_t *s, const bigint_t *m,
+                          const ecdsa_ctx_t *ctx, const bigint_t *k);
 
-uint8_t ecdsa_sign_hash(ecdsa_signature_t* s, const void* hash,
-                           size_t hash_len_B, const ecdsa_ctx_tctx,
+uint8_t ecdsa_sign_hash(ecdsa_signature_t *s, const void *hash,
+                           size_t hash_len_B, const ecdsa_ctx_t *ctx,
                            const void *rand_in);
 
-uint8_t ecdsa_sign_message(ecdsa_signature_t* s, const void* m, uint16_t m_len_b,
-                           const hfdesc_t* hash_desc, const ecdsa_ctx_t* ctx,
+uint8_t ecdsa_sign_message(ecdsa_signature_t *s, const void *m, uint16_t m_len_b,
+                           const hfdesc_t *hash_desc, const ecdsa_ctx_t *ctx,
                            const void *rand_in);
 
 #endif /* ECDSA_SIGN_H_ */
index 2db1dc4d5819b09c325ba34ff201d241293861fe..20694199db604f2134ae39272ee4019d03cbda28 100644 (file)
@@ -40,7 +40,7 @@ xREDUCER = 25
 
 
 /*
-  void aes_encrypt_core(aes_cipher_state_t* state, const aes_genctx_t* ks, uint8_t rounds)
+  void aes_encrypt_core(aes_cipher_state_t *state, const aes_genctx_t *ks, uint8_t rounds)
 */
 T0= 2
 T1= 3
index 18ffd9bc4eaf3d01a39e753131adbf36cb89cd3d..ccbf04e4b1ccddafe9d9e7af10e55d0d610f2186 100644 (file)
@@ -28,7 +28,7 @@ typedef struct{
        uint8_t ks[16];
 } aes_roundkey_t;
 
-void aes_enc_round(aes_cipher_state_t* state, const aes_roundkey_t* k);
+void aes_enc_round(aes_cipher_state_t *state, const aes_roundkey_t *k);
 
 
 #endif /* AES_ENC_ROUND_H_ */
index 6fbbbd8efe92918a2ac5dafe63939a11e597cef8..43703d7cbd31f125622f47d8a682d79af71dfe9b 100644 (file)
@@ -43,7 +43,7 @@
 #define GF256MUL_2(a) (gf256mul(2, (a), 0x1b))
 #define GF256MUL_3(a) (gf256mul(3, (a), 0x1b))
 
-static void mixcol(uint8_ts){
+static void mixcol(uint8_t *s){
        uint8_t t, tmp[4];
        tmp[0] = *(s+16*0);
        tmp[1] = *(s+16*1);
@@ -70,7 +70,7 @@ static void mixcol(uint8_t* s){
 }
 
 #if DEBUG
-static void dump_state(voids){
+static void dump_state(void *s){
        uint8_t row, col;
        for(col=0; col<4; col++){
                for(row=0; row<4; row++){
@@ -91,7 +91,7 @@ static void dump_state(void* s){
 }
 #endif
 
-static void echo_compress(uint8_t* s, uint8_t iterations, uint64_t* c, void* salt){
+static void echo_compress(uint8_t *s, uint8_t iterations, uint64_t *c, void *salt){
        uint8_t i, j;
        union {
                uint8_t v8[16];
@@ -169,7 +169,7 @@ static void echo_compress(uint8_t* s, uint8_t iterations, uint64_t* c, void* sal
 
 /******************************************************************************/
 
-static void compress512(void* v, void* m, uint64_t* c, void* salt){
+static void compress512(void *v, void *m, uint64_t *c, void *salt){
        uint8_t s[16*16];
        uint8_t i;
        memcpy(s, v, 16*4);           /* load v into state */
@@ -186,7 +186,7 @@ static void compress512(void* v, void* m, uint64_t* c, void* salt){
        }
 }
 
-static void compress1024(void* v, void* m, uint64_t* c, void* salt){
+static void compress1024(void *v, void *m, uint64_t *c, void *salt){
        uint8_t s[16*16];
        memcpy(s, v, 16*8);           /* load v into state */
        memcpy(s+16*8, m, 16*8);      /* load m into state */
@@ -201,12 +201,12 @@ static void compress1024(void* v, void* m, uint64_t* c, void* salt){
 
 /******************************************************************************/
 
-void echo_small_nextBlock(echo_small_ctx_t* ctx, void* block){
+void echo_small_nextBlock(echo_small_ctx_t *ctx, void *block){
        ctx->counter += ECHO_SMALL_BLOCKSIZE;
        compress512(ctx->v, block, &(ctx->counter), ctx->salt);
 }
 
-void echo_small_lastBlock(echo_small_ctx_t* ctx, void* block, uint16_t length_b){
+void echo_small_lastBlock(echo_small_ctx_t *ctx, void *block, uint16_t length_b){
        while(length_b>=ECHO_SMALL_BLOCKSIZE){
                echo_small_nextBlock(ctx, block);
                block = (uint8_t*)block + ECHO_SMALL_BLOCKSIZE_B;
@@ -233,12 +233,12 @@ void echo_small_lastBlock(echo_small_ctx_t* ctx, void* block, uint16_t length_b)
 
 /******************************************************************************/
 
-void echo_large_nextBlock(echo_large_ctx_t* ctx, void* block){
+void echo_large_nextBlock(echo_large_ctx_t *ctx, void *block){
        ctx->counter += ECHO_LARGE_BLOCKSIZE;
        compress1024(ctx->v, block, &(ctx->counter), ctx->salt);
 }
 
-void echo_large_lastBlock(echo_large_ctx_t* ctx, void* block, uint16_t length_b){
+void echo_large_lastBlock(echo_large_ctx_t *ctx, void *block, uint16_t length_b){
        while(length_b>=ECHO_LARGE_BLOCKSIZE){
                echo_large_nextBlock(ctx, block);
                block = (uint8_t*)block + ECHO_LARGE_BLOCKSIZE_B;
@@ -264,31 +264,31 @@ void echo_large_lastBlock(echo_large_ctx_t* ctx, void* block, uint16_t length_b)
 }
 /******************************************************************************/
 
-void echo_ctx2hash(void* dest, uint16_t length_b, echo_small_ctx_t* ctx){
+void echo_ctx2hash(void *dest, uint16_t length_b, echo_small_ctx_t *ctx){
        memcpy(dest, ctx->v, (length_b+7)/8);
 }
 
-void echo224_ctx2hash(void* dest, echo_small_ctx_t* ctx){
+void echo224_ctx2hash(void *dest, echo_small_ctx_t *ctx){
        memcpy(dest, ctx->v, 224/8);
 }
 
-void echo256_ctx2hash(void* dest, echo_small_ctx_t* ctx){
+void echo256_ctx2hash(void *dest, echo_small_ctx_t *ctx){
        memcpy(dest, ctx->v, 256/8);
 }
 
 /******************************************************************************/
 
-void echo384_ctx2hash(void* dest, echo_large_ctx_t* ctx){
+void echo384_ctx2hash(void *dest, echo_large_ctx_t *ctx){
        memcpy(dest, ctx->v, 384/8);
 }
 
-void echo512_ctx2hash(void* dest, echo_large_ctx_t* ctx){
+void echo512_ctx2hash(void *dest, echo_large_ctx_t *ctx){
        memcpy(dest, ctx->v, 512/8);
 }
 
 /******************************************************************************/
 
-void echo224_init(echo_small_ctx_tctx){
+void echo224_init(echo_small_ctx_t *ctx){
        memset(ctx->v, 0, 4*16);
        ctx->counter = 0;
        memset(ctx->salt, 0, 16);
@@ -299,7 +299,7 @@ void echo224_init(echo_small_ctx_t* ctx){
        ctx->v[0+16*3] = 0xE0;
 }
 
-void echo256_init(echo_small_ctx_tctx){
+void echo256_init(echo_small_ctx_t *ctx){
        memset(ctx->v, 0, 4*16);
        ctx->counter = 0;
        memset(ctx->salt, 0, 16);
@@ -312,7 +312,7 @@ void echo256_init(echo_small_ctx_t* ctx){
 
 /******************************************************************************/
 
-void echo384_init(echo_large_ctx_tctx){
+void echo384_init(echo_large_ctx_t *ctx){
        uint8_t i;
        memset(ctx->v, 0, 8*16);
        ctx->counter = 0;
@@ -324,7 +324,7 @@ void echo384_init(echo_large_ctx_t* ctx){
        }
 }
 
-void echo512_init(echo_large_ctx_tctx){
+void echo512_init(echo_large_ctx_t *ctx){
        uint8_t i;
        memset(ctx->v, 0, 8*16);
        ctx->counter = 0;
index e930b3bf46e4843af00c40eeebde8839b5b5bf03..179564f2de8d3a7b6720330ff41707e3666a3604 100644 (file)
@@ -50,20 +50,20 @@ typedef struct{
        uint16_t id;
 }echo_large_ctx_t;
 
-void echo_small_nextBlock(echo_small_ctx_t* ctx, void* block);
-void echo_small_lastBlock(echo_small_ctx_t* ctx, void* block, uint16_t length_b);
-void echo_small_ctx2hash(void* dest, uint16_t length_b, echo_small_ctx_t* ctx);
-void echo224_ctx2hash(void* dest, echo_small_ctx_t* ctx);
-void echo256_ctx2hash(void* dest, echo_small_ctx_t* ctx);
-void echo224_init(echo_small_ctx_tctx);
-void echo256_init(echo_small_ctx_tctx);
+void echo_small_nextBlock(echo_small_ctx_t *ctx, void *block);
+void echo_small_lastBlock(echo_small_ctx_t *ctx, void *block, uint16_t length_b);
+void echo_small_ctx2hash(void *dest, uint16_t length_b, echo_small_ctx_t *ctx);
+void echo224_ctx2hash(void *dest, echo_small_ctx_t *ctx);
+void echo256_ctx2hash(void *dest, echo_small_ctx_t *ctx);
+void echo224_init(echo_small_ctx_t *ctx);
+void echo256_init(echo_small_ctx_t *ctx);
 
-void echo_large_nextBlock(echo_large_ctx_t* ctx, void* block);
-void echo_large_lastBlock(echo_large_ctx_t* ctx, void* block, uint16_t length_b);
-void echo_large_ctx2hash(void* dest, uint16_t length_b, echo_large_ctx_t* ctx);
-void echo384_ctx2hash(void* dest, echo_large_ctx_t* ctx);
-void echo512_ctx2hash(void* dest, echo_large_ctx_t* ctx);
-void echo384_init(echo_large_ctx_tctx);
-void echo512_init(echo_large_ctx_tctx);
+void echo_large_nextBlock(echo_large_ctx_t *ctx, void *block);
+void echo_large_lastBlock(echo_large_ctx_t *ctx, void *block, uint16_t length_b);
+void echo_large_ctx2hash(void *dest, uint16_t length_b, echo_large_ctx_t *ctx);
+void echo384_ctx2hash(void *dest, echo_large_ctx_t *ctx);
+void echo512_ctx2hash(void *dest, echo_large_ctx_t *ctx);
+void echo384_init(echo_large_ctx_t *ctx);
+void echo512_init(echo_large_ctx_t *ctx);
 
 #endif /* ECHO_H_ */
index 0cc360397b17f7cfb1dec806663bd21b9949516d..182cd2f15a7fa3d9ba2cab5ccb967e108af5eec4 100644 (file)
@@ -65,7 +65,7 @@ uint32_t rndCore[16];
  * 
  * we simply first "hash" rndCore, then entropy.
  */
-void entropium_addEntropy(unsigned length_b, const voiddata){
+void entropium_addEntropy(unsigned length_b, const void *data){
        sha256_ctx_t s;
        static uint8_t offset=0; /* selects if higher or lower half gets updated */
        sha256_init(&s);
@@ -116,7 +116,7 @@ uint8_t entropium_getRandomByte(void){
        return block[i++];
 }
 
-void entropium_fillBlockRandom(voidblock, unsigned length_B){
+void entropium_fillBlockRandom(void *block, unsigned length_B){
        while(length_B>ENTROPIUM_RANDOMBLOCK_SIZE){
                entropium_getRandomBlock(block);
                block = (uint8_t*)block + ENTROPIUM_RANDOMBLOCK_SIZE;
index 303619d607094030516ba3545db677667e5a9e2a..ef78ce658c4a7a9cd3cdf082a7a255fb3ae5fb77 100644 (file)
  */
 #define ENTROPIUM_RANDOMBLOCK_SIZE 32 /* bytes */
  
-/** \fn void entropium_addEntropy(unsigned length_b, const voiddata)
+/** \fn void entropium_addEntropy(unsigned length_b, const void *data)
  * \brief add entropy to the prng
  * 
  * This function adds data to the internal entropy pool
  * \param length_b length of the data block in bits
  * \param data pointer to the data
  */
-void entropium_addEntropy(unsigned length_b, const voiddata); 
+void entropium_addEntropy(unsigned length_b, const void *data); 
 
-/** \fn void entropium_getRandomBlock(voidb)
+/** \fn void entropium_getRandomBlock(void *b)
  * \brief generate a fixed size block of random data 
  * 
  * This function writes 32 bytes of random extracted from the entropy pool
  * in the supplied buffer.
  * \param b buffer where the random data gets written
  */
-void entropium_getRandomBlock(voidb);
+void entropium_getRandomBlock(void *b);
 
 /** \fn uint8_t entropium_getRandomByte(void)
  * \brief get a single byte of random data
@@ -70,7 +70,7 @@ void entropium_getRandomBlock(void* b);
  */ 
 uint8_t entropium_getRandomByte(void);
 
-/** \fn void entropium_fillBlockRandom(voidblock, unsigned length_B)
+/** \fn void entropium_fillBlockRandom(void *block, unsigned length_B)
  * \brief get a block of random data
  * 
  * This function writes random data extracted from the entropy pool in the 
@@ -79,6 +79,6 @@ uint8_t entropium_getRandomByte(void);
  * \param block pointer to the buffer where the random data goes
  * \param length_B number of bytes to be written to the buffer
  */
-void entropium_fillBlockRandom(voidblock, unsigned length_B);
+void entropium_fillBlockRandom(void *block, unsigned length_B);
 
 #endif /*PRNG_H_*/
index ff6b97de41b46b689c211635d0d9613d557bca36..fc8c7f7670a968d54c9bffd087b4100246988f8a 100644 (file)
@@ -54,7 +54,7 @@ const uint8_t g_lut[128] PROGMEM = {
         0xF3, 0x2E, 0xF3, 0x2E, 0x0C, 0xD1, 0x0C, 0x2E, 0xAC, 0x71, 0xAC, 0x71, 0x53, 0x71, 0xA3, 0xD4  };
 #endif
 
-uint8_t grain_enc(grain_ctx_tctx){
+uint8_t grain_enc(grain_ctx_t *ctx){
        uint8_t s80, s0, c1, c2;
        uint8_t i;
        /* clock the LFSR */
@@ -137,7 +137,7 @@ uint8_t grain_enc(grain_ctx_t* ctx){
        return (h&1);
 }
 
-uint8_t grain_getbyte(grain_ctx_tctx){
+uint8_t grain_getbyte(grain_ctx_t *ctx){
        uint8_t i=0;
        uint8_t r=0;
        do{
@@ -166,7 +166,7 @@ uint8_t reverse_bits(uint8_t a){
 
 #endif
 
-void grain_init(const void* key, const void* iv, grain_ctx_t* ctx){
+void grain_init(const void *key, const void *iv, grain_ctx_t *ctx){
        uint8_t i,t;
        
        /* load the 80bit key */
index 06e8c7898c06a80305bf12843d81b6be1c7602c9..a8b73f9321b5c12c387f6f6e5ce8a650cdde8b31 100644 (file)
@@ -35,8 +35,8 @@ typedef struct gain_ctx_st{
        uint8_t nfsr[10];
 } grain_ctx_t;
 
-uint8_t grain_getbyte(grain_ctx_tctx);
-uint8_t grain_enc(grain_ctx_tctx);
-void grain_init(const void* key, const void* iv, grain_ctx_t* ctx);
+uint8_t grain_getbyte(grain_ctx_t *ctx);
+uint8_t grain_enc(grain_ctx_t *ctx);
+void grain_init(const void *key, const void *iv, grain_ctx_t *ctx);
 
 #endif /*GRAIN_H_*/
index f7f5eea14ccf622147fa356e4655871d507bb20c..972a956e99a5e16d0e3fd07d841d695bc039eee0 100644 (file)
@@ -40,7 +40,7 @@
 
 #if DEBUG
  #include "cli.h"
- void dump_m(const uint8_tm){
+ void dump_m(const uint8_t *m){
         uint8_t i,j;
         for(i=0; i<16; ++i){
                cli_putstr_P(PSTR("\r\n"));
@@ -152,20 +152,20 @@ void groestl_large_rounds(uint8_t *m, uint8_t q){
        }
 }
 
-void groestl384_init(groestl384_ctx_tctx){
+void groestl384_init(groestl384_ctx_t *ctx){
        memset(ctx->h, 0, 16*8);
        ctx->h[8*16-1] = (uint8_t)384;
        ctx->h[8*16-2] = (uint8_t)(384>>8);
        ctx->counter = 0;
 }
 
-void groestl512_init(groestl512_ctx_tctx){
+void groestl512_init(groestl512_ctx_t *ctx){
        memset(ctx->h, 0, 16*8);
        ctx->h[8*16-2] = 2;
        ctx->counter = 0;
 }
 
-void groestl_large_nextBlock(groestl_large_ctx_t* ctx, const void* block){
+void groestl_large_nextBlock(groestl_large_ctx_t *ctx, const void *block){
        uint8_t tmp1[128], tmp2[128];
 /*
        for(i=0; i<8; ++i){
@@ -184,7 +184,7 @@ void groestl_large_nextBlock(groestl_large_ctx_t* ctx, const void* block){
        ctx->counter++;
 }
 
-void groestl_large_lastBlock(groestl_large_ctx_t* ctx, const void* block, uint16_t length_b){
+void groestl_large_lastBlock(groestl_large_ctx_t *ctx, const void *block, uint16_t length_b){
        uint8_t buffer[128];
        while(length_b>=GROESTL_LARGE_BLOCKSIZE){
                groestl_large_nextBlock(ctx, block);
@@ -206,7 +206,7 @@ void groestl_large_lastBlock(groestl_large_ctx_t* ctx, const void* block, uint16
        groestl_large_nextBlock(ctx, buffer);
 }
 
-void groestl_large_ctx2hash(void* dest, const groestl_large_ctx_t* ctx, uint16_t outlength_b){
+void groestl_large_ctx2hash(void *dest, const groestl_large_ctx_t *ctx, uint16_t outlength_b){
        uint8_t tmp[128];
        memcpy(tmp, ctx->h, 128);
        groestl_large_rounds(tmp, 0);
@@ -218,31 +218,31 @@ void groestl_large_ctx2hash(void* dest, const groestl_large_ctx_t* ctx, uint16_t
        memcpy(dest, tmp+128-outlength_b/8, outlength_b/8);
 }
 
-void groestl384_ctx2hash(void* dest, const groestl384_ctx_t* ctx){
+void groestl384_ctx2hash(void *dest, const groestl384_ctx_t *ctx){
        groestl_large_ctx2hash(dest, ctx, 384);
 }
 
-void groestl512_ctx2hash(void* dest, const groestl512_ctx_t* ctx){
+void groestl512_ctx2hash(void *dest, const groestl512_ctx_t *ctx){
        groestl_large_ctx2hash(dest, ctx, 512);
 }
 
-void groestl384_nextBlock(groestl384_ctx_t* ctx, const void* block){
+void groestl384_nextBlock(groestl384_ctx_t *ctx, const void *block){
        groestl_large_nextBlock(ctx, block);
 }
 
-void groestl512_nextBlock(groestl512_ctx_t* ctx, const void* block){
+void groestl512_nextBlock(groestl512_ctx_t *ctx, const void *block){
        groestl_large_nextBlock(ctx, block);
 }
 
-void groestl384_lastBlock(groestl384_ctx_t* ctx, const void* block, uint16_t length_b){
+void groestl384_lastBlock(groestl384_ctx_t *ctx, const void *block, uint16_t length_b){
        groestl_large_lastBlock(ctx, block, length_b);
 }
 
-void groestl512_lastBlock(groestl512_ctx_t* ctx, const void* block, uint16_t length_b){
+void groestl512_lastBlock(groestl512_ctx_t *ctx, const void *block, uint16_t length_b){
        groestl_large_lastBlock(ctx, block, length_b);
 }
 
-void groestl384(void* dest, const void* msg, uint32_t length_b){
+void groestl384(void *dest, const void *msg, uint32_t length_b){
        groestl_large_ctx_t ctx;
        groestl384_init(&ctx);
        while(length_b>=GROESTL_LARGE_BLOCKSIZE){
@@ -254,7 +254,7 @@ void groestl384(void* dest, const void* msg, uint32_t length_b){
        groestl_large_ctx2hash(dest, &ctx, 384);
 }
 
-void groestl512(void* dest, const void* msg, uint32_t length_b){
+void groestl512(void *dest, const void *msg, uint32_t length_b){
        groestl_large_ctx_t ctx;
        groestl512_init(&ctx);
        while(length_b>=GROESTL_LARGE_BLOCKSIZE){
index c932fb750ebdbaa8f71bda90af529f80e1c0ccee..cedc280f3c0721cf16fef3489e0c737eb6d722c8 100644 (file)
@@ -44,22 +44,22 @@ typedef struct {
 typedef groestl_large_ctx_t groestl384_ctx_t;
 typedef groestl_large_ctx_t groestl512_ctx_t;
 
-void groestl384_init(groestl384_ctx_tctx);
-void groestl512_init(groestl512_ctx_tctx);
+void groestl384_init(groestl384_ctx_t *ctx);
+void groestl512_init(groestl512_ctx_t *ctx);
 
-void groestl_large_nextBlock(groestl_large_ctx_t* ctx, const void* block);
-void groestl_large_lastBlock(groestl_large_ctx_t* ctx, const void* block, uint16_t length_b);
+void groestl_large_nextBlock(groestl_large_ctx_t *ctx, const void *block);
+void groestl_large_lastBlock(groestl_large_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void groestl384_nextBlock(groestl384_ctx_t* ctx, const void* block);
-void groestl384_lastBlock(groestl384_ctx_t* ctx, const void* block, uint16_t length_b);
+void groestl384_nextBlock(groestl384_ctx_t *ctx, const void *block);
+void groestl384_lastBlock(groestl384_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void groestl512_nextBlock(groestl512_ctx_t* ctx, const void* block);
-void groestl512_lastBlock(groestl512_ctx_t* ctx, const void* block, uint16_t length_b);
+void groestl512_nextBlock(groestl512_ctx_t *ctx, const void *block);
+void groestl512_lastBlock(groestl512_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void groestl384_ctx2hash(void* dest, const groestl384_ctx_t* ctx);
-void groestl512_ctx2hash(void* dest, const groestl512_ctx_t* ctx);
+void groestl384_ctx2hash(void *dest, const groestl384_ctx_t *ctx);
+void groestl512_ctx2hash(void *dest, const groestl512_ctx_t *ctx);
 
-void groestl384(void* dest, const void* msg, uint32_t length_b);
-void groestl512(void* dest, const void* msg, uint32_t length_b);
+void groestl384(void *dest, const void *msg, uint32_t length_b);
+void groestl512(void *dest, const void *msg, uint32_t length_b);
 
 #endif /* GROESTL_GROESTL_H_ */
index 243bc995be63736f6eaeb05631accfefbe8e438c..0b6650553e4e65d1621d84059f6961b3b497690f 100644 (file)
@@ -40,7 +40,7 @@
 
 #if DEBUG
  #include "cli.h"
- void dump_m(const uint8_tm){
+ void dump_m(const uint8_t *m){
         uint8_t i,j;
         for(i=0; i<8; ++i){
                cli_putstr_P(PSTR("\r\n"));
@@ -160,19 +160,19 @@ void groestl_small_rounds(uint8_t *m, uint8_t q){
        }
 }
 
-void groestl224_init(groestl224_ctx_tctx){
+void groestl224_init(groestl224_ctx_t *ctx){
        memset(ctx->h, 0, 8*8);
        ctx->h[8*8-1] = 224;
        ctx->counter = 1;
 }
 
-void groestl256_init(groestl256_ctx_tctx){
+void groestl256_init(groestl256_ctx_t *ctx){
        memset(ctx->h, 0, 8*8);
        ctx->h[8*8-2] = 1;
        ctx->counter = 1;
 }
 
-void groestl_small_nextBlock(groestl_small_ctx_t* ctx, const void* block){
+void groestl_small_nextBlock(groestl_small_ctx_t *ctx, const void *block){
        uint8_t tmp1[64], tmp2[64];
 /*     for(i=0; i<8; ++i){
                for(j=0; j<8; ++j){
@@ -190,7 +190,7 @@ void groestl_small_nextBlock(groestl_small_ctx_t* ctx, const void* block){
        ctx->counter++;
 }
 
-void groestl_small_lastBlock(groestl_small_ctx_t* ctx, const void* block, uint16_t length_b){
+void groestl_small_lastBlock(groestl_small_ctx_t *ctx, const void *block, uint16_t length_b){
        uint8_t buffer[64];
        while(length_b>=GROESTL_SMALL_BLOCKSIZE){
                groestl_small_nextBlock(ctx, block);
@@ -212,7 +212,7 @@ void groestl_small_lastBlock(groestl_small_ctx_t* ctx, const void* block, uint16
        groestl_small_nextBlock(ctx, buffer);
 }
 
-void groestl_small_ctx2hash(void* dest, const groestl_small_ctx_t* ctx, uint16_t outlength_b){
+void groestl_small_ctx2hash(void *dest, const groestl_small_ctx_t *ctx, uint16_t outlength_b){
        uint8_t tmp[64];
        memcpy(tmp, ctx->h, 64);
        groestl_small_rounds(tmp, 0);
@@ -224,31 +224,31 @@ void groestl_small_ctx2hash(void* dest, const groestl_small_ctx_t* ctx, uint16_t
        memcpy(dest, tmp+64-outlength_b/8, outlength_b/8);
 }
 
-void groestl224_ctx2hash(void* dest, const groestl224_ctx_t* ctx){
+void groestl224_ctx2hash(void *dest, const groestl224_ctx_t *ctx){
        groestl_small_ctx2hash(dest, ctx, 224);
 }
 
-void groestl256_ctx2hash(void* dest, const groestl256_ctx_t* ctx){
+void groestl256_ctx2hash(void *dest, const groestl256_ctx_t *ctx){
        groestl_small_ctx2hash(dest, ctx, 256);
 }
 
-void groestl224_nextBlock(groestl224_ctx_t* ctx, const void* block){
+void groestl224_nextBlock(groestl224_ctx_t *ctx, const void *block){
        groestl_small_nextBlock(ctx, block);
 }
 
-void groestl256_nextBlock(groestl256_ctx_t* ctx, const void* block){
+void groestl256_nextBlock(groestl256_ctx_t *ctx, const void *block){
        groestl_small_nextBlock(ctx, block);
 }
 
-void groestl224_lastBlock(groestl224_ctx_t* ctx, const void* block, uint16_t length_b){
+void groestl224_lastBlock(groestl224_ctx_t *ctx, const void *block, uint16_t length_b){
        groestl_small_lastBlock(ctx, block, length_b);
 }
 
-void groestl256_lastBlock(groestl256_ctx_t* ctx, const void* block, uint16_t length_b){
+void groestl256_lastBlock(groestl256_ctx_t *ctx, const void *block, uint16_t length_b){
        groestl_small_lastBlock(ctx, block, length_b);
 }
 
-void groestl224(void* dest, const void* msg, uint32_t length_b){
+void groestl224(void *dest, const void *msg, uint32_t length_b){
        groestl_small_ctx_t ctx;
        groestl224_init(&ctx);
        while(length_b>=GROESTL_SMALL_BLOCKSIZE){
@@ -260,7 +260,7 @@ void groestl224(void* dest, const void* msg, uint32_t length_b){
        groestl_small_ctx2hash(dest, &ctx, 224);
 }
 
-void groestl256(void* dest, const void* msg, uint32_t length_b){
+void groestl256(void *dest, const void *msg, uint32_t length_b){
        groestl_small_ctx_t ctx;
        groestl256_init(&ctx);
        while(length_b>=GROESTL_SMALL_BLOCKSIZE){
index 819cc4ce4b2dc0f92f91fb19e71b95d73f284f09..652684a60d45ecfc07369b6d940048dbe7b768c0 100644 (file)
@@ -44,22 +44,22 @@ typedef struct {
 typedef groestl_small_ctx_t groestl224_ctx_t;
 typedef groestl_small_ctx_t groestl256_ctx_t;
 
-void groestl224_init(groestl224_ctx_tctx);
-void groestl256_init(groestl256_ctx_tctx);
+void groestl224_init(groestl224_ctx_t *ctx);
+void groestl256_init(groestl256_ctx_t *ctx);
 
-void groestl_small_nextBlock(groestl_small_ctx_t* ctx, const void* block);
-void groestl_small_lastBlock(groestl_small_ctx_t* ctx, const void* block, uint16_t length_b);
+void groestl_small_nextBlock(groestl_small_ctx_t *ctx, const void *block);
+void groestl_small_lastBlock(groestl_small_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void groestl224_nextBlock(groestl224_ctx_t* ctx, const void* block);
-void groestl224_lastBlock(groestl224_ctx_t* ctx, const void* block, uint16_t length_b);
+void groestl224_nextBlock(groestl224_ctx_t *ctx, const void *block);
+void groestl224_lastBlock(groestl224_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void groestl256_nextBlock(groestl256_ctx_t* ctx, const void* block);
-void groestl256_lastBlock(groestl256_ctx_t* ctx, const void* block, uint16_t length_b);
+void groestl256_nextBlock(groestl256_ctx_t *ctx, const void *block);
+void groestl256_lastBlock(groestl256_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void groestl224_ctx2hash(void* dest, const groestl224_ctx_t* ctx);
-void groestl256_ctx2hash(void* dest, const groestl256_ctx_t* ctx);
+void groestl224_ctx2hash(void *dest, const groestl224_ctx_t *ctx);
+void groestl256_ctx2hash(void *dest, const groestl256_ctx_t *ctx);
 
-void groestl224(void* dest, const void* msg, uint32_t length_b);
-void groestl256(void* dest, const void* msg, uint32_t length_b);
+void groestl224(void *dest, const void *msg, uint32_t length_b);
+void groestl256(void *dest, const void *msg, uint32_t length_b);
 
 #endif /* GROESTL_GROESTL_H_ */
index 8eb12c1d23e5b5db90a537c63448d888ad4ddf84..753286226f8b576499370532491233c16cae1907 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
 } hfdesc_t; /* hashfunction descriptor type */
 
 typedef struct{
-       hfdesc_tdesc_ptr;
+       hfdesc_t *desc_ptr;
        void*     ctx;
 } hfgen_ctx_t;
 
index f8f63f8fd3aab5419d158d654ce62d436121229a..5741df19f95530e0e73409b2c983a4cfb75e2060 100644 (file)
@@ -22,7 +22,7 @@
 #include "hfal-basic.h"
 #include <stdlib.h>
 
-uint8_t hfal_hash_init(const hfdesc_t* hash_descriptor, hfgen_ctx_t* ctx){
+uint8_t hfal_hash_init(const hfdesc_t *hash_descriptor, hfgen_ctx_t *ctx){
        hf_init_fpt f;
        uint16_t tmp;
        ctx->desc_ptr = (hfdesc_t*)hash_descriptor;
@@ -34,37 +34,37 @@ uint8_t hfal_hash_init(const hfdesc_t* hash_descriptor, hfgen_ctx_t* ctx){
        return 0;
 }
 
-void hfal_hash_nextBlock(hfgen_ctx_t* ctx, const void* block){
+void hfal_hash_nextBlock(hfgen_ctx_t *ctx, const void *block){
        hf_nextBlock_fpt f;
-       hfdesc_tx=(ctx->desc_ptr);
+       hfdesc_t *x=(ctx->desc_ptr);
        f =(hf_nextBlock_fpt)pgm_read_word(&(x->nextBlock));
        f(ctx->ctx, block);
 }
 
-void hfal_hash_lastBlock(hfgen_ctx_t* ctx, const void* block, uint16_t length_b){
+void hfal_hash_lastBlock(hfgen_ctx_t *ctx, const void *block, uint16_t length_b){
        hf_lastBlock_fpt f;
-       hfdesc_tx=ctx->desc_ptr;
+       hfdesc_t *x=ctx->desc_ptr;
        f =(hf_lastBlock_fpt)pgm_read_word(&(x->lastBlock));
        f(ctx->ctx, block, length_b);
 }
 
-void hfal_hash_ctx2hash(void* dest, hfgen_ctx_t* ctx){
+void hfal_hash_ctx2hash(void *dest, hfgen_ctx_t *ctx){
        hf_ctx2hash_fpt f;
-       hfdesc_tx=ctx->desc_ptr;
+       hfdesc_t *x=ctx->desc_ptr;
        f =(hf_ctx2hash_fpt)pgm_read_word(&(x->ctx2hash));
        f(dest, ctx->ctx);
 }
 
-void hfal_hash_free(hfgen_ctx_tctx){
+void hfal_hash_free(hfgen_ctx_t *ctx){
        hf_free_fpt f;
-       hfdesc_tx=ctx->desc_ptr;
+       hfdesc_t *x=ctx->desc_ptr;
        f =(hf_free_fpt)pgm_read_word(&(x->free));
        if(f)
                f(ctx->ctx);
        free(ctx->ctx);
 }
 
-void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg, uint32_t length_b){
+void hfal_hash_mem(const hfdesc_t *hash_descriptor, void *dest, const void *msg, uint32_t length_b){
        void_fpt f;
        f = (void_fpt)pgm_read_word(&(hash_descriptor->mem));
        if(f){
@@ -89,19 +89,19 @@ void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg,
        }
 }
 
-uint16_t hfal_hash_getBlocksize(const hfdesc_thash_descriptor){
+uint16_t hfal_hash_getBlocksize(const hfdesc_t *hash_descriptor){
        uint16_t ret;
        ret = pgm_read_word(&(hash_descriptor->blocksize_b));
        return ret;
 }
 
-uint16_t hfal_hash_getHashsize(const hfdesc_thash_descriptor){
+uint16_t hfal_hash_getHashsize(const hfdesc_t *hash_descriptor){
        uint16_t ret;
        ret = pgm_read_word(&(hash_descriptor->hashsize_b));
        return ret;
 }
 
-uint16_t hfal_hash_getCtxsize_B(const hfdesc_thash_descriptor){
+uint16_t hfal_hash_getCtxsize_B(const hfdesc_t *hash_descriptor){
        uint16_t ret;
        ret = pgm_read_word(&(hash_descriptor->ctxsize_B));
        return ret;
index 43a2fc122466ebeff727170829a9bfcffd082a2e..e1651f84f6b3d8ca82206c1db494f5a9c2a7d37d 100644 (file)
 #include <avr/pgmspace.h>
 #include "hashfunction_descriptor.h"
 
-uint8_t hfal_hash_init(const hfdesc_t* hash_descriptor, hfgen_ctx_t* ctx);
-void hfal_hash_nextBlock(hfgen_ctx_t* ctx, const void* block);
-void hfal_hash_lastBlock(hfgen_ctx_t* ctx, const void* block, uint16_t length_b);
-void hfal_hash_ctx2hash(void* dest, hfgen_ctx_t* ctx);
-void hfal_hash_free(hfgen_ctx_tctx);
-void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg, uint32_t length_b);
-uint16_t hfal_hash_getBlocksize(const hfdesc_thash_descriptor);
-uint16_t hfal_hash_getHashsize(const hfdesc_thash_descriptor);
-uint16_t hfal_hash_getCtxsize_B(const hfdesc_thash_descriptor);
+uint8_t hfal_hash_init(const hfdesc_t *hash_descriptor, hfgen_ctx_t *ctx);
+void hfal_hash_nextBlock(hfgen_ctx_t *ctx, const void *block);
+void hfal_hash_lastBlock(hfgen_ctx_t *ctx, const void *block, uint16_t length_b);
+void hfal_hash_ctx2hash(void *dest, hfgen_ctx_t *ctx);
+void hfal_hash_free(hfgen_ctx_t *ctx);
+void hfal_hash_mem(const hfdesc_t *hash_descriptor, void *dest, const void *msg, uint32_t length_b);
+uint16_t hfal_hash_getBlocksize(const hfdesc_t *hash_descriptor);
+uint16_t hfal_hash_getHashsize(const hfdesc_t *hash_descriptor);
+uint16_t hfal_hash_getCtxsize_B(const hfdesc_t *hash_descriptor);
 
 #endif /* HFAL_BASIC_H_ */
index dbc56088ec0163fab8deb8f7a91724250a3270ed..2bc794205b0aebcb952f905d0d42c4cea2cf7421 100644 (file)
@@ -25,9 +25,9 @@
 #define IPAD 0x36
 #define OPAD 0x5C
 
-uint8_t hfal_hmac_init(const hfdesc_thash_descriptor, 
-                       hfhmacgen_ctx_tctx, 
-                                          const voidkey, uint16_t keylength_b){
+uint8_t hfal_hmac_init(const hfdesc_t *hash_descriptor, 
+                       hfhmacgen_ctx_t *ctx, 
+                                          const void *key, uint16_t keylength_b){
        uint16_t  bs = hfal_hash_getBlocksize();
        uint8_t buffer[bs/8];
        uint8_t i;
@@ -67,13 +67,13 @@ uint8_t hfal_hmac_init(const hfdesc_t* hash_descriptor,
        memset(buffer, 0, bs/8);
 }
                                           
-void hfal_hmac_nextBlock(hfhmacgen_ctx_t* ctx, const void* block){
+void hfal_hmac_nextBlock(hfhmacgen_ctx_t *ctx, const void *block){
        hf_nextBlock_fpt nextBlock;
        nextBlock = pgm_read_word(&(hash_descriptor->nextBlock));
        nextBlock(ctx->ctx, block);
 }
 
-void hfal_hmac_lastBlock(hfhmacgen_ctx_t* ctx, const void* block, uint16_t length_b){
+void hfal_hmac_lastBlock(hfhmacgen_ctx_t *ctx, const void *block, uint16_t length_b){
        hf_lastBlock_fpt lastBlock;
        hf_ctx2hash_fpt  ctx2hash;
        uint16_t hs = pgm_read_word(&(hash_descriptor->hashsize_b));
@@ -85,13 +85,13 @@ void hfal_hmac_lastBlock(hfhmacgen_ctx_t* ctx, const void* block, uint16_t lengt
        lastBlock(ctx->finctx, buffer, hs);
 }
 
-void hfal_hmac_ctx2mac(void* dest, hfhmacgen_ctx_t* ctx){
+void hfal_hmac_ctx2mac(void *dest, hfhmacgen_ctx_t *ctx){
        hf_ctx2hash_fpt  ctx2hash;
        ctx2hash = pgm_read_word(&(hash_descriptor->ctx2hash));
        ctx2hash(dest, ctx->finctx);
 }
 
-void hfal_hmac_free(hfhmacgen_ctx_tctx){
+void hfal_hmac_free(hfhmacgen_ctx_t *ctx){
        hf_free_fpt free_fpt;
        free_fpt = pgm_read_word(&(hash_descriptor->free));
        if(free_fpt){
@@ -102,7 +102,7 @@ void hfal_hmac_free(hfhmacgen_ctx_t* ctx){
        free(ctx->finctx)
 }
 
-void hfal_hmac_mem(const hfdesc_t* hash_descriptor, const void* key, uint16_t keylength_b, void* dest, const void* msg, uint32_t length_b){
+void hfal_hmac_mem(const hfdesc_t *hash_descriptor, const void *key, uint16_t keylength_b, void *dest, const void *msg, uint32_t length_b){
        hfhmacgen_ctx_t ctx;
        uint16_t  bs = hfal_hash_getBlocksize();
        hfal_hmac_init(hash_descriptor, &ctx, key, keylength_b);
@@ -116,11 +116,11 @@ void hfal_hmac_mem(const hfdesc_t* hash_descriptor, const void* key, uint16_t ke
        hfal_free(&ctx);
 }
 
-uint16_t hfal_hmac_getBlocksize(const hfdesc_thash_descriptor){
+uint16_t hfal_hmac_getBlocksize(const hfdesc_t *hash_descriptor){
        return hfal_hash_getBlocksize(hash_descriptor);
 }
 
-uint16_t hfal_hmac_getMACsize(const hfdesc_thash_descriptor){
+uint16_t hfal_hmac_getMACsize(const hfdesc_t *hash_descriptor){
        return hfal_hash_getHashsize(hash_descriptor);
 }
 
index 8c9b8991f179efe24745e2fe0245abb2360731bf..4b70b993f388cff986d21374f7c41ba8fc957305 100644 (file)
 #include "hashfunction_descriptor.h"
 
 typedef struct {
-       hfdesc_tdesc;
+       hfdesc_t *desc;
        void*     ctx;
        void*     finctx;
 } hfhmacgen_ctx_t;
 
-uint8_t hfal_hmac_init(const hfdesc_t* hash_descriptor, hfhmacgen_ctx_t* ctx, const void* key, uint16_t keylength_b);
-void hfal_hmac_nextBlock(hfhmacgen_ctx_t* ctx, const void* block);
-void hfal_hmac_lastBlock(hfhmacgen_ctx_t* ctx, const void* block, uint16_t length_b);
-void hfal_hmac_ctx2mac(void* dest, hfhmacgen_ctx_t* ctx);
-void hfal_hmac_free(hfhmacgen_ctx_tctx);
-void hfal_hmac_mem(const hfdesc_t* hash_descriptor, const void* key, uint16_t keylength_b, void* dest, const void* msg, uint32_t length_b);
-uint16_t hfal_hmac_getBlocksize(const hfdesc_thash_descriptor);
-uint16_t hfal_hmac_getMACsize(const hfdesc_thash_descriptor);
+uint8_t hfal_hmac_init(const hfdesc_t *hash_descriptor, hfhmacgen_ctx_t *ctx, const void *key, uint16_t keylength_b);
+void hfal_hmac_nextBlock(hfhmacgen_ctx_t *ctx, const void *block);
+void hfal_hmac_lastBlock(hfhmacgen_ctx_t *ctx, const void *block, uint16_t length_b);
+void hfal_hmac_ctx2mac(void *dest, hfhmacgen_ctx_t *ctx);
+void hfal_hmac_free(hfhmacgen_ctx_t *ctx);
+void hfal_hmac_mem(const hfdesc_t *hash_descriptor, const void *key, uint16_t keylength_b, void *dest, const void *msg, uint32_t length_b);
+uint16_t hfal_hmac_getBlocksize(const hfdesc_t *hash_descriptor);
+uint16_t hfal_hmac_getMACsize(const hfdesc_t *hash_descriptor);
 
 #endif /* HFAL_HMAC_H_ */
index be21078e0ca775cb364ef1bd0e10aa8fea23eb6d..3e0c0235a114ce8b8df082184f0ddd2183820a4a 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdint.h>
 #include <avr/pgmspace.h>
 
-void hfal_nessie(const hfdesc_thd){
+void hfal_nessie(const hfdesc_t *hd){
        if(pgm_read_byte(&(hd->type))!=HFDESC_TYPE_HASHFUNCTION)
                return;
        char name[1+strlen_P((void*)pgm_read_word(&(hd->name)))];
@@ -48,8 +48,8 @@ void hfal_nessie(const hfdesc_t* hd){
        nessie_hash_run();
 }
 
-void hfal_nessie_multiple(const hfdesc_t* const* hd_list){
-       const hfdesc_thd;
+void hfal_nessie_multiple(const hfdesc_t *const *hd_list){
+       const hfdesc_t *hd;
        for(;;){
                hd = (void*)pgm_read_word(hd_list);
                if(!hd)
index c06db33c7bca15d1ad2eff2e2329193c31e25c46..1807dc9d5d649f19ff20afb76a1f2e2457ec6fd9 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "hashfunction_descriptor.h"
 
-void hfal_nessie(const hfdesc_thd);
-void hfal_nessie_multiple(const hfdesc_t* const* hd_list);
+void hfal_nessie(const hfdesc_t *hd);
+void hfal_nessie_multiple(const hfdesc_t *const *hd_list);
 
 #endif /* HFAL_NESSIE_H_ */
index a0fd1fd30bc8607120900b8d8c51c7b30fac8a42..192d6023a43a87c8b8108133fba9535959794ee1 100644 (file)
@@ -49,7 +49,7 @@ void printvalue(unsigned long v){
        cli_putstr(str);
 }
 
-void hfal_performance(const hfdesc_thd){
+void hfal_performance(const hfdesc_t *hd){
        hfdesc_t hf;
        memcpy_P(&hf, hd, sizeof(hfdesc_t));
        uint8_t ctx[hf.ctxsize_B];
@@ -131,7 +131,7 @@ void hfal_performance(const hfdesc_t* hd){
        }
 }
 
-void hfal_stacksize(const hfdesc_thd){
+void hfal_stacksize(const hfdesc_t *hd){
        hfdesc_t hf;
        stack_measuring_ctx_t smctx;
        memcpy_P(&hf, hd, sizeof(hfdesc_t));
@@ -203,8 +203,8 @@ void hfal_stacksize(const hfdesc_t* hd){
        }
 }
 
-void hfal_performance_multiple(const hfdesc_t* const* hd_list){
-       const hfdesc_thd;
+void hfal_performance_multiple(const hfdesc_t *const *hd_list){
+       const hfdesc_t *hd;
        for(;;){
                hd = (void*)pgm_read_word(hd_list);
                if(!hd){
index b8de940b45852471680d87e4a252266935d072cb..b65f6eefe628290b2a338877c0bced662b2a923e 100644 (file)
@@ -30,6 +30,6 @@
 
 #include "hashfunction_descriptor.h"
 
-void hfal_performance(const hfdesc_thd);
-void hfal_performance_multiple(const hfdesc_t* const* hd_list);
+void hfal_performance(const hfdesc_t *hd);
+void hfal_performance_multiple(const hfdesc_t *const *hd_list);
 #endif /* HFAL_PERFORMANCE_H_ */
index 9efce38e3e49e370adc2e9958ca8a278063b51cb..c71a7a3b09aad9dcb9da35e32898be1c51d0dd99 100644 (file)
@@ -31,7 +31,7 @@
 #include <stdint.h>
 #include <avr/pgmspace.h>
 
-void hfal_test(const hfdesc_t* hd, void* msg, uint32_t length_b){
+void hfal_test(const hfdesc_t *hd, void *msg, uint32_t length_b){
        if(pgm_read_byte(&(hd->type))!=HFDESC_TYPE_HASHFUNCTION)
                return;
        uint16_t dlen = (pgm_read_word(&(hd->hashsize_b))+7)/8;
index ac43338563321912770559feb30cafd88c8d8311..95a63f3d00224cc49db9828f7778ba705bb49e7c 100644 (file)
@@ -31,6 +31,6 @@
 #include "hashfunction_descriptor.h"
 #include <stdint.h>
 
-void hfal_test(const hfdesc_t* hd, void* msg, uint32_t length_b);
+void hfal_test(const hfdesc_t *hd, void *msg, uint32_t length_b);
 
 #endif /* HFAL_TEST_H_ */
index 485bed5a15e83c0af76a3002eb17499f892f12b0..93d79b2b5052fb0139b5f069703510e2f7b6bc4c 100644 (file)
@@ -39,25 +39,25 @@ static const char skein1024_384_str[]   PROGMEM = "Skein-1024-384";
 static const char skein1024_512_str[]   PROGMEM = "Skein-1024-512";
 static const char skein1024_1024_str[]  PROGMEM = "Skein-1024-1024";
 
-void skein1024_128_init(skein1024_ctx_tctx){
+void skein1024_128_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 128);
 }
-void skein1024_160_init(skein1024_ctx_tctx){
+void skein1024_160_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 160);
 }
-void skein1024_224_init(skein1024_ctx_tctx){
+void skein1024_224_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 224);
 }
-void skein1024_256_init(skein1024_ctx_tctx){
+void skein1024_256_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 256);
 }
-void skein1024_384_init(skein1024_ctx_tctx){
+void skein1024_384_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 384);
 }
-void skein1024_512_init(skein1024_ctx_tctx){
+void skein1024_512_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 512);
 }
-void skein1024_1024_init(skein1024_ctx_tctx){
+void skein1024_1024_init(skein1024_ctx_t *ctx){
        skein1024_init(ctx, 1024);
 }
 
index c647e1e71b312efd4fbabd53f4e32183dc6c3997..5855108c6d673fbdb2a25867910d8e18c0e1bdd6 100644 (file)
@@ -38,22 +38,22 @@ static const char skein256_256_str[]   PROGMEM = "Skein-256-256";
 static const char skein256_384_str[]   PROGMEM = "Skein-256-384";
 static const char skein256_512_str[]   PROGMEM = "Skein-256-512";
 
-void skein256_128_init(skein256_ctx_tctx){
+void skein256_128_init(skein256_ctx_t *ctx){
        skein256_init(ctx, 128);
 }
-void skein256_160_init(skein256_ctx_tctx){
+void skein256_160_init(skein256_ctx_t *ctx){
        skein256_init(ctx, 160);
 }
-void skein256_224_init(skein256_ctx_tctx){
+void skein256_224_init(skein256_ctx_t *ctx){
        skein256_init(ctx, 224);
 }
-void skein256_256_init(skein256_ctx_tctx){
+void skein256_256_init(skein256_ctx_t *ctx){
        skein256_init(ctx, 256);
 }
-void skein256_384_init(skein256_ctx_tctx){
+void skein256_384_init(skein256_ctx_t *ctx){
        skein256_init(ctx, 384);
 }
-void skein256_512_init(skein256_ctx_tctx){
+void skein256_512_init(skein256_ctx_t *ctx){
        skein256_init(ctx, 512);
 }
 
index f78bc6fee307a69f13293c2f39c2110a7d0f7335..6ed405ebb92787ce482d1981bf0a3cdc1ce8f279 100644 (file)
@@ -39,25 +39,25 @@ static const char skein512_384_str[]   PROGMEM = "Skein-512-384";
 static const char skein512_512_str[]   PROGMEM = "Skein-512-512";
 static const char skein512_1024_str[]  PROGMEM = "Skein-512-1024";
 
-void skein512_128_init(skein512_ctx_tctx){
+void skein512_128_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 128);
 }
-void skein512_160_init(skein512_ctx_tctx){
+void skein512_160_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 160);
 }
-void skein512_224_init(skein512_ctx_tctx){
+void skein512_224_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 224);
 }
-void skein512_256_init(skein512_ctx_tctx){
+void skein512_256_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 256);
 }
-void skein512_384_init(skein512_ctx_tctx){
+void skein512_384_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 384);
 }
-void skein512_512_init(skein512_ctx_tctx){
+void skein512_512_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 512);
 }
-void skein512_1024_init(skein512_ctx_tctx){
+void skein512_1024_init(skein512_ctx_t *ctx){
        skein512_init(ctx, 1024);
 }
 
index d72dca9b541aed17dc5612155f264f508ea1bbe8..a7add232cb95318b3f64e3b0d43d749296a2226b 100644 (file)
@@ -39,7 +39,7 @@
 
 #ifndef HMAC_SHORTONLY
 
-void hmac_md5_init(hmac_md5_ctx_t *s, voidkey, uint16_t keylength_b){
+void hmac_md5_init(hmac_md5_ctx_t *s, void *key, uint16_t keylength_b){
        uint8_t buffer[MD5_BLOCK_BYTES];
        uint8_t i;
        
@@ -67,15 +67,15 @@ void hmac_md5_init(hmac_md5_ctx_t *s, void* key, uint16_t keylength_b){
 #endif
 }
 
-void hmac_md5_nextBlock(hmac_md5_ctx_t *s, const voidblock){
+void hmac_md5_nextBlock(hmac_md5_ctx_t *s, const void *block){
        md5_nextBlock(&(s->a), block);
 }
 
-void hmac_md5_lastBlock(hmac_md5_ctx_t *s, const voidblock, uint16_t length_b){
+void hmac_md5_lastBlock(hmac_md5_ctx_t *s, const void *block, uint16_t length_b){
        md5_lastBlock(&(s->a), block, length_b);
 }
 
-void hmac_md5_final(voiddest, hmac_md5_ctx_t *s){
+void hmac_md5_final(void *dest, hmac_md5_ctx_t *s){
        md5_ctx2hash((md5_hash_t*)dest, &(s->a));
        md5_lastBlock(&(s->b), dest, MD5_HASH_BITS);
        md5_ctx2hash((md5_hash_t*)dest, &(s->b));
@@ -92,7 +92,7 @@ void hmac_md5_lastBlock()
  * keylength in bits!
  * message length in bits!
  */
-void hmac_md5(void* dest, void* key, uint16_t keylength_b, void* msg, uint32_t msglength_b){ /* a one-shot*/
+void hmac_md5(void *dest, void *key, uint16_t keylength_b, void *msg, uint32_t msglength_b){ /* a one-shot*/
        md5_ctx_t s;
        uint8_t i;
        uint8_t buffer[MD5_BLOCK_BYTES];
index 5bbaeb9a62f5d4ee2b88c056f86e6e5425636471..d60898329135ee49def3e6cb99eda4132caa93d1 100644 (file)
@@ -31,12 +31,12 @@ typedef struct{
 } hmac_md5_ctx_t;
 
 
-void hmac_md5_init(hmac_md5_ctx_t *s, voidkey, uint16_t keylength_b);
-void hmac_md5_nextBlock(hmac_md5_ctx_t *s, const voidblock);
-void hmac_md5_lastBlock(hmac_md5_ctx_t *s, const voidblock, uint16_t length_b);
-void hmac_md5_final(voiddest, hmac_md5_ctx_t *s);
+void hmac_md5_init(hmac_md5_ctx_t *s, void *key, uint16_t keylength_b);
+void hmac_md5_nextBlock(hmac_md5_ctx_t *s, const void *block);
+void hmac_md5_lastBlock(hmac_md5_ctx_t *s, const void *block, uint16_t length_b);
+void hmac_md5_final(void *dest, hmac_md5_ctx_t *s);
 
-void hmac_md5(void* dest, void* key, uint16_t keylength_b, void* msg, uint32_t msglength_b);
+void hmac_md5(void *dest, void *key, uint16_t keylength_b, void *msg, uint32_t msglength_b);
 
 
 #endif /*HMACMD5_H_*/
index 3ac88722ca814eb8f870e8157d96bcdc79be1e1b..9f225909e193345bb67e6cefe39ba42c3cbcd157 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef HMAC_SHORTONLY
 
-void hmac_sha1_init(hmac_sha1_ctx_t *s, const voidkey, uint16_t keylength_b){
+void hmac_sha1_init(hmac_sha1_ctx_t *s, const void *key, uint16_t keylength_b){
        uint8_t buffer[SHA1_BLOCK_BYTES];
        uint8_t i;
        
@@ -69,10 +69,10 @@ void hmac_sha1_init(hmac_sha1_ctx_t *s, const void* key, uint16_t keylength_b){
 #endif
 }
 
-void hmac_sha1_nextBlock(hmac_sha1_ctx_t *s, const voidblock){
+void hmac_sha1_nextBlock(hmac_sha1_ctx_t *s, const void *block){
        sha1_nextBlock(&(s->a), block);
 }
-void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const voidblock, uint16_t length_b){
+void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const void *block, uint16_t length_b){
        while(length_b>=SHA1_BLOCK_BITS){
                sha1_nextBlock(&s->a, block);
                block = (uint8_t*)block + SHA1_BLOCK_BYTES;
@@ -81,7 +81,7 @@ void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const void* block, uint16_t length_
        sha1_lastBlock(&s->a, block, length_b);
 }
 
-void hmac_sha1_final(voiddest, hmac_sha1_ctx_t *s){
+void hmac_sha1_final(void *dest, hmac_sha1_ctx_t *s){
        sha1_ctx2hash(dest, &s->a);
        sha1_lastBlock(&s->b, dest, SHA1_HASH_BITS);
        sha1_ctx2hash(dest, &(s->b));
@@ -93,7 +93,7 @@ void hmac_sha1_final(void* dest, hmac_sha1_ctx_t *s){
  * keylength in bits!
  * message length in bits!
  */
-void hmac_sha1(void* dest, const void* key, uint16_t keylength_b, const void* msg, uint32_t msglength_b){ /* a one-shot*/
+void hmac_sha1(void *dest, const void *key, uint16_t keylength_b, const void *msg, uint32_t msglength_b){ /* a one-shot*/
        sha1_ctx_t s;
        uint8_t i;
        uint8_t buffer[SHA1_BLOCK_BYTES];
index d0be0299b24fcaa19745bee15ff5bb9bc28b5c55..fccd5eda0734eac3422d5b4d6288cdedc566f128 100644 (file)
@@ -31,11 +31,11 @@ typedef struct{
 } hmac_sha1_ctx_t;
 
 
-void hmac_sha1_init(hmac_sha1_ctx_t *s, const voidkey, uint16_t keylength_b);
-void hmac_sha1_nextBlock(hmac_sha1_ctx_t *s, const voidblock);
-void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const voidblock, uint16_t length_b);
-void hmac_sha1_final(voiddest, hmac_sha1_ctx_t *s);
+void hmac_sha1_init(hmac_sha1_ctx_t *s, const void *key, uint16_t keylength_b);
+void hmac_sha1_nextBlock(hmac_sha1_ctx_t *s, const void *block);
+void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const void *block, uint16_t length_b);
+void hmac_sha1_final(void *dest, hmac_sha1_ctx_t *s);
 
-void hmac_sha1(void* dest, const void* key, uint16_t keylength_b, const void* msg, uint32_t msglength_b);
+void hmac_sha1(void *dest, const void *key, uint16_t keylength_b, const void *msg, uint32_t msglength_b);
 
 #endif /*HMACSHA1_H_*/
index 6a5718906b2d6fd5aa3899f33880cf06c74d99fc..f675e03b30dd380efa545219043fc9e730153c53 100644 (file)
@@ -39,7 +39,7 @@
 
 #ifndef HMAC_SHA256_SHORTONLY
 
-void hmac_sha256_init(hmac_sha256_ctx_t *s, const voidkey, uint16_t keylength_b){
+void hmac_sha256_init(hmac_sha256_ctx_t *s, const void *key, uint16_t keylength_b){
        uint8_t buffer[HMAC_SHA256_BLOCK_BYTES];
        uint8_t i;
        
@@ -68,11 +68,11 @@ void hmac_sha256_init(hmac_sha256_ctx_t *s, const void* key, uint16_t keylength_
 #endif
 }
 
-void hmac_sha256_nextBlock(hmac_sha256_ctx_t *s, const voidblock){
+void hmac_sha256_nextBlock(hmac_sha256_ctx_t *s, const void *block){
        sha256_nextBlock(&(s->a), block);
 }
 
-void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const voidblock, uint16_t length_b){
+void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const void *block, uint16_t length_b){
 /*     while(length_b>=SHA256_BLOCK_BITS){
                sha256_nextBlock(&(s->a), block);
                block = (uint8_t*)block + SHA256_BLOCK_BYTES;
@@ -81,7 +81,7 @@ void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const void* block, uint16_t len
 */     sha256_lastBlock(&(s->a), block, length_b);
 }
 
-void hmac_sha256_final(voiddest, hmac_sha256_ctx_t *s){
+void hmac_sha256_final(void *dest, hmac_sha256_ctx_t *s){
        sha256_ctx2hash((sha256_hash_t*)dest, &(s->a));
        sha256_lastBlock(&(s->b), dest, SHA256_HASH_BITS);
        sha256_ctx2hash((sha256_hash_t*)dest, &(s->b));                 
@@ -93,7 +93,7 @@ void hmac_sha256_final(void* dest, hmac_sha256_ctx_t *s){
  * keylength in bits!
  * message length in bits!
  */
-void hmac_sha256(void* dest, const void* key, uint16_t keylength_b, const void* msg, uint32_t msglength_b){ /* a one-shot*/
+void hmac_sha256(void *dest, const void *key, uint16_t keylength_b, const void *msg, uint32_t msglength_b){ /* a one-shot*/
        sha256_ctx_t s;
        uint8_t i;
        uint8_t buffer[HMAC_SHA256_BLOCK_BYTES];
index 4df6af5e93f37f8fefd6f7a0de88e6705b30c006..ecc0a143afb0a5ab162bd5abdee61e9b96ed2b5e 100644 (file)
@@ -32,12 +32,12 @@ typedef struct {
 } hmac_sha256_ctx_t;
 
 
-void hmac_sha256_init(hmac_sha256_ctx_t *s, const voidkey, uint16_t keylength_b);
-void hmac_sha256_nextBlock(hmac_sha256_ctx_t *s, const voidblock);
-void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const voidblock, uint16_t length_b);
-void hmac_sha256_final(voiddest, hmac_sha256_ctx_t *s);
+void hmac_sha256_init(hmac_sha256_ctx_t *s, const void *key, uint16_t keylength_b);
+void hmac_sha256_nextBlock(hmac_sha256_ctx_t *s, const void *block);
+void hmac_sha256_lastBlock(hmac_sha256_ctx_t *s, const void *block, uint16_t length_b);
+void hmac_sha256_final(void *dest, hmac_sha256_ctx_t *s);
 
-void hmac_sha256(void* dest, const void* key, uint16_t keylength_b, const void* msg, uint32_t msglength_b);
+void hmac_sha256(void *dest, const void *key, uint16_t keylength_b, const void *msg, uint32_t msglength_b);
 
 
 #endif /*HMACSHA256_H_*/
index b3594116d95b78fb2260d19eb901fcf0ef3d452d..b30f688f76f3c8a2ec5c5f7ef20812f07e79623e 100644 (file)
@@ -36,7 +36,7 @@ int print_header =  1,
     print_align  =  1,
     print_prefix =  1;
 
-charfmt_strings[]={"%d", "%3d",
+char *fmt_strings[]={"%d", "%3d",
                      "%X", "%2.2X",
                      "%o", "%3o",
                      "%d", "%3d",
@@ -65,7 +65,7 @@ int main(int argc, char** argv){
        int i,j;
        int c;
        int option_index=0;
-       charfmt=NULL;
+       char *fmt=NULL;
        static struct option long_options[] =
              {
                /* These options set a flag. */
@@ -98,7 +98,7 @@ int main(int argc, char** argv){
        unsigned long ul_reducer=0x00, max=0xff, min=0x00;
        uint8_t reducer, a;
        char** eptr;
-       FILEof = stdout;
+       FILE *of = stdout;
        while(c!=-1){
                c = getopt_long(argc, argv,"cCbBdh8aApPr:l:u:f:", 
                                long_options, &option_index);
index b97d7f1ca12d951ce7fde3c960eca5eb35a69495..6788acbf1b09c79857ee01db09bffcbf853d593f 100644 (file)
@@ -37,22 +37,22 @@ typedef struct {
 } jh_ctx_t;
 
 
-void jh_init(uint16_t hashlen_b, jh_ctx_tctx);
-void jh_nextBlock(jh_ctx_t* ctx, void* block);
-void jh_lastBlock(jh_ctx_t* ctx, void* block, uint16_t length_b);
-void jh_ctx2hash(void* dest, uint16_t length_b, jh_ctx_t* ctx);
+void jh_init(uint16_t hashlen_b, jh_ctx_t *ctx);
+void jh_nextBlock(jh_ctx_t *ctx, void *block);
+void jh_lastBlock(jh_ctx_t *ctx, void *block, uint16_t length_b);
+void jh_ctx2hash(void *dest, uint16_t length_b, jh_ctx_t *ctx);
 
-void jh224_init(jh_ctx_tctx);
-void jh224_ctx2hash(void* dest, jh_ctx_t* ctx);
+void jh224_init(jh_ctx_t *ctx);
+void jh224_ctx2hash(void *dest, jh_ctx_t *ctx);
 
-void jh256_init(jh_ctx_tctx);
-void jh256_ctx2hash(void* dest, jh_ctx_t* ctx);
+void jh256_init(jh_ctx_t *ctx);
+void jh256_ctx2hash(void *dest, jh_ctx_t *ctx);
 
-void jh384_init(jh_ctx_tctx);
-void jh384_ctx2hash(void* dest, jh_ctx_t* ctx);
+void jh384_init(jh_ctx_t *ctx);
+void jh384_ctx2hash(void *dest, jh_ctx_t *ctx);
 
-void jh512_init(jh_ctx_tctx);
-void jh512_ctx2hash(void* dest, jh_ctx_t* ctx);
+void jh512_init(jh_ctx_t *ctx);
+void jh512_ctx2hash(void *dest, jh_ctx_t *ctx);
 
 
 #endif /* JH_SIMPLE_H_ */
index 65c991c835ddc95f85c8cea2b0bb888b01dd589f..b4ca6fd0330ae17875119d550793be6c03443259 100644 (file)
@@ -32,7 +32,7 @@
 
 void jh_encrypt(uint8_t *a);
 
-void jh_init(uint16_t hashlen_b, jh_ctx_tctx){
+void jh_init(uint16_t hashlen_b, jh_ctx_t *ctx){
        memset(ctx->a, 0, 128);
        ctx->a[0] = hashlen_b>>8;
        ctx->a[1] = hashlen_b&0xff;
@@ -40,14 +40,14 @@ void jh_init(uint16_t hashlen_b, jh_ctx_t* ctx){
        ctx->block_hashed=0;
 }
 
-void jh_nextBlock(jh_ctx_t* ctx, void* block){
+void jh_nextBlock(jh_ctx_t *ctx, void *block){
        memxor(ctx->a, block, 64);
        jh_encrypt(ctx->a);
        memxor(ctx->a+64, block, 64);
        ctx->block_hashed++;
 }
 
-void jh_lastBlock(jh_ctx_t* ctx, void* block, uint16_t length_b){
+void jh_lastBlock(jh_ctx_t *ctx, void *block, uint16_t length_b){
        while(length_b>=64*8){
                jh_nextBlock(ctx, block);
                block = (uint8_t*)block + 64;
@@ -77,39 +77,39 @@ void jh_lastBlock(jh_ctx_t* ctx, void* block, uint16_t length_b){
        jh_nextBlock(ctx, buffer);
 }
 
-void jh_ctx2hash(void* dest, uint16_t length_b, jh_ctx_t* ctx){
+void jh_ctx2hash(void *dest, uint16_t length_b, jh_ctx_t *ctx){
        memcpy(dest, ctx->a+128-(length_b+7)/8, (length_b+7)/8);
 }
 
 
-void jh224_init(jh_ctx_tctx){
+void jh224_init(jh_ctx_t *ctx){
        jh_init(224, ctx);
 }
 
-void jh224_ctx2hash(void* dest, jh_ctx_t* ctx){
+void jh224_ctx2hash(void *dest, jh_ctx_t *ctx){
        jh_ctx2hash(dest, 224, ctx);
 }
 
-void jh256_init(jh_ctx_tctx){
+void jh256_init(jh_ctx_t *ctx){
        jh_init(256, ctx);
 }
 
-void jh256_ctx2hash(void* dest, jh_ctx_t* ctx){
+void jh256_ctx2hash(void *dest, jh_ctx_t *ctx){
        jh_ctx2hash(dest, 256, ctx);
 }
 
-void jh384_init(jh_ctx_tctx){
+void jh384_init(jh_ctx_t *ctx){
        jh_init(384, ctx);
 }
 
-void jh384_ctx2hash(void* dest, jh_ctx_t* ctx){
+void jh384_ctx2hash(void *dest, jh_ctx_t *ctx){
        jh_ctx2hash(dest, 384, ctx);
 }
 
-void jh512_init(jh_ctx_tctx){
+void jh512_init(jh_ctx_t *ctx){
        jh_init(512, ctx);
 }
 
-void jh512_ctx2hash(void* dest, jh_ctx_t* ctx){
+void jh512_ctx2hash(void *dest, jh_ctx_t *ctx){
        jh_ctx2hash(dest, 512, ctx);
 }
index 5e5fe4f20b969709a8c1732ab684df51615b0d9b..d8d9ad9439aa1fcfdf4b8f07f1a6e642143f3ddf 100644 (file)
@@ -50,7 +50,7 @@ uint8_t jh_l(uint8_t v, uint8_t w){
 }
 
 static
-void jh_round(uint8_t* a, const uint8_t* rc){
+void jh_round(uint8_t *a, const uint8_t *rc){
        uint8_t b[128];
        uint8_t i,r=0,x,y;
        for(i=0; i<128; ++i){
@@ -79,7 +79,7 @@ void jh_round(uint8_t* a, const uint8_t* rc){
 }
 
 static
-void jh_next_round_const(uint8_ta){
+void jh_next_round_const(uint8_t *a){
        uint8_t b[32];
        uint8_t i,x,y;
        for(i=0; i<32; ++i){
@@ -138,7 +138,7 @@ void degroup(uint8_t *a){
        memcpy(a,b,128);
 }
 
-void jh_encrypt(uint8_ta){
+void jh_encrypt(uint8_t *a){
        uint8_t i;
        uint8_t rc[32];
        /* grouping */
index 55fbefff33011f86c20ab8aa796c654837fd88c2..46a2bfae8d3a080d074badb77a973cabe9f69f05 100644 (file)
@@ -32,7 +32,7 @@
 #endif
 
 static
-void jh_round(uint8_ta, uint8_t roundno){
+void jh_round(uint8_t *a, uint8_t roundno){
        uint8_t b[128];
        uint8_t i,r=0,u,v,x,y;
        uint8_t *pr;
@@ -113,7 +113,7 @@ void degroup(uint8_t *a){
        memcpy(a,b,128);
 }
 
-void jh_encrypt(uint8_ta){
+void jh_encrypt(uint8_t *a){
        uint8_t i;
        /* grouping */
 #if DEBUG
index a827ea6e292671ebfa58e020c285a3151036fba1..030c7a69005745917730a91fa02c6f4d53767894 100644 (file)
@@ -440,8 +440,8 @@ keccak_f1600:
 
    -- or --
 
-       const uint8_trot_code = (const uint8_t*)keccak_rotate_codes;
-    const uint8_tidx_idx = (const uint8_t*)rho_pi_idx_table;
+       const uint8_t *rot_code = (const uint8_t*)keccak_rotate_codes;
+    const uint8_t *idx_idx = (const uint8_t*)rho_pi_idx_table;
     uint64_t *a_tmp = (uint64_t*)a;
        for(i = 0; i < 25; ++i){
                    *((uint64_t*)(((uint8_t*)b) + pgm_read_byte(idx_idx++))) =
@@ -657,7 +657,7 @@ keccak256_ctx2hash:
        .endfunc
 
 /*
-void keccak_ctx2hash(void* dest, uint16_t length_b, keccak_ctx_t* ctx){
+void keccak_ctx2hash(void *dest, uint16_t length_b, keccak_ctx_t *ctx){
        while(length_b>=ctx->r){
                memcpy(dest, ctx->a, ctx->bs);
                dest = (uint8_t*)dest + ctx->bs;
@@ -758,7 +758,7 @@ keccak256_init:
        ldi r25, hi8(1088)
        .endfunc
 /*
-void keccak_init(uint16_t r, keccak_ctx_tctx){
+void keccak_init(uint16_t r, keccak_ctx_t *ctx){
        memset(ctx->a, 0x00, 5 * 5 * 8);
        ctx->r = r;
        ctx->bs = (uint8_t)(r / 8);
@@ -787,7 +787,7 @@ keccak_init_1:
        .endfunc
 
 /*
-void keccak_lastBlock(keccak_ctx_t* ctx, const void* block, uint16_t length_b){
+void keccak_lastBlock(keccak_ctx_t *ctx, const void *block, uint16_t length_b){
     uint8_t length_B;
     uint8_t t;
     while(length_b >= ctx->r){
index 501ca77ba5ae3374e375ff527d77c0357667f95e..59c845af98eb1439d4db8225c889046bf355bc55 100644 (file)
@@ -47,7 +47,7 @@ void keccak_dump_state(uint64_t a[5][5]){
        }
 }
 
-void keccak_dump_ctx(keccak_ctx_tctx){
+void keccak_dump_ctx(keccak_ctx_t *ctx){
        keccak_dump_state(ctx->a);
        cli_putstr_P(PSTR("\r\nDBG: r: "));
        cli_hexdump_rev(&(ctx->r), 2);
@@ -160,7 +160,7 @@ void keccak_round(uint64_t *a, uint8_t rci){
 #endif
 }
 
-void keccak_f1600(voida){
+void keccak_f1600(void *a){
        uint8_t i = 0;
        do {
 #if DEBUG
@@ -172,12 +172,12 @@ void keccak_f1600(void* a){
        } while (++i < 24);
 }
 
-void keccak_nextBlock(keccak_ctx_t* ctx, const void* block){
+void keccak_nextBlock(keccak_ctx_t *ctx, const void *block){
        memxor(ctx->a, block, ctx->bs);
        keccak_f1600(ctx->a);
 }
 
-void keccak_lastBlock(keccak_ctx_t* ctx, const void* block, uint16_t length_b){
+void keccak_lastBlock(keccak_ctx_t *ctx, const void *block, uint16_t length_b){
     uint8_t length_B;
     uint8_t t;
     while(length_b >= ctx->r){
@@ -203,7 +203,7 @@ void keccak_lastBlock(keccak_ctx_t* ctx, const void* block, uint16_t length_b){
     keccak_f1600(ctx->a);
 }
 
-void keccak_ctx2hash(void* dest, uint16_t length_b, keccak_ctx_t* ctx){
+void keccak_ctx2hash(void *dest, uint16_t length_b, keccak_ctx_t *ctx){
        while(length_b >= ctx->r){
                memcpy(dest, ctx->a, ctx->bs);
                dest = (uint8_t*)dest + ctx->bs;
@@ -213,19 +213,19 @@ void keccak_ctx2hash(void* dest, uint16_t length_b, keccak_ctx_t* ctx){
        memcpy(dest, ctx->a, (length_b+7)/8);
 }
 
-void keccak224_ctx2hash(void* dest, keccak_ctx_t* ctx){
+void keccak224_ctx2hash(void *dest, keccak_ctx_t *ctx){
        keccak_ctx2hash(dest, 224, ctx);
 }
 
-void keccak256_ctx2hash(void* dest, keccak_ctx_t* ctx){
+void keccak256_ctx2hash(void *dest, keccak_ctx_t *ctx){
        keccak_ctx2hash(dest, 256, ctx);
 }
 
-void keccak384_ctx2hash(void* dest, keccak_ctx_t* ctx){
+void keccak384_ctx2hash(void *dest, keccak_ctx_t *ctx){
        keccak_ctx2hash(dest, 384, ctx);
 }
 
-void keccak512_ctx2hash(void* dest, keccak_ctx_t* ctx){
+void keccak512_ctx2hash(void *dest, keccak_ctx_t *ctx){
        keccak_ctx2hash(dest, 512, ctx);
 }
 
@@ -235,24 +235,24 @@ void keccak512_ctx2hash(void* dest, keccak_ctx_t* ctx){
   3. SHA3-384: âŒŠKeccak[r =  832, c =  768, d = 48]⌋384
   4. SHA3-512: âŒŠKeccak[r =  576, c = 1024, d = 64]⌋512
 */
-void keccak_init(uint16_t r, keccak_ctx_tctx){
+void keccak_init(uint16_t r, keccak_ctx_t *ctx){
        memset(ctx->a, 0x00, 5 * 5 * 8);
        ctx->r = r;
        ctx->bs = (uint8_t)(r / 8);
 }
 
-void keccak224_init(keccak_ctx_tctx){
+void keccak224_init(keccak_ctx_t *ctx){
        keccak_init(1152, ctx);
 }
 
-void keccak256_init(keccak_ctx_tctx){
+void keccak256_init(keccak_ctx_t *ctx){
        keccak_init(1088, ctx);
 }
 
-void keccak384_init(keccak_ctx_tctx){
+void keccak384_init(keccak_ctx_t *ctx){
        keccak_init( 832, ctx);
 }
 
-void keccak512_init(keccak_ctx_tctx){
+void keccak512_init(keccak_ctx_t *ctx){
        keccak_init( 576, ctx);
 }
index edc8d8105fe5b8159e87dd6538cdfd5244dc4ff0..b374ce566aaa4c926acd1111f42a2db7306c0e51 100644 (file)
@@ -38,19 +38,19 @@ typedef struct{
 } keccak_ctx_t;
 
 
-void keccak_init(uint16_t r, keccak_ctx_tctx);
-void keccak224_init(keccak_ctx_tctx);
-void keccak256_init(keccak_ctx_tctx);
-void keccak384_init(keccak_ctx_tctx);
-void keccak512_init(keccak_ctx_tctx);
-
-void keccak_nextBlock(keccak_ctx_t* ctx, const void* block);
-void keccak_lastBlock(keccak_ctx_t* ctx, const void* block, uint16_t length_b);
-
-void keccak_ctx2hash(void* dest, uint16_t length_b, keccak_ctx_t* ctx);
-void keccak224_ctx2hash(void* dest, keccak_ctx_t* ctx);
-void keccak256_ctx2hash(void* dest, keccak_ctx_t* ctx);
-void keccak384_ctx2hash(void* dest, keccak_ctx_t* ctx);
-void keccak512_ctx2hash(void* dest, keccak_ctx_t* ctx);
+void keccak_init(uint16_t r, keccak_ctx_t *ctx);
+void keccak224_init(keccak_ctx_t *ctx);
+void keccak256_init(keccak_ctx_t *ctx);
+void keccak384_init(keccak_ctx_t *ctx);
+void keccak512_init(keccak_ctx_t *ctx);
+
+void keccak_nextBlock(keccak_ctx_t *ctx, const void *block);
+void keccak_lastBlock(keccak_ctx_t *ctx, const void *block, uint16_t length_b);
+
+void keccak_ctx2hash(void *dest, uint16_t length_b, keccak_ctx_t *ctx);
+void keccak224_ctx2hash(void *dest, keccak_ctx_t *ctx);
+void keccak256_ctx2hash(void *dest, keccak_ctx_t *ctx);
+void keccak384_ctx2hash(void *dest, keccak_ctx_t *ctx);
+void keccak512_ctx2hash(void *dest, keccak_ctx_t *ctx);
 
 #endif /* KECCAK_H_ */
index 9da7dea7c3348a07eee5d4d0e0078b94864957f1..a5681b5feee5d003a79ed8a495c948c3e8f991c1 100644 (file)
@@ -92,7 +92,7 @@ uint8_t khazad_sbox(uint8_t a){
        return b|c;
 }
 
-static void gamma_1(uint8_ta){
+static void gamma_1(uint8_t *a){
        uint8_t i;
        for(i=0; i<8; ++i){
                *a = khazad_sbox(*a);
@@ -126,7 +126,7 @@ static const uint8_t h[8][4] PROGMEM = {
        { 0x7B, 0x86, 0x54, 0x31 }
 };
 
-static void theta(uint8_ta){
+static void theta(uint8_t *a){
        uint8_t i,j,x,accu;
        uint8_t c[8];
        uint8_t *hp;
@@ -146,7 +146,7 @@ static void theta(uint8_t* a){
 
 /******************************************************************************/
 
-static void khazad_round(uint8_t* a, const uint8_t* k){
+static void khazad_round(uint8_t *a, const uint8_t *k){
        gamma_1(a);
        theta(a);
        memxor(a, k, 8);
@@ -154,7 +154,7 @@ static void khazad_round(uint8_t* a, const uint8_t* k){
 
 /******************************************************************************/
 
-void khazad_init(const void* key, khazad_ctx_t* ctx){
+void khazad_init(const void *key, khazad_ctx_t *ctx){
        uint8_t c[8];
        uint8_t i,r=0;
        for(i=0; i<8; ++i){
@@ -182,7 +182,7 @@ void khazad_init(const void* key, khazad_ctx_t* ctx){
 
 /******************************************************************************/
 
-void khazad_enc(void* buffer, const khazad_ctx_t* ctx){
+void khazad_enc(void *buffer, const khazad_ctx_t *ctx){
        uint8_t r;
        memxor(buffer, ctx->k[0], 8);
        for(r=1; r<8; ++r){
@@ -194,7 +194,7 @@ void khazad_enc(void* buffer, const khazad_ctx_t* ctx){
 
 /******************************************************************************/
 
-void khazad_dec(void* buffer, const khazad_ctx_t* ctx){
+void khazad_dec(void *buffer, const khazad_ctx_t *ctx){
        uint8_t r=7;
        memxor(buffer, ctx->k[8], 8);
        gamma_1(buffer);
index 1f1c3358581919bdfb8cd9d8ba4ee47b17ad09bd..819cfaac4b9903c7bbd2a7c22263b8a5a883ab04 100644 (file)
@@ -26,9 +26,9 @@ typedef struct {
        uint8_t k[9][8];
 }khazad_ctx_t;
 
-void khazad_enc(void* buffer, const khazad_ctx_t* ctx);
-void khazad_dec(void* buffer, const khazad_ctx_t* ctx);
-void khazad_init(const void* key, khazad_ctx_t* ctx);
+void khazad_enc(void *buffer, const khazad_ctx_t *ctx);
+void khazad_dec(void *buffer, const khazad_ctx_t *ctx);
+void khazad_init(const void *key, khazad_ctx_t *ctx);
 uint8_t khazad_sbox(uint8_t);
 
 #endif /* KHAZAD_H_ */
index de3b170092330281674357475131a58019413d22..9710c4ecd963daff2e2b6308417694e45b64b0c5 100644 (file)
@@ -247,9 +247,9 @@ md5_core:
        mov r18, r14
 ;      rjmp md5_core_asm
 /*
-void md5_core(uint32_t* a, void* block, uint8_t as, uint8_t s, uint8_t i, uint8_t fi){
+void md5_core(uint32_t *a, void *block, uint8_t as, uint8_t s, uint8_t i, uint8_t fi){
        uint32_t t;
-       md5_func_tfuncs[]={md5_F, md5_G, md5_H, md5_I};
+       md5_func_t *funcs[]={md5_F, md5_G, md5_H, md5_I};
        as &= 0x3;
        / * a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). * /
        t = a[as] + funcs[fi](a[(as+1)&3], a[(as+2)&3], a[(as+3)&3]) + *((uint32_t*)block) + md5_T[i] ;
@@ -452,7 +452,7 @@ md5_core_exit:
 
 ;###################################################################
 /*
-void md5_nextBlock(md5_ctx_t *state, voidblock){
+void md5_nextBlock(md5_ctx_t *state, void *block){
        uint32_t        a[4];
        uint8_t         m,n,i=0;
 
@@ -743,7 +743,7 @@ md5_nextBlock:
 
 ;###############################################################################
 /*
-void md5_lastBlock(md5_ctx_t *state, const voidblock, uint16_t length_b){
+void md5_lastBlock(md5_ctx_t *state, const void *block, uint16_t length_b){
        uint16_t l;
        uint8_t b[64];
        while (length_b >= 512){
index 3feddd6881b17d2e80b7c33b7ce33951435e7161..f84edf8138c3613ee89728130ed09841d13f6bba 100644 (file)
--- a/md5/md5.c
+++ b/md5/md5.c
@@ -66,9 +66,9 @@ typedef uint32_t md5_func_t(uint32_t, uint32_t, uint32_t);
 #define ROTL32(x,n) (((x)<<(n)) | ((x)>>(32-(n))))  
 
 static
-void md5_core(uint32_t* a, void* block, uint8_t as, uint8_t s, uint8_t i, uint8_t fi){
+void md5_core(uint32_t *a, void *block, uint8_t as, uint8_t s, uint8_t i, uint8_t fi){
        uint32_t t;
-       md5_func_tfuncs[]={md5_F, md5_G, md5_H, md5_I};
+       md5_func_t *funcs[]={md5_F, md5_G, md5_H, md5_I};
        as &= 0x3;
        /* a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
 #ifdef DEBUG
@@ -85,7 +85,7 @@ void md5_core(uint32_t* a, void* block, uint8_t as, uint8_t s, uint8_t i, uint8_
        a[as]=a[(as+1)&3] + ROTL32(t, s);
 }
 
-void md5_nextBlock(md5_ctx_t *state, const voidblock){
+void md5_nextBlock(md5_ctx_t *state, const void *block){
        uint32_t        a[4];
        uint8_t         m,n,i=0;
        /* this requires other mixed sboxes */
@@ -137,7 +137,7 @@ void md5_nextBlock(md5_ctx_t *state, const void* block){
        state->counter++;
 }
 
-void md5_lastBlock(md5_ctx_t *state, const voidblock, uint16_t length_b){
+void md5_lastBlock(md5_ctx_t *state, const void *block, uint16_t length_b){
        uint16_t l;
        union {
                uint8_t   v8[64];
@@ -170,11 +170,11 @@ void md5_lastBlock(md5_ctx_t *state, const void* block, uint16_t length_b){
        md5_nextBlock(state, buffer.v8);
 }
 
-void md5_ctx2hash(md5_hash_t* dest, const md5_ctx_t* state){
+void md5_ctx2hash(md5_hash_t *dest, const md5_ctx_t *state){
        memcpy(dest, state->a, MD5_HASH_BYTES);
 }
 
-void md5(md5_hash_t* dest, const void* msg, uint32_t length_b){
+void md5(md5_hash_t *dest, const void *msg, uint32_t length_b){
        md5_ctx_t ctx;
        md5_init(&ctx);
        while(length_b>=MD5_BLOCK_BITS){
index 6b65c4a67888aa15118278cf7d149027108e7640..140b58352556e3dd98380ae523140d84601dc09f 100644 (file)
--- a/md5/md5.h
+++ b/md5/md5.h
@@ -47,9 +47,9 @@ typedef uint8_t md5_hash_t[MD5_HASH_BYTES];
 
  
 void md5_init(md5_ctx_t *s);
-void md5_nextBlock(md5_ctx_t *state, const voidblock);
-void md5_lastBlock(md5_ctx_t *state, const voidblock, uint16_t length);
-void md5_ctx2hash(md5_hash_t* dest, const md5_ctx_t* state);
-void md5(md5_hash_t* dest, const void* msg, uint32_t length_b);
+void md5_nextBlock(md5_ctx_t *state, const void *block);
+void md5_lastBlock(md5_ctx_t *state, const void *block, uint16_t length);
+void md5_ctx2hash(md5_hash_t *dest, const md5_ctx_t *state);
+void md5(md5_hash_t *dest, const void *msg, uint32_t length_b);
 
 #endif /*MD5_H_*/
index a32058bfc4c3c93d22abd82e23f83ae30d4e56e9..d72a1d82d7c4a79c50e6def0ff6771c850d6e8f7 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 /*
- * void memxor(void* dest, const void* src, uint16_t n);
+ * void memxor(void *dest, const void *src, uint16_t n);
  */
  /*
   * param dest is passed in r24:r25
index 4c0cc3d4a6d24bcf546599950cb1caac9251f853..3644c25257b143f36ba9be753f689066bbbb6cfd 100644 (file)
@@ -2,8 +2,8 @@
 #define MEMXOR_H_
 #include <stdint.h>
 
-void memxor(void* dest, const void* src, uint16_t n);
-void memxor_P(void* dest, const void* src, uint16_t n);
+void memxor(void *dest, const void *src, uint16_t n);
+void memxor_P(void *dest, const void *src, uint16_t n);
 
 
 #endif
index 7485b3eebb1fbc8612f5099a6dd13f33f0c63c87..a2c3fe12f876944e4f3d08075117ae1c480f9c86 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "memxor.h"
 
-void memxor(void* dest, const void* src, uint16_t n){
+void memxor(void *dest, const void *src, uint16_t n){
   while(n--){
     *((uint8_t*)dest) ^= *((uint8_t*)src);
     dest = (uint8_t*)dest +1;
index 4f152ea13fcd6fb539347a1211d275b96fa2da1d..590f00193427e4758dffa514e7edfde621c81bb7 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 /*
- * void memxor(void* dest, const void* src, uint16_t n);
+ * void memxor(void *dest, const void *src, uint16_t n);
  */
  /*
   * param dest is passed in r24:r25
index bdbf1ea51c460225b47a33283144c692f4fbbcee..fa436f532417507f4c8e8c4ea368463769537ef9 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 
-void mgf1_short_seed(void* dest, const void* seed, uint8_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t* p){
+void mgf1_short_seed(void *dest, const void *seed, uint8_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t *p){
        uint8_t buffer[seed_len_B+4];
        uint32_t counter=1;
        uint8_t hv_len = hfal_hash_getHashsize(p->hashfunction)/8;
@@ -50,6 +50,6 @@ void mgf1_short_seed(void* dest, const void* seed, uint8_t seed_len_B, uint16_t
        }
 }
 
-void mgf1(void* dest, const void* seed, uint16_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t* p){
+void mgf1(void *dest, const void *seed, uint16_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t *p){
        mgf1_short_seed(dest, seed, seed_len_B, out_length_B, p);
 }
index 76c3b8d94aac3bcb5a5123718b428c82a196b868..f7dac24f281febc815ba5d3d62d83b0779d351f0 100644 (file)
 #include "hfal-basic.h"
 
 typedef struct {
-       const hfdesc_thashfunction;
+       const hfdesc_t *hashfunction;
 } mgf1_parameter_t;
 
 /*
  * MGF1 as defined in PKCS #1 v2.1 B.2.1
  */
 
-void mgf1(void* dest, const void* seed, uint16_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t* p);
+void mgf1(void *dest, const void *seed, uint16_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t *p);
 
 #endif /* MGF1_H_ */
index acf3cf8863adead327dc8ca7c7d8e15d0e8d1cef..30a6217722c3653fad207d5a93ddf6a4792a8a7e 100644 (file)
@@ -45,7 +45,7 @@ const uint8_t rtaps[] PROGMEM = {
 };
        
 static 
-void memxor_P(voidd, PGM_VOID_P s, uint8_t length_B){
+void memxor_P(void *d, PGM_VOID_P s, uint8_t length_B){
        while(length_B--){
                *((uint8_t*)d) ^= pgm_read_byte(s);
                d = (uint8_t*)d +1;
@@ -60,7 +60,7 @@ void memxor_P(void* d, PGM_VOID_P s, uint8_t length_B){
 #define SHLX1(a) c0=((a)>>7); (a)^=(((a)<<1)|c1)
 
 static
-void clock_r(uint8_tr, uint8_t ibit, uint8_t cbit){
+void clock_r(uint8_t *r, uint8_t ibit, uint8_t cbit){
        uint8_t i,c0=0,c1=0; /* carry */
        ibit ^= ((r[159/8])>>(159%8))&1; /* ibit is now the same as feedback_bit */
        if(cbit){
@@ -204,7 +204,7 @@ const uint8_t fb1[] PROGMEM = {
 };
 
 static
-void clock_s(uint8_ts, uint8_t ibit, uint8_t cbit){
+void clock_s(uint8_t *s, uint8_t ibit, uint8_t cbit){
        uint8_t s0[20], s1[20];
        uint8_t i,c=0, c2=0;
        ibit ^= (s[19])>>7;
@@ -228,7 +228,7 @@ void clock_s(uint8_t* s, uint8_t ibit, uint8_t cbit){
 }
 
 static
-void clock_kg(uint8_t* r, uint8_t* s, uint8_t mixing, uint8_t input){
+void clock_kg(uint8_t *r, uint8_t *s, uint8_t mixing, uint8_t input){
        uint8_t rb, sb;
        rb = ((s[ 54/8])>>(( 54%8))) ^ ((r[106/8])>>(((106%8))));
        sb = ((s[106/8])>>((106%8))) ^ ((r[ 53/8])>>((( 53%8))));
@@ -239,9 +239,9 @@ void clock_kg(uint8_t* r, uint8_t* s, uint8_t mixing, uint8_t input){
        clock_s(s, input, sb);
 }
 
-void mickey128_init(voidkey, uint16_t keysize_b, 
-                    voidiv,  uint16_t ivsize_b, 
-                    mickey128_ctx_tctx){
+void mickey128_init(void *key, uint16_t keysize_b, 
+                    void *iv,  uint16_t ivsize_b, 
+                    mickey128_ctx_t *ctx){
        uint16_t i;
        memset(ctx->r, 0, 20);
        memset(ctx->s, 0, 20);
@@ -256,14 +256,14 @@ void mickey128_init(void* key, uint16_t keysize_b,
        }                  
 } 
 
-uint8_t mickey128_getbit(mickey128_ctx_tctx){
+uint8_t mickey128_getbit(mickey128_ctx_t *ctx){
        uint8_t ret;
        ret = 1&(*(ctx->r) ^ *(ctx->s));
        clock_kg(ctx->r, ctx->s, 0, 0);
        return ret;
 }
 
-uint8_t mickey128_getbyte(mickey128_ctx_tctx){
+uint8_t mickey128_getbyte(mickey128_ctx_t *ctx){
        uint8_t i,ret=0;
        for(i=0; i<8; ++i){
                ret<<=1;
index 9a125f4b032aab2d6241dc5861f065f795b74dea..e9e0deab9e0788366c56f57937b31c8eb857f979 100644 (file)
@@ -10,10 +10,10 @@ typedef struct mickey128_ctx_st{
 
 void debug_clock_r(void);
 void debug_clock_s(void);
-void mickey128_init(voidkey, uint16_t keysize_b, 
-                    voidiv,  uint16_t ivsize_b, 
-                    mickey128_ctx_tctx);
-uint8_t mickey128_getbit(mickey128_ctx_tctx);
-uint8_t mickey128_getbyte(mickey128_ctx_tctx);
+void mickey128_init(void *key, uint16_t keysize_b, 
+                    void *iv,  uint16_t ivsize_b, 
+                    mickey128_ctx_t *ctx);
+uint8_t mickey128_getbit(mickey128_ctx_t *ctx);
+uint8_t mickey128_getbyte(mickey128_ctx_t *ctx);
 
 #endif /*MICKEY128_H_*/
index c2f494fe48e2fe1071ba7e1a1ef5c6595339b13e..2373307dc670ad663622ed8bee5a8318eb24f765 100644 (file)
@@ -28,7 +28,7 @@
 #include "avr-asm-macros.S"
 
 #if 0
-static void mqq_inv_affine_transformation(uint8_t* input_bytes, uint8_t* result, const mqq160_sign_key_t* key){
+static void mqq_inv_affine_transformation(uint8_t *input_bytes, uint8_t *result, const mqq160_sign_key_t *key){
        /* The matrix SInv is given as two permutations of 160 elements. */
        uint8_t j, byteindex, bitindex, bitindex_d, byteindex_d, rp1, rp5;
        uint8_t *r1_ptr, *r5_ptr;
index 99c4db8e46c2fba5cee76ae5aa6e8dc08af58707..82d29ef2d0062ca8077afc3bc0baeed4146349b8 100644 (file)
@@ -30,7 +30,7 @@ static const uint8_t mod20_table[32] PROGMEM = {
                 8,  9, 10, 11, 12, 13, 14, 15,
 };
 
-static void memxor_idx(void* dest, const void* src, uint16_t length, uint8_t dist){
+static void memxor_idx(void *dest, const void *src, uint16_t length, uint8_t dist){
        while(length--){
                *((uint8_t*)dest) ^= *((uint8_t*)src);
                dest = (uint8_t*)dest + 1;
@@ -43,7 +43,7 @@ It should be programmed in a more flexible way
 in the MQQ160-SIGN C Library.
 */
 
-static void mqq_inv_affine_transformation(const uint8_t* input_bytes, uint8_t* result, const mqq160_sign_key_t* key){
+static void mqq_inv_affine_transformation(const uint8_t *input_bytes, uint8_t *result, const mqq160_sign_key_t *key){
        /* The matrix SInv is given as two permutations of 160 elements. */
        uint8_t j, byteindex, bitindex, bitindex_d, byteindex_d, rp1, rp5;
        const uint8_t *rp1_ptr, *rp5_ptr;
@@ -94,7 +94,7 @@ static void mqq_inv_affine_transformation(const uint8_t* input_bytes, uint8_t* r
 
 static uint16_t MaskShort[8] = {0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100};
 
-static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_tkey){
+static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t *key){
        uint8_t  e[9];
        uint16_t a[8];
        uint8_t result, column, row, k;
@@ -178,7 +178,7 @@ static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t*
        return(result);
 }
 
-void mqq160_sign(void* dest, const void* hash, const mqq160_sign_key_t* key){
+void mqq160_sign(void *dest, const void *hash, const mqq160_sign_key_t *key){
        uint8_t i, r1[20], byteindex;
        mqq_inv_affine_transformation((uint8_t*)hash, (uint8_t*)dest, key);
        r1[0]=((uint8_t*)dest)[0];
index 6a1d43b5a79a9acdec935f46a524891d8f748487..3271dfdf03bd77da9cab56ced4afb01f11190b82 100644 (file)
@@ -28,6 +28,6 @@ typedef struct{
        const uint8_t *rp5;
 } mqq160_sign_key_t;
 
-void mqq160_sign(void* dest, const void* hash, const mqq160_sign_key_t* key);
+void mqq160_sign(void *dest, const void *hash, const mqq160_sign_key_t *key);
 
 #endif /* MQQ160SIGN_H_ */
index 11234558b77a57386769ee3cdc4c6aaf89b60396..60ac137caf074479fdfa90e1906477061978ace3 100644 (file)
@@ -28,7 +28,7 @@
 #include "avr-asm-macros.S"
 
 #if 0
-static void mqq_inv_affine_transformation(uint8_t* input_bytes, uint8_t* result, const mqq160_sign_key_t* key){
+static void mqq_inv_affine_transformation(uint8_t *input_bytes, uint8_t *result, const mqq160_sign_key_t *key){
        /* The matrix SInv is given as two permutations of 160 elements. */
        uint8_t j, byteindex, bitindex, bitindex_d, byteindex_d, rp1, rp5;
        uint8_t *r1_ptr, *r5_ptr;
index d8c889f68ceea0868642b45e1721148492c66f2f..d484308f69587b9220804e0705f79d5f787f52a7 100644 (file)
@@ -41,14 +41,14 @@ in the MQQ160-SIGN C Library.
 */
 
 
-void mqq_inv_affine_transformation(uint8_t* input_bytes, uint8_t* result, const mqq160_sign_key_t* key);
-uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_tkey);
+void mqq_inv_affine_transformation(uint8_t *input_bytes, uint8_t *result, const mqq160_sign_key_t *key);
+uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t *key);
 
 
 #if 0
 static uint16_t MaskShort[8] = {0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100};
 
-static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_tkey){
+static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t *key){
        uint8_t  e[9];
        uint16_t a[8];
        uint8_t result, column, row, k;
@@ -133,7 +133,7 @@ static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t*
 
 #endif
 
-void mqq160_sign_P(void* dest, const void* hash, const mqq160_sign_key_t* key_P){
+void mqq160_sign_P(void *dest, const void *hash, const mqq160_sign_key_t *key_P){
        uint8_t i, r1[20], byteindex;
        mqq160_sign_key_t key;
 
index 90f11d29655d49547cb6be83de897689520dfacd..73aaf42d35e311000cd459e2e6fe7cc83011c88f 100644 (file)
@@ -41,7 +41,7 @@ static const uint8_t mod20_table[32] PROGMEM = {
                 8,  9, 10, 11, 12, 13, 14, 15,
 };
 
-static void memxor_idx_P(uint8_t* dest, const uint8_t* src, uint16_t length, uint8_t dist){
+static void memxor_idx_P(uint8_t *dest, const uint8_t *src, uint16_t length, uint8_t dist){
        while(length--){
                 *((uint8_t*)dest) ^= pgm_read_byte((uint8_t*)src);
                dest = (uint8_t*)dest + 1;
@@ -54,7 +54,7 @@ It should be programmed in a more flexible way
 in the MQQ160-SIGN C Library.
 */
 
-static void mqq_inv_affine_transformation(uint8_t* input_bytes, uint8_t* result, const mqq160_sign_key_t* key){
+static void mqq_inv_affine_transformation(uint8_t *input_bytes, uint8_t *result, const mqq160_sign_key_t *key){
        /* The matrix SInv is given as two permutations of 160 elements. */
        uint8_t j, byteindex, bitindex, bitindex_d, byteindex_d, rp1, rp5;
        const uint8_t *r1_ptr, *r5_ptr;
@@ -103,7 +103,7 @@ static void mqq_inv_affine_transformation(uint8_t* input_bytes, uint8_t* result,
 
 static uint16_t MaskShort[8] = {0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100};
 
-static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_tkey){
+static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t *key){
        uint8_t  e[9];
        uint16_t a[8];
        uint8_t result, column, row, k;
@@ -186,7 +186,7 @@ static uint8_t mqq_q(uint8_t i, uint8_t b1, uint8_t b2, const mqq160_sign_key_t*
        return(result);
 }
 
-void mqq160_sign_P(void* dest, const void* hash, const mqq160_sign_key_t* key_P){
+void mqq160_sign_P(void *dest, const void *hash, const mqq160_sign_key_t *key_P){
        uint8_t i, r1[20], byteindex;
        mqq160_sign_key_t key;
        memcpy_P(&key, key_P, sizeof(mqq160_sign_key_t));
index 19208a29de0ac20417ff531b75673011ca84dc0a..4cd64b376d5a491933e9c39f112f45b6f1fd0cdc 100644 (file)
@@ -22,6 +22,6 @@
 
 #include "mqq160-sign.h"
 
-void mqq160_sign_P(void* dest, const void* hash, const mqq160_sign_key_t* key_P);
+void mqq160_sign_P(void *dest, const void *hash, const mqq160_sign_key_t *key_P);
 
 #endif /* MQQ160SIGN_P_H_ */
index f7fc011ab28f035d5e09ab09c162e869c8a9d733..c8934660c8c98a6a8764ae8ca9a941cd594ec5c8 100644 (file)
@@ -85,7 +85,7 @@ const uint8_t rp5[160] PROGMEM = {
 
 const mqq160_sign_key_t testkey_P PROGMEM = {a, cc1, cc2, rp1, rp5 };
 
-void mqq_load_pgm_key(void* buffer, mqq160_sign_key_t* key, const mqq160_sign_key_t* key_P){
+void mqq_load_pgm_key(void *buffer, mqq160_sign_key_t *key, const mqq160_sign_key_t *key_P){
        uint8_t *buf_ptr;
        buf_ptr = buffer;
        memcpy_P(key, key_P, sizeof(mqq160_sign_key_t));
index e10e5b5b71db750851195c9e09bd8eabeab1928b..e53f117f4ee07a01e3aa3f725f3233102df0fb73 100644 (file)
@@ -37,6 +37,6 @@ RP1[] and RP5[] of 160 uint8_ts.
 */
 extern const mqq160_sign_key_t testkey_P;
 
-void mqq_load_pgm_key(void* buffer, mqq160_sign_key_t* key, const mqq160_sign_key_t* key_P);
+void mqq_load_pgm_key(void *buffer, mqq160_sign_key_t *key, const mqq160_sign_key_t *key_P);
 
 #endif /* MQQ160SIGN_TESTKEY_H_ */
index c90b1a1ea11ed4f522b2d50e3a8c02a47c73cdbb..e316416ab985e27aae363c5de5501746121dae34 100644 (file)
@@ -36,7 +36,7 @@
 /*
 #include "cli.h" / * only for debugging * /
 
-void dump_mugi_ctx(mugi_ctx_tctx){
+void dump_mugi_ctx(mugi_ctx_t *ctx){
        uint8_t i;
        cli_putstr_P(PSTR("\r\n== MUGI CTX DUMP==\r\n a:"));
        cli_hexdump(&(ctx->a[0]), 8);
@@ -101,7 +101,7 @@ uint64_t rotr64(uint64_t a, uint8_t i){
 
 #define T(x) (((uint8_t*)&t)[(x)])
 #define D(y) (((uint8_t*)dest)[(y)])
-static void mugi_f(uint64_t* dest, uint64_t* a, uint64_t* b){
+static void mugi_f(uint64_t *dest, uint64_t *a, uint64_t *b){
        uint64_t t;
        uint8_t i,x;
        t = (*a); 
@@ -147,7 +147,7 @@ static void mugi_f(uint64_t* dest, uint64_t* a, uint64_t* b){
 } 
 
 static
-void mugi_rho(mugi_ctx_tctx){
+void mugi_rho(mugi_ctx_t *ctx){
        uint64_t t,bx;
        t = ctx->a[1];
        ctx->a[1] = ctx->a[2];
@@ -161,7 +161,7 @@ void mugi_rho(mugi_ctx_t* ctx){
 } 
 
 static
-void mugi_rho_init(uint64_ta){
+void mugi_rho_init(uint64_t *a){
        uint64_t t;
        t = a[1];
        a[1] = a[2];
@@ -174,7 +174,7 @@ void mugi_rho_init(uint64_t* a){
 } 
 
 static
-void mugi_lambda(uint64_tb, uint64_t *a){
+void mugi_lambda(uint64_t *b, uint64_t *a){
        uint8_t i;
        uint64_t t;
        t=b[15];
@@ -186,7 +186,7 @@ void mugi_lambda(uint64_t* b, uint64_t *a){
        b[10] ^= rotl64(b[14], 32);
 }
 
-void mugi_init(const void* key, const void* iv, mugi_ctx_t* ctx){
+void mugi_init(const void *key, const void *iv, mugi_ctx_t *ctx){
        uint8_t i;
        uint64_t a0;
        memcpy(ctx->a, key, 128/8);
@@ -209,7 +209,7 @@ void mugi_init(const void* key, const void* iv, mugi_ctx_t* ctx){
        a0=0x00;
 }
 
-uint64_t mugi_gen(mugi_ctx_tctx){
+uint64_t mugi_gen(mugi_ctx_t *ctx){
        uint64_t r;
        r=ctx->a[0];
        mugi_rho(ctx);
index 809b9fdea4aa4c85fcacf8a064940c8551c30f78..07ee80857e4ae335941345729ca3bcee562acf70 100644 (file)
@@ -34,8 +34,8 @@ typedef struct{
        uint64_t b[16];
 }mugi_ctx_t; /* 152 bytes in total */
 
-void mugi_init(const void* key, const void* iv, mugi_ctx_t* ctx);
-uint64_t mugi_gen(mugi_ctx_tctx);
+void mugi_init(const void *key, const void *iv, mugi_ctx_t *ctx);
+uint64_t mugi_gen(mugi_ctx_t *ctx);
 
 
 #endif /* MUGI_H_ */
index 0fbdcf9f5da903693887b0a95829cdc040867e37..2dae59173933fc8fba89da7e4625fae527a94bc3 100644 (file)
@@ -39,7 +39,7 @@
 #define RC_POS 0
 
 static
-void gamma_1(uint32_ta){
+void gamma_1(uint32_t *a){
        uint32_t tmp;
        
        a[1] ^= ~((a[3]) | (a[2]));
@@ -56,21 +56,21 @@ void gamma_1(uint32_t* a){
 #define ROTR32(a,n) (((a)>>n)|((a)<<(32-n)))
 
 static
-void pi1(uint32_ta){
+void pi1(uint32_t *a){
        a[1] = ROTL32(a[1], 1);
        a[2] = ROTL32(a[2], 5);
        a[3] = ROTL32(a[3], 2);
 }
 
 static
-void pi2(uint32_ta){
+void pi2(uint32_t *a){
        a[1] = ROTR32(a[1], 1);
        a[2] = ROTR32(a[2], 5);
        a[3] = ROTR32(a[3], 2);
 }
 
 static
-void theta(const uint32_t* k, uint32_t* a){
+void theta(const uint32_t *k, uint32_t *a){
        uint32_t temp;
 
        temp = a[0] ^ a[2]; temp ^= ROTR32(temp, 8) ^ ROTL32(temp, 8);
@@ -89,7 +89,7 @@ void theta(const uint32_t* k, uint32_t* a){
 }
 
 static 
-void noekeon_round(uint32_t* key, uint32_t* state, uint8_t const1, uint8_t const2){
+void noekeon_round(uint32_t *key, uint32_t *state, uint8_t const1, uint8_t const2){
        ((uint8_t*)state)[RC_POS] ^= const1;
        theta(key, state);
        ((uint8_t*)state)[RC_POS] ^= const2;
@@ -114,7 +114,7 @@ const uint8_t rc_tab[]
 */
 
 static
-void changendian32(voida){
+void changendian32(void *a){
        ((uint8_t*)a)[0] ^= ((uint8_t*)a)[3];
        ((uint8_t*)a)[3] ^= ((uint8_t*)a)[0];
        ((uint8_t*)a)[0] ^= ((uint8_t*)a)[3];
@@ -125,7 +125,7 @@ void changendian32(void* a){
 }
 
 static
-void changendian(voida){
+void changendian(void *a){
        changendian32((uint32_t*)(&(((uint32_t*)a)[0])));
        changendian32((uint32_t*)(&(((uint32_t*)a)[1])));
        changendian32((uint32_t*)(&(((uint32_t*)a)[2])));
@@ -134,7 +134,7 @@ void changendian(void* a){
 
 /******************************************************************************/
 
-void noekeon_enc(void* buffer, const void* key){
+void noekeon_enc(void *buffer, const void *key){
        uint8_t rc=0x80;
        uint8_t keyb[16];
        int8_t i;
@@ -158,7 +158,7 @@ void noekeon_enc(void* buffer, const void* key){
 }
 
 
-void noekeon_dec(void* buffer, const void* key){
+void noekeon_dec(void *buffer, const void *key){
        uint8_t rc;
        int8_t i;
        uint8_t nullv[16];
@@ -189,7 +189,7 @@ void noekeon_dec(void* buffer, const void* key){
        changendian(buffer);
 }
 
-void noekeon_init(const void* key, noekeon_ctx_t* ctx){
+void noekeon_init(const void *key, noekeon_ctx_t *ctx){
        uint8_t nullv[16];
        
        memset(nullv, 0, 16);
index 9c046f3004cb374b8d34945109a03ccb365a5a4a..744c8349ca889c57f9b4696c22a44905ca2dc531 100644 (file)
@@ -42,7 +42,7 @@
  */
 typedef uint8_t noekeon_ctx_t[16];
 
-/** \fn void noekeon_enc(void* buffer, const void* key)
+/** \fn void noekeon_enc(void *buffer, const void *key)
  * \brief noekeon encrytion funtion
  * 
  * This function encrypts a block (64 bit = 8 byte) with the noekeon encrytion
@@ -53,9 +53,9 @@ typedef uint8_t noekeon_ctx_t[16];
  * \param key    pointer to either the key (128 bit = 16 byte; direct mode) or 
  * to the context (indirect mode)
  */
-void noekeon_enc(void* buffer, const void* key);
+void noekeon_enc(void *buffer, const void *key);
 
-/** \fn void noekeon_dec(void* buffer, const void* key)
+/** \fn void noekeon_dec(void *buffer, const void *key)
  * \brief noekeon encrytion funtion
  * 
  * This function decrypts a block (64 bit = 8 byte) encrypted with the noekeon 
@@ -67,10 +67,10 @@ void noekeon_enc(void* buffer, const void* key);
  * \param key    pointer to either the key (128 bit = 16 byte; direct mode) or 
  * to the context (indirect mode)
  */
-void noekeon_dec(void* buffer, const void* key);
+void noekeon_dec(void *buffer, const void *key);
 
 
-/** \fn void noekeon_init(const void* key, noekeon_ctx_t* ctx)
+/** \fn void noekeon_init(const void *key, noekeon_ctx_t *ctx)
  * \brief noekeon context generation function for indirect mode
  * 
  * This function generates a context from the supplied key for using
@@ -80,6 +80,6 @@ void noekeon_dec(void* buffer, const void* key);
  * \param ctx pointer to the context to fill with key material 
  * to the context (indirect mode)
  */
-void noekeon_init(const void* key, noekeon_ctx_t* ctx);
+void noekeon_init(const void *key, noekeon_ctx_t *ctx);
 
 #endif /*NOEKEON_H_*/
index b0a2a16f93da12843c5d39a022103f04f5781c01..76458fb7a1636453b2c1f6cc9c964b025adf5df1 100644 (file)
@@ -166,7 +166,7 @@ bigendian_rotr32_exit:
 
 /******************************************************************************/
 /*
-void theta(uint32_t* k, uint32_t* a){
+void theta(uint32_t *k, uint32_t *a){
        uint32_t temp;
        temp = a[0] ^ a[2]; temp ^= ROTR32(temp, 8) ^ ROTL32(temp, 8);
        a[1] ^= temp;
@@ -583,7 +583,7 @@ pi:
 /******************************************************************************/
        
 /*
-void noekeon_init(void* key, noekeon_ctx_t* ctx){
+void noekeon_init(void *key, noekeon_ctx_t *ctx){
        uint8_t nullv[16];
        
        memset(nullv, 0, 16);
index 0c0b89a840ca1050ab0510f592fa6c8d2987fb04..9da291c15d55297386d9fa99f535f59343b4387b 100644 (file)
@@ -43,7 +43,7 @@
 .extern noekeon_enc
 
 /*
- * void noekeon_cbc_enc(void* buffer, uint8_t block_cnt, const void* key)
+ * void noekeon_cbc_enc(void *buffer, uint8_t block_cnt, const void *key)
  */
 
 /* param buffer    is passed in r24:r25
index e9ced11ff4820d77cbb335a54fcd69838cb12fad..e6cb14a0b645e3df38c0a2c7f08cab2ff223bc6c 100644 (file)
@@ -4,6 +4,6 @@
 #include <stdint.h>
 #include "noekeon.h"
 
-void noekeon_cbc_enc(void* buffer, uint8_t block_cnt, const void* key);
+void noekeon_cbc_enc(void *buffer, uint8_t block_cnt, const void *key);
 
 #endif /*NOEKEON_CBC_ENC_H_*/
index bf366baa2872abdda68ae32182d886e8b1066ce9..683bee557785c03c973ac99cb94f10ee2466ec3c 100644 (file)
@@ -29,7 +29,7 @@
 .extern noekeon_enc
 
 /*
- * void noekeon_ctr_next(void* buffer, const noekeon_ctr_ctx_t* ctx); 
+ * void noekeon_ctr_next(void *buffer, const noekeon_ctr_ctx_t *ctx); 
  */
 .global noekeon_ctr_next
 /*
index d7a601f7d374be5541a1542a02589c44246d24e4..73278865770a43b360521437dbdcddc21936c42d 100644 (file)
@@ -37,6 +37,6 @@ typedef struct{
        uint8_t key[16];
 }noekeon_ctr_ctx_t;
 
-void noekeon_ctr_next(void* buffer, const noekeon_ctr_ctx_t* ctx);
+void noekeon_ctr_next(void *buffer, const noekeon_ctr_ctx_t *ctx);
 
 #endif /*NOEKEON_CTR_H_*/
index 4e73c7cde91bad353aa327a34c5cff46c2137526..a329b7559ea93e54f514f6e6264566a787bb0008 100644 (file)
@@ -46,7 +46,7 @@ uint8_t random8(void){
        return sr[i];
 }
 
-void random_block(voiddest){
+void random_block(void *dest){
        i=0;
        noekeon_enc(random_state, random_key);
        memcpy(dest, random_state, 16);
@@ -56,11 +56,11 @@ void srandom32(uint32_t seed){
        memcpy(random_key, &seed, 4);
 }
 
-void random_seed(const voidbuffer){
+void random_seed(const void *buffer){
        memcpy(random_key, buffer, 16);
 }
 
-void random_add(const voidbuffer){
+void random_add(const void *buffer){
        memxor(random_key, buffer, 16);
 }
 
index ff9ca0363ffa206258ac962873564f89fa4257dc..dba7295fced3c2acd865d4b25fb2964c07af806b 100644 (file)
 #include <stdint.h>
 
 uint8_t random8(void);
-void random_block(voiddest);
+void random_block(void *dest);
 void srandom32(uint32_t seed);
-void random_seed(const voidbuffer);
-void random_add(const voidbuffer);
+void random_seed(const void *buffer);
+void random_add(const void *buffer);
 
 #endif /* PRNG_H_*/
 
index 598280b6882afb754ee64662ce896e72ac6c60f8..b4000cdb17b4d022f31ea6d1f46fb58fe46af010 100644 (file)
@@ -35,7 +35,7 @@
 /******************************************************************************/
 
 /*
- * void noekeon_omac_init(noekeon_omac_ctx_tctx){
+ * void noekeon_omac_init(noekeon_omac_ctx_t *ctx){
  *     memset(ctx, 0, 16);
  * }
  */
@@ -56,7 +56,7 @@ omac_noekeon_init:
 /******************************************************************************/       
 
 /*
- * void omac_noekeon_tweak(uint8_t t, const void* key, noekeon_omac_ctx_t* ctx){
+ * void omac_noekeon_tweak(uint8_t t, const void *key, noekeon_omac_ctx_t *ctx){
  *     *ctx[15] = t;
  *     noekeon_enc(ctx, key);
  * }
@@ -76,7 +76,7 @@ omac_noekeon_tweak:
 /******************************************************************************/
        
 /*
- * void noekeon_omac_next(const void* buffer, const void* key, noekeon_omac_ctx_t* ctx){
+ * void noekeon_omac_next(const void *buffer, const void *key, noekeon_omac_ctx_t *ctx){
  *     memxor(ctx, buffer, 16);
  *     noekeon_enc(ctx, key);
  * }
@@ -104,7 +104,7 @@ omac_noekeon_next:
 /******************************************************************************/
 
 /*
- * void omac_noekeon_comppad(uint8_t* pad, const void* key, uint8_t length_b){
+ * void omac_noekeon_comppad(uint8_t *pad, const void *key, uint8_t length_b){
  *     uint8_t c1,c2,r,j;
  *     memset(pad, 0, 16);
  *     noekeon_enc(pad, key);
@@ -194,7 +194,7 @@ omac_noekeon_comppad:
 /******************************************************************************/
 
 /*
- * void omac_noekeon_last(const void* buffer, uint8_t length_b, const void* key, noekeon_omac_ctx_t* ctx){
+ * void omac_noekeon_last(const void *buffer, uint8_t length_b, const void *key, noekeon_omac_ctx_t *ctx){
  *     while(length_b>128){
  *             omac_noekeon_next(buffer, key, ctx);
  *             buffer = (uint8_t*)buffer +16;
@@ -263,8 +263,8 @@ omac_noekeon_last:
 /******************************************************************************/
 
 /* 
- *void omac_noekeon(void* dest, const void* msg, uint16_t msglength_b,
- *                  const voidkey, uint8_t t){
+ *void omac_noekeon(void *dest, const void *msg, uint16_t msglength_b,
+ *                  const void *key, uint8_t t){
  *     omac_noekeon_init(dest);
  *     if(t!=0xff)
  *             omac_noekeon_tweak(t,key,dest);
index a4db052f6b33ab188de3b7d3a4c2f0313af56900..6ed1a37c5235fa50b300ba0c94dbe2d1e1ccba47 100644 (file)
 
 typedef uint8_t omac_noekeon_ctx_t[16];
 
-void omac_noekeon_init(omac_noekeon_ctx_tctx);
-void omac_noekeon_tweak(uint8_t t, const void* key, omac_noekeon_ctx_t* ctx);
-void omac_noekeon_next(const void* buffer, const void* key, 
-                       omac_noekeon_ctx_tctx);
-void omac_noekeon_last(const void* buffer, uint8_t length_b, const void* key, 
-                       omac_noekeon_ctx_tctx);
-void omac_noekeon(void* dest, const void* msg, uint16_t msglength_b,
-                  const voidkey, uint8_t t);
+void omac_noekeon_init(omac_noekeon_ctx_t *ctx);
+void omac_noekeon_tweak(uint8_t t, const void *key, omac_noekeon_ctx_t *ctx);
+void omac_noekeon_next(const void *buffer, const void *key, 
+                       omac_noekeon_ctx_t *ctx);
+void omac_noekeon_last(const void *buffer, uint8_t length_b, const void *key, 
+                       omac_noekeon_ctx_t *ctx);
+void omac_noekeon(void *dest, const void *msg, uint16_t msglength_b,
+                  const void *key, uint8_t t);
 
 #endif /*NOEKEON_OMAC_H_*/
index 3046ede3a29458238266e8427cb7ab5039d2dcb4..146892da31402580c595601d11b0122f0c61ae7a 100644 (file)
@@ -5,23 +5,23 @@
 #include <stdint.h>
 
 
-void omac_noekeon_init(omac_noekeon_ctx_tctx){
+void omac_noekeon_init(omac_noekeon_ctx_t *ctx){
        memset(ctx, 0, 16);
 }
 
 
-void omac_noekeon_tweak(uint8_t t, const void* key, omac_noekeon_ctx_t* ctx){
+void omac_noekeon_tweak(uint8_t t, const void *key, omac_noekeon_ctx_t *ctx){
        *ctx[15] = t;
        noekeon_enc(ctx, key);
 }
 
-void omac_noekeon_next(const void* buffer, const void* key, omac_noekeon_ctx_t* ctx){
+void omac_noekeon_next(const void *buffer, const void *key, omac_noekeon_ctx_t *ctx){
        memxor(ctx, buffer, 16);
        noekeon_enc(ctx, key);
 }
 
 static
-void omac_noekeon_comppad(uint8_t* pad, const void* key, uint8_t length_b){
+void omac_noekeon_comppad(uint8_t *pad, const void *key, uint8_t length_b){
        uint8_t c1,c2,r,j;
        memset(pad, 0, 16);
        noekeon_enc(pad, key);
@@ -42,7 +42,7 @@ void omac_noekeon_comppad(uint8_t* pad, const void* key, uint8_t length_b){
        }
 }
 
-void omac_noekeon_last(const void* buffer, uint8_t length_b, const void* key, omac_noekeon_ctx_t* ctx){
+void omac_noekeon_last(const void *buffer, uint8_t length_b, const void *key, omac_noekeon_ctx_t *ctx){
        while(length_b>128){
                omac_noekeon_next(buffer, key, ctx);
                buffer = (uint8_t*)buffer +16;
@@ -55,8 +55,8 @@ void omac_noekeon_last(const void* buffer, uint8_t length_b, const void* key, om
 }
 
 
-void omac_noekeon(void* dest, const void* msg, uint16_t msglength_b,
-                  const voidkey, uint8_t t){
+void omac_noekeon(void *dest, const void *msg, uint16_t msglength_b,
+                  const void *key, uint8_t t){
        omac_noekeon_init(dest);
        if(t!=0xff)
                omac_noekeon_tweak(t,key,dest);
index ac7c925be62ebe7780a05240eb3c79114ea1e0d9..faea0689cf298051758e04368c0bd62fd1cd0064 100644 (file)
@@ -33,7 +33,7 @@
 #include "present128.h"
 
 static
-void key_update_128(uint8_tbuffer, uint8_t round){
+void key_update_128(uint8_t *buffer, uint8_t round){
        uint8_t j;
        uint8_t t8;
        union __attribute__((packed)){
@@ -63,7 +63,7 @@ void key_update_128(uint8_t* buffer, uint8_t round){
 
 
 static
-void key_update_128_inv(uint8_tbuffer, uint8_t round){
+void key_update_128_inv(uint8_t *buffer, uint8_t round){
        uint8_t j;
        uint8_t t8;
        union __attribute__((packed)){
@@ -93,7 +93,7 @@ void key_update_128_inv(uint8_t* buffer, uint8_t round){
        }while(j--);
 }
 
-void present128_init(const uint8_t* key, uint8_t keysize_b, present128_ctx_t* ctx){
+void present128_init(const uint8_t *key, uint8_t keysize_b, present128_ctx_t *ctx){
        uint8_t i;
        memcpy(ctx->fwd_key, key, 16);
        memcpy(ctx->rev_key, key, 16);
@@ -102,16 +102,16 @@ void present128_init(const uint8_t* key, uint8_t keysize_b, present128_ctx_t* ct
        }
 }
 
-void present128_enc(void* buffer, present128_ctx_t* ctx){
+void present128_enc(void *buffer, present128_ctx_t *ctx){
        present_generic_enc(buffer, (uint8_t*)ctx, 16, key_update_128);
 }
 
-void present128_dec(void* buffer, present128_ctx_t* ctx){
+void present128_dec(void *buffer, present128_ctx_t *ctx){
        present_generic_dec(buffer, (uint8_t*)ctx, 16, key_update_128_inv);
 }
 
 /*
-void present128_enc(void* buffer, present128_ctx_t* ctx){
+void present128_enc(void *buffer, present128_ctx_t *ctx){
        uint8_t i,j,tmp[8], k[16];
        memcpy(k, ctx->fwd_key, 16);
        memxor(buffer, k, 8);
@@ -126,7 +126,7 @@ void present128_enc(void* buffer, present128_ctx_t* ctx){
        }
 }
 
-void present128_dec(void* buffer, present128_ctx_t* ctx){
+void present128_dec(void *buffer, present128_ctx_t *ctx){
        uint8_t j,tmp[8], k[16];
        uint8_t i;
        memcpy(k, ctx->rev_key, 16);
index d74fff9735a9a8d83e83ccf4e2b37b0d8ecfecab..7c37dc4b0cd5e30324a5b75805653e80ff5df4a2 100644 (file)
@@ -27,9 +27,9 @@ typedef struct __attribute__((packed)) present128_ctx_st {
 } present128_ctx_t;
 
 
-void present128_init(const uint8_t* key, uint8_t keysize_b, present128_ctx_t* ctx);
-void present128_enc(void* buffer, present128_ctx_t* ctx);
-void present128_dec(void* buffer, present128_ctx_t* ctx);
+void present128_init(const uint8_t *key, uint8_t keysize_b, present128_ctx_t *ctx);
+void present128_enc(void *buffer, present128_ctx_t *ctx);
+void present128_dec(void *buffer, present128_ctx_t *ctx);
 
 
 #endif /*PRESENT128_H_*/
index 2a5589b32a18cb2a03c7e46078dbaa33d9bd732f..bc173703fb9d5dc691030cd5033f935fb4ee2274 100644 (file)
@@ -33,7 +33,7 @@
 #include "present80.h"
 
 static
-void key_update(uint8_tbuffer, uint8_t round){
+void key_update(uint8_t *buffer, uint8_t round){
        uint8_t j;
        union __attribute__((packed)){
                uint8_t   v8[2];
@@ -63,7 +63,7 @@ void key_update(uint8_t* buffer, uint8_t round){
 }
 
 static
-void key_update_inv(uint8_tbuffer, uint8_t round){
+void key_update_inv(uint8_t *buffer, uint8_t round){
        uint8_t j;
        union __attribute__((packed)){
                uint8_t   v8[2];
@@ -92,7 +92,7 @@ void key_update_inv(uint8_t* buffer, uint8_t round){
        }while(j--);
 }
 
-void present80_init(const uint8_t* key, uint8_t keysize_b, present80_ctx_t* ctx){
+void present80_init(const uint8_t *key, uint8_t keysize_b, present80_ctx_t *ctx){
        uint8_t i;
        memcpy(ctx->fwd_key, key, 10);
        memcpy(ctx->rev_key, key, 10);
@@ -101,16 +101,16 @@ void present80_init(const uint8_t* key, uint8_t keysize_b, present80_ctx_t* ctx)
        }
 }
 
-void present80_enc(void* buffer, present80_ctx_t* ctx){
+void present80_enc(void *buffer, present80_ctx_t *ctx){
        present_generic_enc(buffer, (uint8_t*)ctx, 10, key_update);
 }
 
-void present80_dec(void* buffer, present80_ctx_t* ctx){
+void present80_dec(void *buffer, present80_ctx_t *ctx){
        present_generic_dec(buffer, (uint8_t*)ctx, 10, key_update_inv);
 }
 
 /*
-void present80_enc(void* buffer, present80_ctx_t* ctx){
+void present80_enc(void *buffer, present80_ctx_t *ctx){
        uint8_t i,j,tmp[8], k[10];
        memcpy(k, ctx->fwd_key, 10);
        memxor(buffer, k, 8);
@@ -125,7 +125,7 @@ void present80_enc(void* buffer, present80_ctx_t* ctx){
        }
 }
 
-void present80_dec(void* buffer, present80_ctx_t* ctx){
+void present80_dec(void *buffer, present80_ctx_t *ctx){
        uint8_t j,tmp[8], k[10];
        uint8_t i;
        memcpy(k, ctx->rev_key, 10);
index 9fb73e47f93cc7cce190a9fdf1b7911f697e4210..29f07b93ff32be7851dbf9365754f1b07d512b67 100644 (file)
@@ -27,8 +27,8 @@ typedef struct __attribute__((packed)) present80_ctx_st {
 } present80_ctx_t;
 
 
-void present80_init(const uint8_t* key, uint8_t keysize_b, present80_ctx_t* ctx);
-void present80_enc(void* buffer, present80_ctx_t* ctx);
-void present80_dec(void* buffer, present80_ctx_t* ctx);
+void present80_init(const uint8_t *key, uint8_t keysize_b, present80_ctx_t *ctx);
+void present80_enc(void *buffer, present80_ctx_t *ctx);
+void present80_dec(void *buffer, present80_ctx_t *ctx);
 
 #endif /*PRESENT80_H_*/
index 198c67b3d25cb38239d7be1cbed592309714cb2e..c1c000c562838fdfda51bac34372f3c71de5b9a9 100644 (file)
@@ -50,7 +50,7 @@ uint8_t present_sbox_inv(uint8_t b){
        return (pgm_read_byte(&sb[b >> 4]) << 4) | pgm_read_byte(&sb[b & 0xf]);
 }
 
-void present_p(uint8_t* o, uint8_t* i){
+void present_p(uint8_t *o, uint8_t *i){
        uint8_t m,n=0,idx=0;
        for(m=0; m<64; ++m){
                o[idx] <<= 1;
@@ -67,7 +67,7 @@ void present_p(uint8_t* o, uint8_t* i){
 }
 
 
-void present_generic_enc(void* buffer, uint8_t* ctx, uint8_t ksize_B,
+void present_generic_enc(void *buffer, uint8_t *ctx, uint8_t ksize_B,
        void(*update)(uint8_t*, uint8_t)){
        uint8_t i,j,tmp[8], k[ksize_B];
        memcpy(k, ctx, ksize_B);
@@ -83,7 +83,7 @@ void present_generic_enc(void* buffer, uint8_t* ctx, uint8_t ksize_B,
        }
 }
 
-void present_generic_dec(void* buffer, uint8_t* ctx, uint8_t ksize_B,
+void present_generic_dec(void *buffer, uint8_t *ctx, uint8_t ksize_B,
        void(*update)(uint8_t*, uint8_t)){
        uint8_t j,tmp[8], k[ksize_B];
        uint8_t i;
index f1d7ea4a9481c1238a0a7f2244b82efb8fdb548f..db856dd21689ec9f49cc35d6e2627b5e243dcfff 100644 (file)
 
 uint8_t present_sbox(uint8_t b);
 uint8_t present_sbox_inv(uint8_t b);
-void present_p(uint8_t* o, uint8_t* i);
+void present_p(uint8_t *o, uint8_t *i);
 
-void present_generic_enc(void* buffer, uint8_t* ctx, uint8_t ksize_B,
+void present_generic_enc(void *buffer, uint8_t *ctx, uint8_t ksize_B,
        void(*update)(uint8_t*, uint8_t));
-void present_generic_dec(void* buffer, uint8_t* ctx, uint8_t ksize_B,
+void present_generic_dec(void *buffer, uint8_t *ctx, uint8_t ksize_B,
        void(*update)(uint8_t*, uint8_t));
 
 #endif /*PRESENT_H_*/
index 00924e3c60548592ca7a00456095e20c1ed0cf6f..b2e21e35dbc505999a618ffda50b39b0e77741d8 100644 (file)
@@ -31,7 +31,7 @@
 #include "present_speed.h"
 
 static
-void key_update(uint8_tbuffer, uint8_t round){
+void key_update(uint8_t *buffer, uint8_t round){
        uint8_t j;
        union __attribute__((packed)){
                uint8_t   v8[2];
@@ -60,7 +60,7 @@ void key_update(uint8_t* buffer, uint8_t round){
        buffer[7] ^= round >> 1;
 }
 
-void present_init(const uint8_t* key, uint8_t keysize_b, present_ctx_t* ctx){
+void present_init(const uint8_t *key, uint8_t keysize_b, present_ctx_t *ctx){
        uint8_t i,key_buffer[10];
        memcpy(key_buffer, key, 10);
        memcpy(&(ctx->k[0]), key_buffer, 8);
@@ -71,7 +71,7 @@ void present_init(const uint8_t* key, uint8_t keysize_b, present_ctx_t* ctx){
 }
 
 
-void present_enc(void* buffer, present_ctx_t* ctx){
+void present_enc(void *buffer, present_ctx_t *ctx){
        uint8_t i,j,tmp[8];
        for(i=0; i<31; ++i){
                *((uint64_t*)buffer) ^= ctx->k[i];
@@ -86,7 +86,7 @@ void present_enc(void* buffer, present_ctx_t* ctx){
 }
 
 
-void present_dec(void* buffer, present_ctx_t* ctx){
+void present_dec(void *buffer, present_ctx_t *ctx){
        uint8_t j,tmp[8];
        uint8_t i;
        memxor(buffer, &ctx->k[31], 8);
index 320a1d859563a29f6249b359c8974a13693f3f3d..8fc6f832c04f90d820db3b8addd31ae92739544a 100644 (file)
@@ -26,9 +26,9 @@ typedef struct present_ctx_st{
 } present_ctx_t;
 
 
-void present_init(const uint8_t* key, uint8_t keysize_b, present_ctx_t* ctx);
-void present_enc(void* buffer, present_ctx_t* ctx);
-void present_dec(void* buffer, present_ctx_t* ctx);
+void present_init(const uint8_t *key, uint8_t keysize_b, present_ctx_t *ctx);
+void present_enc(void *buffer, present_ctx_t *ctx);
+void present_dec(void *buffer, present_ctx_t *ctx);
 
 
 #endif /*PRESENT_H_*/
index b49b55a5b809c5df253d46b26bcd2bffb9de34c8..75f393183e81429098ce7f4abf8c90113acf80ea 100644 (file)
@@ -30,12 +30,12 @@ typedef struct {
        uint8_t  buffer_idx;
 } rabbit_ctx_t;
 
-void dump_ctx(rabbit_ctx_tctx);
+void dump_ctx(rabbit_ctx_t *ctx);
 
-uint8_t rabbit_gen(rabbit_ctx_tctx);
-void rabbit_init(const voidkey, uint16_t keysize_b,
-                  const voidiv,
-                  rabbit_ctx_tctx);
+uint8_t rabbit_gen(rabbit_ctx_t *ctx);
+void rabbit_init(const void *key, uint16_t keysize_b,
+                  const void *iv,
+                  rabbit_ctx_t *ctx);
 
 
 #endif /* RABBIT_H_ */
index 9b234d45c71ab479100b4b7fc33256f48aa5b95e..ae4c8d547a9b576a4eddca5c59dca799f5f7f62c 100644 (file)
@@ -27,7 +27,7 @@
 #endif
 
 /*
-void dump_ctx(rabbit_ctx_tctx){
+void dump_ctx(rabbit_ctx_t *ctx){
        uint8_t i=0;
        cli_putstr_P(PSTR("\r\n --- ctx dump ---\r\n  b = "));
        cli_hexdump_byte(ctx->carry);
@@ -62,7 +62,7 @@ const uint32_t c_const[8] PROGMEM = {
 };
 
 static
-void gen_g(uint32_t* dest, rabbit_ctx_t* ctx){
+void gen_g(uint32_t *dest, rabbit_ctx_t *ctx){
        uint8_t i=0;
        uint64_t a;
        uint32_t t, *x, *c;
@@ -76,7 +76,7 @@ void gen_g(uint32_t* dest, rabbit_ctx_t* ctx){
 }
 
 static
-void update_c(rabbit_ctx_tctx){
+void update_c(rabbit_ctx_t *ctx){
        uint8_t i=0;
        uint64_t a;
        uint32_t *c;
@@ -97,7 +97,7 @@ void update_c(rabbit_ctx_t* ctx){
 #define ROT8(a)  (((a)<< 8) | ((a)>>24))
 
 static
-void step(rabbit_ctx_tctx){
+void step(rabbit_ctx_t *ctx){
        uint32_t g[8];
        uint8_t i=0;
        update_c(ctx);
@@ -111,7 +111,7 @@ void step(rabbit_ctx_t* ctx){
 }
 
 static
-void keysetup(rabbit_ctx_t* ctx, const void* key){
+void keysetup(rabbit_ctx_t *ctx, const void *key){
        uint16_t *x, *c;
        uint8_t i=0;
        x = (uint16_t*)(ctx->x);
@@ -139,7 +139,7 @@ void keysetup(rabbit_ctx_t* ctx, const void* key){
 }
 
 static
-void ivsetup(rabbit_ctx_t* ctx, const void* iv){
+void ivsetup(rabbit_ctx_t *ctx, const void *iv){
        uint8_t i;
        uint32_t t;
        union __attribute__((packed)){
@@ -173,7 +173,7 @@ void ivsetup(rabbit_ctx_t* ctx, const void* iv){
 }
 
 static
-void extract(rabbit_ctx_tctx){
+void extract(rabbit_ctx_t *ctx){
        int8_t i=0;
        uint8_t *t;
        uint16_t v;
@@ -204,9 +204,9 @@ void extract(rabbit_ctx_t* ctx){
 
 static const uint8_t key80_pad[] PROGMEM = { 0xDE, 0x05, 0x6E, 0xAC, 0x8A, 0x11 };
 
-void rabbit_init(const voidkey, uint16_t keysize_b,
-                  const voidiv,
-                  rabbit_ctx_tctx){
+void rabbit_init(const void *key, uint16_t keysize_b,
+                  const void *iv,
+                  rabbit_ctx_t *ctx){
        uint8_t t_key[16];
        if(keysize_b==80){
                memcpy(t_key, key, 10);
@@ -232,7 +232,7 @@ void rabbit_init(const void* key, uint16_t keysize_b,
        ctx->buffer_idx = 16;
 }
 
-uint8_t rabbit_gen(rabbit_ctx_tctx){
+uint8_t rabbit_gen(rabbit_ctx_t *ctx){
        if(ctx->buffer_idx==16){
                step(ctx);
                extract(ctx);
index 441f61d21ef95ea009ce29aebb4e6f689cd7dbe8..7ad15a84c37b12e02dd3842b6fa8a89d13ba53b0 100644 (file)
--- a/rc5/rc5.c
+++ b/rc5/rc5.c
@@ -37,7 +37,7 @@
 #define ROTL32(v,n) (((v)<<(n))|((v)>>(32-(n))))
 #define ROTR32(v,n) (((v)>>(n))|((v)<<(32-(n))))
 
-void rc5_enc(void* buffer, const rc5_ctx_t* ctx){
+void rc5_enc(void *buffer, const rc5_ctx_t *ctx){
        uint8_t i;
        A += ctx->s[0];
        B += ctx->s[1];
@@ -47,7 +47,7 @@ void rc5_enc(void* buffer, const rc5_ctx_t* ctx){
        } 
 }
 
-void rc5_dec(void* buffer, const rc5_ctx_t* ctx){
+void rc5_dec(void *buffer, const rc5_ctx_t *ctx){
        uint8_t i;
        for(i=ctx->rounds; i>0; --i){
                B = ROTR32(B - ctx->s[i*2+1], A&31) ^ A;
@@ -64,7 +64,7 @@ Q32 = 10011110001101110111100110111001 = 9e3779b9
 #define Q32 0x9e3779b9
 
 
-void rc5_init(void* key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t* ctx){
+void rc5_init(void *key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t *ctx){
        uint16_t c,n,m,j,i,t;
        uint32_t a,b,l[(keysize_b+31)/32];
        ctx->rounds = rounds;
@@ -91,7 +91,7 @@ void rc5_init(void* key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t* ctx){
        }
 }
 
-void rc5_free(rc5_ctx_tctx){
+void rc5_free(rc5_ctx_t *ctx){
        if(ctx->s)
                free(ctx->s);
 }
index 2a0182c51216428ed79fcf3c934350504773f07c..959fa8e68c1b8ee623878b0a517e0f17f1befe12 100644 (file)
--- a/rc5/rc5.h
+++ b/rc5/rc5.h
@@ -38,9 +38,9 @@ typedef struct rc5_ctx_st {
        uint32_t *s;
 }rc5_ctx_t; 
 
-void rc5_enc(void* buffer, const rc5_ctx_t* ctx);
-void rc5_dec(void* buffer, const rc5_ctx_t* ctx);
-void rc5_init(void* key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t* ctx);
-void rc5_free(rc5_ctx_tctx);
+void rc5_enc(void *buffer, const rc5_ctx_t *ctx);
+void rc5_dec(void *buffer, const rc5_ctx_t *ctx);
+void rc5_init(void *key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t *ctx);
+void rc5_free(rc5_ctx_t *ctx);
 
 #endif /*RC5_H_*/
index ea4d7bb15628e4fb62ff9d0acf054f9edf37cef5..fdf866cc9bbc003402c4c87774ac97829ad4eb21 100644 (file)
--- a/rc6/rc6.c
+++ b/rc6/rc6.c
@@ -46,12 +46,12 @@ uint32_t rotr32(uint32_t a, uint8_t n){
        return ( (a>>n)| (a<<(32-n)) );
 }
  
-uint8_t rc6_init(voidkey, uint16_t keylength_b, rc6_ctx_t *s){
+uint8_t rc6_init(void *key, uint16_t keylength_b, rc6_ctx_t *s){
        return rc6_initl(key, keylength_b, 20, s);
 }
  
  
-uint8_t rc6_initl(voidkey, uint16_t keylength_b, uint8_t rounds, rc6_ctx_t *s){
+uint8_t rc6_initl(void *key, uint16_t keylength_b, uint8_t rounds, rc6_ctx_t *s){
        uint8_t i,j;
        uint16_t v,p,c;
        uint32_t a,b, l=0;
@@ -104,7 +104,7 @@ void rc6_free(rc6_ctx_t *s){
 #define C (((uint32_t*)block)[2])
 #define D (((uint32_t*)block)[3])
  
-void rc6_enc(voidblock, rc6_ctx_t *s){
+void rc6_enc(void *block, rc6_ctx_t *s){
        uint8_t i;
        uint32_t t,u,x; /* greetings to Linux? */
        B += s->S[0];
@@ -124,7 +124,7 @@ void rc6_enc(void* block, rc6_ctx_t *s){
        C += s->S[2*s->rounds+3];
 }
  
-void rc6_dec(voidblock, rc6_ctx_t *s){
+void rc6_dec(void *block, rc6_ctx_t *s){
        uint8_t i;
        uint32_t t,u,x; /* greetings to Linux? */
  
index 429a1d39bd8942e2ca252393b5e1223bd8f3c7a0..3d9ccce7eac2b01766fa2f00171494ea84b0569b 100644 (file)
--- a/rc6/rc6.h
+++ b/rc6/rc6.h
@@ -38,13 +38,13 @@ typedef struct rc6_ctx_st{
 } rc6_ctx_t;
  
  
-uint8_t rc6_init(voidkey, uint16_t keylength_b, rc6_ctx_t *s);
+uint8_t rc6_init(void *key, uint16_t keylength_b, rc6_ctx_t *s);
  
-uint8_t rc6_initl(voidkey, uint16_t keylength_b, uint8_t rounds, rc6_ctx_t *s);
+uint8_t rc6_initl(void *key, uint16_t keylength_b, uint8_t rounds, rc6_ctx_t *s);
  
-void rc6_enc(voidblock, rc6_ctx_t *s);
+void rc6_enc(void *block, rc6_ctx_t *s);
 
-void rc6_dec(voidblock, rc6_ctx_t *s);
+void rc6_dec(void *block, rc6_ctx_t *s);
  
 void rc6_free(rc6_ctx_t *s); 
 
index fbdc80ba457ada443b03d8b84552c0ad8e9d9950..3d6581fe5fcf13ea1fd0f56f492239bfa9849758 100644 (file)
@@ -30,7 +30,7 @@
 #include "cli.h"
 #endif
 
-void rsa_enc(bigint_t* data, const rsa_publickey_t* key){
+void rsa_enc(bigint_t *data, const rsa_publickey_t *key){
 /*
        cli_putstr_P(PSTR("\r\n -->rsa_enc()\r\n m = "));
        bigint_print_hex(data);
@@ -50,7 +50,7 @@ h = (m1 - m2) * qinv % p
 m = m2 + q * h
 */
 
-uint8_t rsa_dec_crt_mono(bigint_t* data, const rsa_privatekey_t* key){
+uint8_t rsa_dec_crt_mono(bigint_t *data, const rsa_privatekey_t *key){
        bigint_t m1, m2;
        m1.wordv = malloc((key->components[0].length_W /* + 1 */) * sizeof(bigint_word_t));
        m2.wordv = malloc((key->components[1].length_W /* + 1 */) * sizeof(bigint_word_t));
@@ -160,7 +160,7 @@ uint8_t rsa_dec_crt_mono(bigint_t* data, const rsa_privatekey_t* key){
        return 0;
 }
 
-uint8_t rsa_dec(bigint_t* data, const rsa_privatekey_t* key){
+uint8_t rsa_dec(bigint_t *data, const rsa_privatekey_t *key){
        if(key->n == 1){
                bigint_expmod_u(data, data, &(key->components[0]), &key->modulus);
                return 0;
@@ -178,7 +178,7 @@ uint8_t rsa_dec(bigint_t* data, const rsa_privatekey_t* key){
        return 2;
 }
 
-void rsa_os2ip(bigint_t* dest, const void* data, uint32_t length_B){
+void rsa_os2ip(bigint_t *dest, const void *data, uint32_t length_B){
 #if BIGINT_WORD_SIZE == 8
        if(data){
                memcpy(dest->wordv, data, length_B);
@@ -214,7 +214,7 @@ void rsa_os2ip(bigint_t* dest, const void* data, uint32_t length_B){
        bigint_adjust(dest);
 }
 
-void rsa_i2osp(void* dest, bigint_t* src, uint16_t* out_length_B){
+void rsa_i2osp(void *dest, bigint_t *src, uint16_t *out_length_B){
 #if BIGINT_WORD_SIZE == 8
        if(dest){
                uint8_t *e = src->wordv + src->length_W;
index 3146540235ce6c3c23ef7142776084571eaaa150..200c0fb4362e8a8383314b9ccf642a88e49f127c 100644 (file)
@@ -30,7 +30,7 @@ typedef struct {
 typedef struct {
        uint8_t n;
        bigint_t modulus;
-       bigint_tcomponents;
+       bigint_t *components;
 } rsa_privatekey_t;
 
 
@@ -40,9 +40,9 @@ typedef struct {
 } rsa_fullkey_t;
 
 
-void    rsa_enc(bigint_t* data, const rsa_publickey_t* key);
-uint8_t rsa_dec(bigint_t* data, const rsa_privatekey_t* key);
-void rsa_os2ip(bigint_t* dest, const void* data, uint32_t length_B);
-void rsa_i2osp(void* dest, bigint_t* src, uint16_t* out_length_B);
+void    rsa_enc(bigint_t *data, const rsa_publickey_t *key);
+uint8_t rsa_dec(bigint_t *data, const rsa_privatekey_t *key);
+void rsa_os2ip(bigint_t *dest, const void *data, uint32_t length_B);
+void rsa_i2osp(void *dest, bigint_t *src, uint16_t *out_length_B);
 
 #endif /* RSA_BASIC_H_ */
index c1c70e7f18cd30076478b464ccfc76b5d125315a..042f536d4fb3472095c986b60154719334ead351 100644 (file)
@@ -51,10 +51,10 @@ rsa_label_t rsa_oaep_default_label = {
                0, NULL
 };
 
-uint8_t rsa_encrypt_oaep(void* dest, uint16_t* out_length,
-                             const voidsrc, uint16_t length_B,
-                             rsa_publickey_tkey, const rsa_oaep_parameter_t *p,
-                             const rsa_label_t* label, const void* seed){
+uint8_t rsa_encrypt_oaep(void *dest, uint16_t *out_length,
+                             const void *src, uint16_t length_B,
+                             rsa_publickey_t *key, const rsa_oaep_parameter_t *p,
+                             const rsa_label_t *label, const void *seed){
 
        if(!p){
                p = &rsa_oaep_default_parameter;
@@ -74,7 +74,7 @@ uint8_t rsa_encrypt_oaep(void* dest, uint16_t* out_length,
        cli_putstr("\r\n modulus_len = ");
        cli_hexdump_rev(&key->modulus.length_W, 2);
 #endif
-       uint8_tbuffer = (uint8_t*)dest;
+       uint8_t *buffer = (uint8_t*)dest;
        uint8_t off;
        /* the following needs some explanation:
         * off is the offset which is used for compensating the effect of
@@ -84,9 +84,9 @@ uint8_t rsa_encrypt_oaep(void* dest, uint16_t* out_length,
                        % (sizeof(bigint_word_t));
        buffer += off;
     buffer_len -= off;
-       uint8_tseed_buffer = buffer + 1;
+       uint8_t *seed_buffer = buffer + 1;
        uint16_t db_len = buffer_len - hv_len - 1;
-       uint8_tdb = seed_buffer + hv_len;
+       uint8_t *db = seed_buffer + hv_len;
        uint16_t maskbuffer_len = db_len>hv_len?db_len:hv_len;
        uint8_t maskbuffer[maskbuffer_len];
        bigint_t x;
@@ -140,10 +140,10 @@ uint8_t rsa_encrypt_oaep(void* dest, uint16_t* out_length,
        return 0;
 }
 
-uint8_t rsa_decrypt_oaep(void* dest, uint16_t* out_length,
-                             const voidsrc, uint16_t length_B,
-                             rsa_privatekey_tkey, const rsa_oaep_parameter_t *p,
-                             const rsa_label_t* label, void* seed){
+uint8_t rsa_decrypt_oaep(void *dest, uint16_t *out_length,
+                             const void *src, uint16_t length_B,
+                             rsa_privatekey_t *key, const rsa_oaep_parameter_t *p,
+                             const rsa_label_t *label, void *seed){
 
 //     cli_putstr("\r\n -->rsa_decrypt_oaep()"); uart_flush(0);
        if(!label){
index 8084653afb3132462676439407e005055819bc98..9d8a529a2bbeaed7cc6cf1d8ed9c9756967ee90a 100644 (file)
 #include "mgf1.h"
 
 
-void mgf1(void* dest, const void* seed, uint16_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t* p);
+void mgf1(void *dest, const void *seed, uint16_t seed_len_B, uint16_t out_length_B, const mgf1_parameter_t *p);
 
 
 typedef struct {
-       void (*mgf)(void* dst, const void* seed, uint16_t slen_B, uint16_t dstlen_B, const mgf1_parameter_t* p);
-       const hfdesc_thf;
-       mgf1_parameter_tmgf_parameter;
+       void (*mgf)(void *dst, const void *seed, uint16_t slen_B, uint16_t dstlen_B, const mgf1_parameter_t *p);
+       const hfdesc_t *hf;
+       mgf1_parameter_t *mgf_parameter;
 } rsa_oaep_parameter_t;
 
 typedef struct {
        uint16_t length_b;
-       const voidlabel;
+       const void *label;
 } rsa_label_t;
 
 extern rsa_oaep_parameter_t rsa_oaep_default_parameter;
 extern rsa_label_t rsa_oaep_default_label;
 
-uint8_t rsa_encrypt_oaep(void* dest, uint16_t* out_length,
-                             const voidsrc, uint16_t length_B,
-                             rsa_publickey_tkey, const rsa_oaep_parameter_t *p,
-                             const rsa_label_t* label, const void* seed);
+uint8_t rsa_encrypt_oaep(void *dest, uint16_t *out_length,
+                             const void *src, uint16_t length_B,
+                             rsa_publickey_t *key, const rsa_oaep_parameter_t *p,
+                             const rsa_label_t *label, const void *seed);
 
-uint8_t rsa_decrypt_oaep(void* dest, uint16_t* out_length,
-                             const voidsrc, uint16_t length_B,
-                             rsa_privatekey_tkey, const rsa_oaep_parameter_t *p,
-                             const rsa_label_t* label, void* seed);
+uint8_t rsa_decrypt_oaep(void *dest, uint16_t *out_length,
+                             const void *src, uint16_t length_B,
+                             rsa_privatekey_t *key, const rsa_oaep_parameter_t *p,
+                             const rsa_label_t *label, void *seed);
 
 #endif /* RSA_OAEP_H_ */
index 2bc35aca9a12e3479559129ce494ea41424db723..4f41546de6dd420a4f7c369e75fc5e3ab834b18f 100644 (file)
 
 #include "random_dummy.h"
 
-uint16_t rsa_pkcs1v15_compute_padlength_B(bigint_tmodulus, uint16_t msg_length_B){
+uint16_t rsa_pkcs1v15_compute_padlength_B(bigint_t *modulus, uint16_t msg_length_B){
        return bigint_get_first_set_bit(modulus) / 8 + 1 - msg_length_B - 3;
 }
 
-uint8_t rsa_encrypt_pkcs1v15(void* dest, uint16_t* out_length, const void* src,
-       uint16_t length_B, rsa_publickey_t* key, const void* pad){
+uint8_t rsa_encrypt_pkcs1v15(void *dest, uint16_t *out_length, const void *src,
+       uint16_t length_B, rsa_publickey_t *key, const void *pad){
        int16_t pad_length;
        bigint_t x;
        pad_length = rsa_pkcs1v15_compute_padlength_B(&key->modulus, length_B);
@@ -85,8 +85,8 @@ uint8_t rsa_encrypt_pkcs1v15(void* dest, uint16_t* out_length, const void* src,
        return 0;
 }
 
-uint8_t rsa_decrypt_pkcs1v15(void* dest, uint16_t* out_length, const void* src,
-       uint16_t length_B, rsa_privatekey_t* key, void* pad){
+uint8_t rsa_decrypt_pkcs1v15(void *dest, uint16_t *out_length, const void *src,
+       uint16_t length_B, rsa_privatekey_t *key, void *pad){
        bigint_t x;
        uint16_t m_length, pad_length=0, idx=0;
        x.wordv = dest;
index cb127409b5a4d29eb2bc670e4e49774a27e091da..909b15475883cb9f887823216cc84e9192b45422 100644 (file)
 #include <stdint.h>
 #include "bigint.h"
 
-uint16_t rsa_pkcs1v15_compute_padlength_B(bigint_tmodulus, uint16_t msg_length_B);
+uint16_t rsa_pkcs1v15_compute_padlength_B(bigint_t *modulus, uint16_t msg_length_B);
 
 
-uint8_t rsa_encrypt_pkcs1v15(void* dest, uint16_t* out_length, const void* src,
-               uint16_t length_B, rsa_publickey_t* key, const void* pad);
+uint8_t rsa_encrypt_pkcs1v15(void *dest, uint16_t *out_length, const void *src,
+               uint16_t length_B, rsa_publickey_t *key, const void *pad);
 
-uint8_t rsa_decrypt_pkcs1v15(void* dest, uint16_t* out_length, const void* src,
-               uint16_t length_B, rsa_privatekey_t* key, void* pad);
+uint8_t rsa_decrypt_pkcs1v15(void *dest, uint16_t *out_length, const void *src,
+               uint16_t length_B, rsa_privatekey_t *key, void *pad);
 
 #endif /* RSA_PKCS1V15_H_ */
index 95a38d54d60a92b75e194ed55a1392c5dfd76fbe..6d9589bf6f20ef91d3cf2450fbbbd850be39ef55 100644 (file)
@@ -26,7 +26,7 @@
 #define ROTL32(a,n) (((a)<<(n))|((a)>>(32-(n))))
 
 static
-void quaterround(uint32_t* a, uint32_t* b, uint32_t* c, uint32_t* d){
+void quaterround(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d){
        *b ^= ROTL32(*a + *d,  7);
        *c ^= ROTL32(*b + *a,  9);
        *d ^= ROTL32(*c + *b, 13);
@@ -34,7 +34,7 @@ void quaterround(uint32_t* a, uint32_t* b, uint32_t* c, uint32_t* d){
 }
 
 static
-void rowround(uint32_ta){
+void rowround(uint32_t *a){
        quaterround(a+ 0, a+ 1, a+ 2, a+ 3);
        quaterround(a+ 5, a+ 6, a+ 7, a+ 4);
        quaterround(a+10, a+11, a+ 8, a+ 9);
@@ -42,7 +42,7 @@ void rowround(uint32_t* a){
 }
 
 static
-void columnround(uint32_ta){
+void columnround(uint32_t *a){
        quaterround(a+ 0, a+ 4, a+ 8, a+12);
        quaterround(a+ 5, a+ 9, a+13, a+ 1);
        quaterround(a+10, a+14, a+ 2, a+ 6);
@@ -50,14 +50,14 @@ void columnround(uint32_t* a){
 }
 
 static
-void doubleround(uint32_ta){
+void doubleround(uint32_t *a){
        columnround(a);
        rowround(a);
 
 }
 
 
-void salsa20_hash(uint32_ta){
+void salsa20_hash(uint32_t *a){
        uint8_t i;
        uint32_t b[16];
        memcpy(b, a, 64);
@@ -72,7 +72,7 @@ void salsa20_hash(uint32_t* a){
 const uint8_t sigma[] PROGMEM = {'e','x','p','a','n','d',' ','3','2','-','b','y','t','e',' ','k'};
 const uint8_t theta[] PROGMEM = {'e','x','p','a','n','d',' ','1','6','-','b','y','t','e',' ','k'};
 
-void salsa_k32(uint32_t* dest, const uint32_t* k, const uint32_t* n){
+void salsa_k32(uint32_t *dest, const uint32_t *k, const uint32_t *n){
        memcpy_P(dest+ 0, sigma+ 0, 4);
        memcpy(  dest+ 4, k+ 0, 16);
        memcpy_P(dest+20, sigma+ 4, 4);
@@ -83,7 +83,7 @@ void salsa_k32(uint32_t* dest, const uint32_t* k, const uint32_t* n){
        salsa20_hash(dest);
 }
 
-void salsa_k16(uint32_t* dest, const uint32_t* k, const uint32_t* n){
+void salsa_k16(uint32_t *dest, const uint32_t *k, const uint32_t *n){
        memcpy_P(dest+ 0, theta+ 0, 4);
        memcpy(  dest+ 4, k+ 0, 16);
        memcpy_P(dest+20, theta+ 4, 4);
@@ -94,14 +94,14 @@ void salsa_k16(uint32_t* dest, const uint32_t* k, const uint32_t* n){
        salsa20_hash(dest);
 }
 
-void salsa20_genBlock256(void* dest, const void* k, const void* iv, uint64_t i){
+void salsa20_genBlock256(void *dest, const void *k, const void *iv, uint64_t i){
        uint32_t n[4];
        memcpy(n, iv, 8);
        memcpy(n+8, &i, 8);
        salsa_k32((uint32_t*)dest, (uint32_t*)k, n);
 }
 
-void salsa20_genBlock128(void* dest, const void* k, const void* iv, uint64_t i){
+void salsa20_genBlock128(void *dest, const void *k, const void *iv, uint64_t i){
        uint32_t n[4];
        memcpy(n, iv, 8);
        memcpy(n+8, &i, 8);
@@ -109,7 +109,7 @@ void salsa20_genBlock128(void* dest, const void* k, const void* iv, uint64_t i){
 }
 
 
-void salsa20_init(void* key, uint16_t keylength_b, void* iv, salsa20_ctx_t* ctx){
+void salsa20_init(void *key, uint16_t keylength_b, void *iv, salsa20_ctx_t *ctx){
        if(keylength_b==256){
                memcpy_P((ctx->a.v8+ 0), sigma+ 0, 4);
                memcpy_P((ctx->a.v8+20), sigma+ 4, 4);
@@ -131,7 +131,7 @@ void salsa20_init(void* key, uint16_t keylength_b, void* iv, salsa20_ctx_t* ctx)
        ctx->buffer_idx=64;
 }
 
-uint8_t salsa20_gen(salsa20_ctx_tctx){
+uint8_t salsa20_gen(salsa20_ctx_t *ctx){
        if(ctx->buffer_idx==64){
                memcpy(ctx->buffer, ctx->a.v8, 64);
                salsa20_hash((uint32_t*)(ctx->buffer));
index fe332286e9182e3fbdb9c0d475495afdbdb5e37e..7cdbc7b7b24d5450b455e482a2f6559e317ad183 100644 (file)
@@ -31,13 +31,13 @@ typedef struct{
        uint8_t buffer_idx;
 } salsa20_ctx_t;
 
-void salsa20_hash(uint32_ta);
-void salsa_k32(uint32_t* dest, const uint32_t* k, const uint32_t* n);
-void salsa_k16(uint32_t* dest, const uint32_t* k, const uint32_t* n);
-void salsa20_genBlock256(void* dest, const void* k, const void* iv, uint64_t i);
-void salsa20_genBlock128(void* dest, const void* k, const void* iv, uint64_t i);
-
-void salsa20_init(void* key, uint16_t keylength_b, void* iv, salsa20_ctx_t* ctx);
-uint8_t salsa20_gen(salsa20_ctx_tctx);
+void salsa20_hash(uint32_t *a);
+void salsa_k32(uint32_t *dest, const uint32_t *k, const uint32_t *n);
+void salsa_k16(uint32_t *dest, const uint32_t *k, const uint32_t *n);
+void salsa20_genBlock256(void *dest, const void *k, const void *iv, uint64_t i);
+void salsa20_genBlock128(void *dest, const void *k, const void *iv, uint64_t i);
+
+void salsa20_init(void *key, uint16_t keylength_b, void *iv, salsa20_ctx_t *ctx);
+uint8_t salsa20_gen(salsa20_ctx_t *ctx);
 
 #endif /* SALSA20_H_ */
index 4e750d3cc57d22bb6cb62a07fcb98884db9ef8a1..125efcf89ddf5a570ebf9d632535422feb40dc37 100644 (file)
@@ -24,9 +24,9 @@
 #include "streamcipher_descriptor.h"
 #include "keysize_descriptor.h"
 
-uint8_t scal_cipher_init(const scdesc_tcipher_descriptor,
-                         const voidkey, uint16_t keysize_b,
-                         const void* iv,  uint16_t ivsize_b, scgen_ctx_t* ctx){
+uint8_t scal_cipher_init(const scdesc_t *cipher_descriptor,
+                         const void *key, uint16_t keysize_b,
+                         const void *iv,  uint16_t ivsize_b, scgen_ctx_t *ctx){
        ctx->buffer = NULL;
        ctx->ctx = NULL;
 
@@ -79,7 +79,7 @@ uint8_t scal_cipher_init(const scdesc_t* cipher_descriptor,
 }
 
 
-void scal_cipher_free(scgen_ctx_tctx){
+void scal_cipher_free(scgen_ctx_t *ctx){
        if(ctx->buffer){
                free(ctx->buffer);
        }
@@ -88,7 +88,7 @@ void scal_cipher_free(scgen_ctx_t* ctx){
        }
 }
 
-uint8_t scal_cipher_gen_byte(scgen_ctx_tctx){
+uint8_t scal_cipher_gen_byte(scgen_ctx_t *ctx){
        uint8_t flags;
        uint16_t blocksize_b;
        void_fpt gen_fpt;
@@ -125,7 +125,7 @@ uint8_t scal_cipher_gen_byte(scgen_ctx_t* ctx){
        }
 }
 
-void scal_cipher_gen_block(void* block, scgen_ctx_t* ctx){
+void scal_cipher_gen_block(void *block, scgen_ctx_t *ctx){
        uint8_t flags;
        void_fpt gen_fpt;
        flags = pgm_read_byte(&(ctx->desc_ptr->flags));
@@ -137,7 +137,7 @@ void scal_cipher_gen_block(void* block, scgen_ctx_t* ctx){
        }
 }
 
-void scal_cipher_gen_fillblock(void* block, uint16_t blocksize_B, scgen_ctx_t* ctx){
+void scal_cipher_gen_fillblock(void *block, uint16_t blocksize_B, scgen_ctx_t *ctx){
        while(blocksize_B){
                *((uint8_t*)block) = scal_cipher_gen_byte(ctx);
                block = (uint8_t*)block + 1;
@@ -145,17 +145,17 @@ void scal_cipher_gen_fillblock(void* block, uint16_t blocksize_B, scgen_ctx_t* c
        }
 }
 
-uint16_t scal_cipher_getBlocksize_b(const scdesc_tdesc){
+uint16_t scal_cipher_getBlocksize_b(const scdesc_t *desc){
        uint16_t blocksize_b;
        blocksize_b = pgm_read_word(&(desc->gensize_b));
        return blocksize_b;
 }
 
-PGM_VOID_P scal_cipher_getKeysizeDesc(const scdesc_tdesc){
+PGM_VOID_P scal_cipher_getKeysizeDesc(const scdesc_t *desc){
        return (PGM_VOID_P)pgm_read_word(&(desc->valid_keysize_desc));
 }
 
-PGM_VOID_P scal_cipher_getIVsizeDesc(const scdesc_tdesc){
+PGM_VOID_P scal_cipher_getIVsizeDesc(const scdesc_t *desc){
        return (PGM_VOID_P)pgm_read_word(&(desc->valid_ivsize_desc));
 }
 
index 890a73de1636c3376e11fc6c312acd29007d28a1..0aa4148ec92ad0de329999041e7d2dac6f778122 100644 (file)
 #include "keysize_descriptor.h"
 #include <avr/pgmspace.h>
 
-uint8_t scal_cipher_init(const scdesc_tcipher_descriptor,
-                         const voidkey, uint16_t keysize_b,
-                         const void* iv,  uint16_t ivsize_b, scgen_ctx_t* ctx);
-void scal_cipher_free(scgen_ctx_tctx);
-uint8_t scal_cipher_gen_byte(scgen_ctx_tctx);
-void scal_cipher_gen_block(void* block, scgen_ctx_t* ctx);
-void scal_cipher_gen_fillblock(void* block, uint16_t blocksize_B, scgen_ctx_t* ctx);
-uint16_t scal_cipher_getBlocksize_b(const scdesc_tdesc);
-PGM_VOID_P scal_cipher_getKeysizeDesc(const scdesc_tdesc);
-PGM_VOID_P scal_cipher_getIVsizeDesc(const scdesc_tdesc);
+uint8_t scal_cipher_init(const scdesc_t *cipher_descriptor,
+                         const void *key, uint16_t keysize_b,
+                         const void *iv,  uint16_t ivsize_b, scgen_ctx_t *ctx);
+void scal_cipher_free(scgen_ctx_t *ctx);
+uint8_t scal_cipher_gen_byte(scgen_ctx_t *ctx);
+void scal_cipher_gen_block(void *block, scgen_ctx_t *ctx);
+void scal_cipher_gen_fillblock(void *block, uint16_t blocksize_B, scgen_ctx_t *ctx);
+uint16_t scal_cipher_getBlocksize_b(const scdesc_t *desc);
+PGM_VOID_P scal_cipher_getKeysizeDesc(const scdesc_t *desc);
+PGM_VOID_P scal_cipher_getIVsizeDesc(const scdesc_t *desc);
 
 
 #endif /* SCAL_BASIC_H_ */
index 8e4f30ccc4eb4c97dfc1a14e766fa54705f5169b..e4d7b19b14fc565f311e1548a9a86d997ded1ebe 100644 (file)
@@ -54,7 +54,7 @@ static const char stream3_n[] PROGMEM = "stream[448..511]";
 static const char streamX_n_estream[] PROGMEM = "xor-digest";
 static const char streamX_n_nessie[] PROGMEM = "stream[0..511]xored";
 
-static const charstream_n_str[] = {
+static const char *stream_n_str[] = {
                stream0_n,
                stream1_n,
                stream2_n,
@@ -68,7 +68,7 @@ static const char stream3_l[] PROGMEM = "stream[131008..131071]";
 static const char streamX_l_estream[] PROGMEM = "xor-digest";
 static const char streamX_l_nessie[] PROGMEM = "stream[0..131071]xored";
 
-static const charstream_l_str[] = {
+static const char *stream_l_str[] = {
                stream0_n,
                stream1_l,
                stream2_l,
@@ -279,7 +279,7 @@ void scal_nessie_stream_run(const scdesc_t *desc, uint16_t keysize_b, uint16_t i
        nessie_print_footer();
 }
 
-void scal_nessie_run(const scdesc_tdesc){
+void scal_nessie_run(const scdesc_t *desc){
        uint16_t keysizes_count, ivsizes_count,i,j;
        uint16_t *keysizes=NULL, *ivsizes=NULL;
        keysizes_count = get_keysizes((PGM_VOID_P)pgm_read_word(&(desc->valid_keysize_desc)), &keysizes);
index 3d785dd84d5123f3eb7bc1915904b11352499030..ac1d7183359b2b18605f714e9044e021c9fad287 100644 (file)
@@ -27,6 +27,6 @@ void scal_nessie_set_estream(uint8_t v);
 uint8_t scal_nessie_get_estream(void);
 
 void scal_nessie_stream_run(const scdesc_t *desc, uint16_t keysize_b, uint16_t ivsize_b);
-void scal_nessie_run(const scdesc_tdesc);
+void scal_nessie_run(const scdesc_t *desc);
 
 #endif /* SCALNESSIE_H_ */
index 84866c382098f266ed06bbb318bec5b2035d123e..afdaf3c7db1add12e4b7d0493af218d8d4961e71 100644 (file)
@@ -222,7 +222,7 @@ seed_sbox2:
 
 /*
 static
-uint64_t f_function(const uint64_ta, uint32_t k0, uint32_t k1){
+uint64_t f_function(const uint64_t *a, uint32_t k0, uint32_t k1){
        uint32_t c,d;
 
        c = *a & 0x00000000FFFFFFFFLL;
index 7a9afc03bc18860c093543c485fa6db79c1180f3..38aeec992f7f2b1968dd756f068f2f9b095c79bc 100644 (file)
@@ -91,7 +91,7 @@ uint64_t bigendian_rotr8_64(uint64_t a){
 
 /******************************************************************************/
 static
-uint64_t f_function(const uint64_ta, uint32_t k0, uint32_t k1){
+uint64_t f_function(const uint64_t *a, uint32_t k0, uint32_t k1){
        uint32_t c,d;
 
        c = *a & 0x00000000FFFFFFFFLL;
index f5f7cc5acf414c55b32980850e0a4d442efbfc78..5a371b953058d844c213f49b8febe0e23a1812af 100644 (file)
@@ -532,7 +532,7 @@ serpent_gen_w:
        ret
 
 /*
- * void serpent_init(const void* key, uint16_t keysize_b, serpent_ctx_t* ctx)
+ * void serpent_init(const void *key, uint16_t keysize_b, serpent_ctx_t *ctx)
  */
 /*
  * param key     is passed in r24:r25
@@ -634,7 +634,7 @@ serpent_init:
        ret
 
 /*
- * void serpent_enc(void* buffer, const serpent_ctx_t* ctx){
+ * void serpent_enc(void *buffer, const serpent_ctx_t *ctx){
  */
 /*
  * param buffer is passed in r24:r25
@@ -685,7 +685,7 @@ serpent_enc:
        rjmp memxor
 
 /*
- * void serpent_dec(void* buffer, const serpent_ctx_t* ctx){
+ * void serpent_dec(void *buffer, const serpent_ctx_t *ctx){
  */
 /*
  * param buffer is passed in r24:r25
index 96f9c682ee2825c7dfb822f35a483d208556c42e..40bf2a6b02479ebda5605fa12aebd7f42ee953b1 100644 (file)
@@ -35,7 +35,7 @@
 
 /* depth = 5,7,4,2, Total gates=18 */
 static
-void sb0(uint8_t* out, const uint8_t* in){
+void sb0(uint8_t *out, const uint8_t *in){
 // (a,b,c,d,w,x,y,z) 
        uint8_t t01, t02, t03, t05, t06, t07, t08, t09, t11, t12, t13, t14, t15, t17;
        t01          = in[4*1]  ^ in[4*2]; 
@@ -62,7 +62,7 @@ void sb0(uint8_t* out, const uint8_t* in){
 
 /* depth = 8,4,3,6, Total gates=19 */
 static
-void sb0_inv(uint8_t* out, const uint8_t* in){
+void sb0_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t08, t09, t10, t12, t13, t14, t15, t17, t18, t01;
        t01          = in[4*2] ^ in[4*3];
        t02          = in[4*0] | in[4*1];
@@ -89,7 +89,7 @@ void sb0_inv(uint8_t* out, const uint8_t* in){
 
 /* depth = 10,7,3,5, Total gates=18 */
 static 
-void sb1(uint8_t* out, const uint8_t* in){
+void sb1(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t07, t08, t10, t11, t12, t13, t16, t17, t01;
        t01          = in[4*0]   | in[4*3];
        t02          = in[4*2]   ^ in[4*3];
@@ -114,7 +114,7 @@ void sb1(uint8_t* out, const uint8_t* in){
 /* InvS1:   5  8  2 14 15  6 12  3 11  4  7  9  1 13 10  0 */
 
 /* depth = 7,4,5,3, Total gates=18 */
-static void sb1_inv(uint8_t* out, const uint8_t* in){
+static void sb1_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t07, t08, t09, t10, t11, t14, t15, t17, t01;
        t01          = in[4*0]   ^ in[4*1];
        t02          = in[4*1]   | in[4*3];
@@ -139,7 +139,7 @@ static void sb1_inv(uint8_t* out, const uint8_t* in){
 /* S2:   8  6  7  9  3 12 10 15 13  1 14  4  0 11  5  2 */
 
 /* depth = 3,8,11,7, Total gates=16 */
-static void sb2(uint8_t* out, const uint8_t* in){
+static void sb2(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t05, t06, t07, t08, t09, t10, t12, t13, t14, t01;
        t01          = in[4*0]   | in[4*2];
        t02          = in[4*0]   ^ in[4*1];
@@ -162,7 +162,7 @@ static void sb2(uint8_t* out, const uint8_t* in){
 /* InvS2:  12  9 15  4 11 14  1  2  0  3  6 13  5  8 10  7 */
 
 /* depth = 3,6,8,3, Total gates=18 */
-static void sb2_inv(uint8_t* out, const uint8_t* in){
+static void sb2_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t06, t07, t08, t09, t10, t11, t12, t15, t16, t17, t01;
        t01          = in[4*0]   ^ in[4*3];
        t02          = in[4*2]   ^ in[4*3];
@@ -187,7 +187,7 @@ static void sb2_inv(uint8_t* out, const uint8_t* in){
 /* S3:   0 15 11  8 12  9  6  3 13  1  2  4 10  7  5 14 */
 
 /* depth = 8,3,5,5, Total gates=18 */
-static void sb3(uint8_t* out, const uint8_t* in){
+static void sb3(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t07, t08, t09, t10, t11, t13, t14, t15, t01;
        t01          = in[4*0]   ^ in[4*2];
        t02          = in[4*0]   | in[4*3];
@@ -212,7 +212,7 @@ static void sb3(uint8_t* out, const uint8_t* in){
 /* InvS3:   0  9 10  7 11 14  6 13  3  5 12  2  4  8 15  1 */
 
 /* depth = 3,6,4,4, Total gates=17 */
-static void sb3_inv(uint8_t* out, const uint8_t* in){
+static void sb3_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t07, t09, t11, t12, t13, t14, t16, t01;
        t01          = in[4*2]   | in[4*3];
        t02          = in[4*0]   | in[4*3];
@@ -236,7 +236,7 @@ static void sb3_inv(uint8_t* out, const uint8_t* in){
 /* S4:   1 15  8  3 12  0 11  6  2  5  4 10  9 14  7 13 */
 
 /* depth = 6,7,5,3, Total gates=19 */
-static void sb4(uint8_t* out, const uint8_t* in){
+static void sb4(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t08, t09, t10, t11, t12, t13, t14, t15, t16, t01;
        t01          = in[4*0]   | in[4*1];
        t02          = in[4*1]   | in[4*2];
@@ -262,7 +262,7 @@ static void sb4(uint8_t* out, const uint8_t* in){
 /* InvS4:   5  0  8  3 10  9  7 14  2 12 11  6  4 15 13  1 */
 
 /* depth = 6,4,7,3, Total gates=17 */
-static void sb4_inv(uint8_t* out, const uint8_t* in){
+static void sb4_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t07, t09, t10, t11, t12, t13, t15, t01;
        t01          = in[4*1]   | in[4*3];
        t02          = in[4*2]   | in[4*3];
@@ -286,7 +286,7 @@ static void sb4_inv(uint8_t* out, const uint8_t* in){
 /* S5:  15  5  2 11  4 10  9 12  0  3 14  8 13  6  7  1 */
 
 /* depth = 4,6,8,6, Total gates=17 */
-static void sb5(uint8_t* out, const uint8_t* in){
+static void sb5(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t07, t08, t09, t10, t11, t12, t13, t14, t01;
        t01          = in[4*1]   ^ in[4*3];
        t02          = in[4*1]   | in[4*3];
@@ -310,7 +310,7 @@ static void sb5(uint8_t* out, const uint8_t* in){
 /* InvS5:   8 15  2  9  4  1 13 14 11  6  5  3  7 12 10  0 */
 
 /* depth = 4,6,9,7, Total gates=17 */
-static void sb5_inv(uint8_t* out, const uint8_t* in){
+static void sb5_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t07, t08, t09, t10, t12, t13, t15, t16, t01;
        t01          = in[4*0]   & in[4*3];
        t02          = in[4*2]   ^ t01;
@@ -334,7 +334,7 @@ static void sb5_inv(uint8_t* out, const uint8_t* in){
 /* S6:   7  2 12  5  8  4  6 11 14  9  1 15 13  3 10  0 */
 
 /* depth = 8,3,6,3, Total gates=19 */
-static void sb6(uint8_t* out, const uint8_t* in){
+static void sb6(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t07, t08, t09, t10, t11, t12, t13, t15, t17, t18, t01;
        t01          = in[4*0]   & in[4*3];
        t02          = in[4*1]   ^ in[4*2];
@@ -360,7 +360,7 @@ static void sb6(uint8_t* out, const uint8_t* in){
 /* InvS6:  15 10  1 13  5  3  6  0  4  9 14  7  2 12  8 11 */
 
 /* depth = 5,3,8,6, Total gates=19 */
-static void sb6_inv(uint8_t* out, const uint8_t* in){
+static void sb6_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t07, t08, t09, t12, t13, t14, t15, t16, t17, t01;
        t01          = in[4*0]   ^ in[4*2];
        t02          =     ~ in[4*2];
@@ -386,7 +386,7 @@ static void sb6_inv(uint8_t* out, const uint8_t* in){
 /* S7:   1 13 15  0 14  8  2 11  7  4 12 10  9  3  5  6 */
 
 /* depth = 10,7,10,4, Total gates=19 */
-static void sb7(uint8_t* out, const uint8_t* in){
+static void sb7(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t05, t06, t08, t09, t10, t11, t13, t14, t15, t16, t17, t01;
        t01          = in[4*0]   & in[4*2];
        t02          =     ~ in[4*3];
@@ -412,7 +412,7 @@ static void sb7(uint8_t* out, const uint8_t* in){
 /* InvS7:   3  0  6 13  9 14 15  8  5 12 11  7 10  1  4  2 */
 
 /* depth = 9,7,3,3, Total gates=18 */
-static void sb7_inv(uint8_t* out, const uint8_t* in){
+static void sb7_inv(uint8_t *out, const uint8_t *in){
        uint8_t t02, t03, t04, t06, t07, t08, t09, t10, t11, t13, t14, t15, t16, t01;
        t01          = in[4*0]   & in[4*1];
        t02          = in[4*0]   | in[4*1];
index bdbe175319cd49d53bc1a543eb251597bbdb72ce..c4ec83b66c9e85bd16c32eca6b87abfbe63ad5d3 100644 (file)
@@ -92,7 +92,7 @@ static void serpent_fp(uint32_t *i, uint32_t *o){
 }
 
 /******************************************************************************/
-static void sbox128x(uint8_t box, voidw){
+static void sbox128x(uint8_t box, void *w){
        uint8_t sb[16];
        uint8_t i,t,x;
        box &= 0x0f;
index 40ccecd4ac58f726cea41b8bc90d8b35a2b70ac1..8f2428bfef66a9d5ced950102a2b90f7d6752595 100644 (file)
@@ -82,7 +82,7 @@ static uint32_t serpent_gen_w(uint32_t * b, uint8_t i){
        return ret;
 } 
 
-void serpent_init(const void* key, uint16_t keysize_b, serpent_ctx_t* ctx){
+void serpent_init(const void *key, uint16_t keysize_b, serpent_ctx_t *ctx){
        uint32_t buffer[8];
        uint8_t i,j;
        if(keysize_b<256){
@@ -106,7 +106,7 @@ void serpent_init(const void* key, uint16_t keysize_b, serpent_ctx_t* ctx){
        }
 }
 
-void serpent_enc(void* buffer, const serpent_ctx_t* ctx){
+void serpent_enc(void *buffer, const serpent_ctx_t *ctx){
        uint8_t i;
        for(i=0; i<31; ++i){
                memxor(buffer, ctx->k[i], 16);
@@ -119,7 +119,7 @@ void serpent_enc(void* buffer, const serpent_ctx_t* ctx){
        memxor(buffer, ctx->k[i], 16);
 }
 
-void serpent_dec(void* buffer, const serpent_ctx_t* ctx){
+void serpent_dec(void *buffer, const serpent_ctx_t *ctx){
        int8_t i=32;
        
        memxor(buffer, ctx->k[i], 16);
index 84e4a87c265714a2be10509879712076093350a3..dbf019281d2bd2f933bdf35136b9f9f4ca709b86 100644 (file)
@@ -39,9 +39,9 @@ typedef struct serpent_ctx_st {
 
 
 /* key must be 256bit (32 byte) large! */
-void serpent_init(const void* key, uint16_t keysize_b, serpent_ctx_t* ctx);
-void serpent_enc(void* buffer, const serpent_ctx_t* ctx);
-void serpent_dec(void* buffer, const serpent_ctx_t* ctx);
+void serpent_init(const void *key, uint16_t keysize_b, serpent_ctx_t *ctx);
+void serpent_enc(void *buffer, const serpent_ctx_t *ctx);
+void serpent_dec(void *buffer, const serpent_ctx_t *ctx);
 
 
 #endif /*SERPENT_H_*/
index 2e22b8e5e45c04c73ea895ca1df53caa0440c33b..7b5d40b1cf215a5259eb588f974f986af4f2464e 100644 (file)
@@ -93,7 +93,7 @@ uint32_t parity(uint32_t x, uint32_t y, uint32_t z){
 
 typedef uint32_t (*pf_t)(uint32_t x, uint32_t y, uint32_t z);
 
-void sha1_nextBlock (sha1_ctx_t *state, const voidblock){
+void sha1_nextBlock (sha1_ctx_t *state, const void *block){
        uint32_t a[5];
        uint32_t w[16];
        uint32_t temp;
@@ -173,7 +173,7 @@ void sha1_nextBlock (sha1_ctx_t *state, const void* block){
 
 /********************************************************************************************************/
 
-void sha1_lastBlock(sha1_ctx_t *state, const voidblock, uint16_t length){
+void sha1_lastBlock(sha1_ctx_t *state, const void *block, uint16_t length){
        uint8_t lb[SHA1_BLOCK_BYTES]; /* local block */
        while(length>=SHA1_BLOCK_BITS){
                sha1_nextBlock(state, block);
@@ -226,7 +226,7 @@ void sha1_ctx2hash (void *dest, sha1_ctx_t *state){
  *
  *
  */
-void sha1 (void *dest, const voidmsg, uint32_t length){
+void sha1 (void *dest, const void *msg, uint32_t length){
        sha1_ctx_t s;
        DEBUG_S("\r\nBLA BLUB");
        sha1_init(&s);
index 19667866563b8444b2cc6c9695333dbcdddcbb08..0da9ee75852c75d2fec5179c87ebccbef2f02b36 100644 (file)
@@ -77,16 +77,16 @@ typedef uint8_t sha1_hash_t[SHA1_HASH_BITS/8];
  */
 void sha1_init(sha1_ctx_t *state);
 
-/** \fn sha1_nextBlock(sha1_ctx_t *state, const voidblock)
+/** \fn sha1_nextBlock(sha1_ctx_t *state, const void *block)
  *  \brief process one input block
  * This function processes one input block and updates the hash context 
  * accordingly
  * \param state pointer to the state variable to update
  * \param block pointer to the message block to process
  */
-void sha1_nextBlock (sha1_ctx_t *state, const voidblock);
+void sha1_nextBlock (sha1_ctx_t *state, const void *block);
 
-/** \fn sha1_lastBlock(sha1_ctx_t *state, const voidblock, uint16_t length_b)
+/** \fn sha1_lastBlock(sha1_ctx_t *state, const void *block, uint16_t length_b)
  * \brief processes the given block and finalizes the context
  * This function processes the last block in a SHA-1 hashing process.
  * The block should have a maximum length of a single input block.
@@ -94,7 +94,7 @@ void sha1_nextBlock (sha1_ctx_t *state, const void* block);
  * \param block pointer to themessage block to process
  * \param length_b length of the message block in bits  
  */
-void sha1_lastBlock (sha1_ctx_t *state, const voidblock, uint16_t length_b);
+void sha1_lastBlock (sha1_ctx_t *state, const void *block, uint16_t length_b);
 
 /** \fn sha1_ctx2hash(sha1_hash_t *dest, sha1_ctx_t *state)
  * \brief convert a state variable into an actual hash value
@@ -104,7 +104,7 @@ void sha1_lastBlock (sha1_ctx_t *state, const void* block, uint16_t length_b);
  */ 
 void sha1_ctx2hash (void *dest, sha1_ctx_t *state);
 
-/** \fn sha1(sha1_hash_t *dest, const voidmsg, uint32_t length_b)
+/** \fn sha1(sha1_hash_t *dest, const void *msg, uint32_t length_b)
  * \brief hashing a message which in located entirely in RAM
  * This function automatically hashes a message which is entirely in RAM with
  * the SHA-1 hashing algorithm.
@@ -112,7 +112,7 @@ void sha1_ctx2hash (void *dest, sha1_ctx_t *state);
  * \param msg  pointer to the message which should be hashed
  * \param length_b length of the message in bits
  */ 
-void sha1(void *dest, const voidmsg, uint32_t length_b);
+void sha1(void *dest, const void *msg, uint32_t length_b);
 
 
 
index 732cd5b8ce1d43f90daa66fcd4060a5d5d95919b..81a5cfd3f4614157e476a926afcddc0240e25c2d 100644 (file)
@@ -67,12 +67,12 @@ void sha224_init(sha224_ctx_t *state){
 }
 
 /*************************************************************************/
-void sha224_nextBlock (sha224_ctx_t *state, const voidblock){
+void sha224_nextBlock (sha224_ctx_t *state, const void *block){
        sha2_small_common_nextBlock(state, block);
 }
 
 /*************************************************************************/
-void sha224_lastBlock (sha224_ctx_t *state, const voidblock, uint16_t length_b){
+void sha224_lastBlock (sha224_ctx_t *state, const void *block, uint16_t length_b){
        sha2_small_common_lastBlock(state, block, length_b);
 }
 /*************************************************************************/
@@ -91,7 +91,7 @@ void sha224_lastBlock (sha224_ctx_t *state, const void* block, uint16_t length_b
 /*
  * length in bits!
  */
-void sha224(void* dest, const void* msg, uint32_t length_b){ /* length could be choosen longer but this is for ÂµC */
+void sha224(void *dest, const void *msg, uint32_t length_b){ /* length could be choosen longer but this is for ÂµC */
        sha224_ctx_t s;
        sha224_init(&s);
        while(length_b >= SHA224_BLOCK_BITS){
@@ -107,7 +107,7 @@ void sha224(void* dest, const void* msg, uint32_t length_b){ /* length could be
 
 /*************************************************************************/
 
-void sha224_ctx2hash(voiddest, const sha224_ctx_t *state){
+void sha224_ctx2hash(void *dest, const sha224_ctx_t *state){
 #if defined LITTLE_ENDIAN
        uint8_t i, j, *s=(uint8_t*)(state->h);
        i=7;
index 2261ee58851fe94af193294a8cafb90c324968c1..dd31dfda01781c3eded17c46bbc01b4bf04840cf 100644 (file)
@@ -65,7 +65,7 @@ typedef sha2_small_common_ctx_t sha224_ctx_t;
  */
 void sha224_init(sha224_ctx_t *state);
 
-/** \fn void sha224_nextBlock (sha224_ctx_t* state, const void* block)
+/** \fn void sha224_nextBlock (sha224_ctx_t *state, const void *block)
  * \brief update the context with a given block
  * 
  * This function updates the SHA-224 hash context by processing the given block
@@ -73,9 +73,9 @@ void sha224_init(sha224_ctx_t *state);
  * \param state pointer to the SHA-224 hash context
  * \param block pointer to the block of fixed length (512 bit = 64 byte)
  */
-void sha224_nextBlock (sha224_ctx_t* state, const void* block);
+void sha224_nextBlock (sha224_ctx_t *state, const void *block);
 
-/** \fn void sha224_lastBlock(sha224_ctx_t* state, const void* block, uint16_t length_b)
+/** \fn void sha224_lastBlock(sha224_ctx_t *state, const void *block, uint16_t length_b)
  * \brief finalize the context with the given block 
  * 
  * This function finalizes the SHA-224 hash context by processing the given block
@@ -84,17 +84,17 @@ void sha224_nextBlock (sha224_ctx_t* state, const void* block);
  * \param block pointer to the block of fixed length (512 bit = 64 byte)
  * \param length_b the length of the block in bits
  */
-void sha224_lastBlock(sha224_ctx_t* state, const void* block, uint16_t length_b);
+void sha224_lastBlock(sha224_ctx_t *state, const void *block, uint16_t length_b);
 
-/** \fn void sha224_ctx2hash(sha224_hash_t* dest, const sha224_ctx_t* state)
+/** \fn void sha224_ctx2hash(sha224_hash_t *dest, const sha224_ctx_t *state)
  * \brief convert the hash state into the hash value
  * This function reads the context and writes the hash value to the destination
  * \param dest pointer to the location where the hash value should be written
  * \param state pointer to the SHA-224 hash context
  */
-void sha224_ctx2hash(void* dest, const sha224_ctx_t* state);
+void sha224_ctx2hash(void *dest, const sha224_ctx_t *state);
 
-/** \fn void sha224(sha224_hash_t* dest, const void* msg, uint32_t length_b)
+/** \fn void sha224(sha224_hash_t *dest, const void *msg, uint32_t length_b)
  * \brief simple SHA-224 hashing function for direct hashing
  * 
  * This function automatically hashes a given message of arbitary length with
@@ -103,6 +103,6 @@ void sha224_ctx2hash(void* dest, const sha224_ctx_t* state);
  * \param msg pointer to the message thats going to be hashed
  * \param length_b length of the message in bits
  */
-void sha224(void* dest, const void* msg, uint32_t length_b);
+void sha224(void *dest, const void *msg, uint32_t length_b);
 
 #endif /*SHA224_H_*/
index 61a9f8e817a436df11e75b0586364ec97c5dabb9..75a4ce64bd943a0034eb3b5257cc89a2169a50ad 100644 (file)
@@ -66,12 +66,12 @@ void sha256_init(sha256_ctx_t *state){
 }
 
 /*************************************************************************/
-void sha256_nextBlock (sha256_ctx_t *state, const voidblock){
+void sha256_nextBlock (sha256_ctx_t *state, const void *block){
        sha2_small_common_nextBlock(state, block);
 }
 
 /*************************************************************************/
-void sha256_lastBlock (sha256_ctx_t *state, const voidblock, uint16_t length_b){
+void sha256_lastBlock (sha256_ctx_t *state, const void *block, uint16_t length_b){
        sha2_small_common_lastBlock(state, block, length_b);
 }
 /*************************************************************************/
@@ -90,7 +90,7 @@ void sha256_lastBlock (sha256_ctx_t *state, const void* block, uint16_t length_b
 /*
  * length in bits!
  */
-void sha256(void* dest, const void* msg, uint32_t length_b){ /* length could be choosen longer but this is for ÂµC */
+void sha256(void *dest, const void *msg, uint32_t length_b){ /* length could be choosen longer but this is for ÂµC */
        sha256_ctx_t s;
        sha256_init(&s);
        while(length_b >= SHA256_BLOCK_BITS){
@@ -106,7 +106,7 @@ void sha256(void* dest, const void* msg, uint32_t length_b){ /* length could be
 
 /*************************************************************************/
 
-void sha256_ctx2hash(voiddest, const sha256_ctx_t *state){
+void sha256_ctx2hash(void *dest, const sha256_ctx_t *state){
 #if defined LITTLE_ENDIAN
        uint8_t i, j, *s=(uint8_t*)(state->h);
        i=8;
index 2adf9295b4f18b2cf7290f9bec9b85531af895b2..d6e74e4453ccd89ddc5d526d86c8f9780d1019d4 100644 (file)
@@ -65,7 +65,7 @@ typedef sha2_small_common_ctx_t sha256_ctx_t;
  */
 void sha256_init(sha256_ctx_t *state);
 
-/** \fn void sha256_nextBlock (sha256_ctx_t* state, const void* block)
+/** \fn void sha256_nextBlock (sha256_ctx_t *state, const void *block)
  * \brief update the context with a given block
  * 
  * This function updates the SHA-256 hash context by processing the given block
@@ -73,9 +73,9 @@ void sha256_init(sha256_ctx_t *state);
  * \param state pointer to the SHA-256 hash context
  * \param block pointer to the block of fixed length (512 bit = 64 byte)
  */
-void sha256_nextBlock (sha256_ctx_t* state, const void* block);
+void sha256_nextBlock (sha256_ctx_t *state, const void *block);
 
-/** \fn void sha256_lastBlock(sha256_ctx_t* state, const void* block, uint16_t length_b)
+/** \fn void sha256_lastBlock(sha256_ctx_t *state, const void *block, uint16_t length_b)
  * \brief finalize the context with the given block 
  * 
  * This function finalizes the SHA-256 hash context by processing the given block
@@ -84,17 +84,17 @@ void sha256_nextBlock (sha256_ctx_t* state, const void* block);
  * \param block pointer to the block of fixed length (512 bit = 64 byte)
  * \param length_b the length of the block in bits
  */
-void sha256_lastBlock(sha256_ctx_t* state, const void* block, uint16_t length_b);
+void sha256_lastBlock(sha256_ctx_t *state, const void *block, uint16_t length_b);
 
-/** \fn void sha256_ctx2hash(sha256_hash_t* dest, const sha256_ctx_t* state)
+/** \fn void sha256_ctx2hash(sha256_hash_t *dest, const sha256_ctx_t *state)
  * \brief convert the hash state into the hash value
  * This function reads the context and writes the hash value to the destination
  * \param dest pointer to the location where the hash value should be written
  * \param state pointer to the SHA-256 hash context
  */
-void sha256_ctx2hash(void* dest, const sha256_ctx_t* state);
+void sha256_ctx2hash(void *dest, const sha256_ctx_t *state);
 
-/** \fn void sha256(sha256_hash_t* dest, const void* msg, uint32_t length_b)
+/** \fn void sha256(sha256_hash_t *dest, const void *msg, uint32_t length_b)
  * \brief simple SHA-256 hashing function for direct hashing
  * 
  * This function automatically hashes a given message of arbitary length with
@@ -103,6 +103,6 @@ void sha256_ctx2hash(void* dest, const sha256_ctx_t* state);
  * \param msg pointer to the message thats going to be hashed
  * \param length_b length of the message in bits
  */
-void sha256(void* dest, const void* msg, uint32_t length_b);
+void sha256(void *dest, const void *msg, uint32_t length_b);
 
 #endif /*SHA256_H_*/
index fe23075bf99354436d2e70e2962ed692bad45a3c..9225440a2c6609f9fca97fb122ca45f6bdfcb85e 100644 (file)
@@ -89,7 +89,7 @@ uint64_t pgm_read_uint64_t_P(const uint64_t * p){
 #define SIGMA_a(x) (rotr64((x),  1) ^ rotr64((x),  8) ^ ((x)>>7))
 #define SIGMA_b(x) (rotr64((x), 19) ^ rotl64((x),  3) ^ ((x)>>6))
 
-void sha2_large_common_nextBlock(sha2_large_common_ctx_t* ctx, const void* block){
+void sha2_large_common_nextBlock(sha2_large_common_ctx_t *ctx, const void *block){
        uint64_t w[16], wx;
        uint64_t a[8];
        uint64_t t1, t2;
@@ -122,7 +122,7 @@ void sha2_large_common_nextBlock(sha2_large_common_ctx_t* ctx, const void* block
        ctx->length += 1;
 }
 
-void sha2_large_common_lastBlock(sha2_large_common_ctx_t* ctx, const void* block, uint16_t length_b){
+void sha2_large_common_lastBlock(sha2_large_common_ctx_t *ctx, const void *block, uint16_t length_b){
        while(length_b >= 1024){
                sha2_large_common_nextBlock(ctx, block);
                block = (uint8_t*)block + 1024/8;
index 8352546732912bc2ea0cf3b02413677e8f982d0d..c141e2a4a21acd8245cbcff5864efe91a08e48c9 100644 (file)
@@ -26,8 +26,8 @@ typedef struct {
 } sha2_large_common_ctx_t;
 
 
-void sha2_large_common_nextBlock(sha2_large_common_ctx_t* ctx, const void* block);
-void sha2_large_common_lastBlock(sha2_large_common_ctx_t* ctx, const void* block, uint16_t length_b);
+void sha2_large_common_nextBlock(sha2_large_common_ctx_t *ctx, const void *block);
+void sha2_large_common_lastBlock(sha2_large_common_ctx_t *ctx, const void *block, uint16_t length_b);
 
 
 #endif /* SHA2_LARGE_COMMON_H_ */
index 1edd8f214791a0443f349f5d8865de6431d2ff18..4072c6b7ac9ed35b1fba78fb1dae27c2bdee9d6b 100644 (file)
@@ -75,7 +75,7 @@ uint32_t k[] PROGMEM = {
 /**
  * block must be, 512, Bit = 64, Byte, long !!!
  */
-void sha2_small_common_nextBlock (sha2_small_common_ctx_t *state, const voidblock){
+void sha2_small_common_nextBlock (sha2_small_common_ctx_t *state, const void *block){
        uint32_t w[16], wx;
        uint8_t  i;
        uint32_t a[8],t1,t2;
@@ -120,7 +120,7 @@ void sha2_small_common_nextBlock (sha2_small_common_ctx_t *state, const void* bl
 }
 
 
-void sha2_small_common_lastBlock(sha2_small_common_ctx_t *state, const voidblock, uint16_t length_b){
+void sha2_small_common_lastBlock(sha2_small_common_ctx_t *state, const void *block, uint16_t length_b){
        uint8_t lb[512/8]; /* local block */
        uint64_t len;
        while(length_b>=512){
index a771d5dffdc3f9e07e8a2eda329d02d4b8e224fd..9a28a9daf7266376a2d3c4c7a09f107a754e811c 100644 (file)
@@ -25,7 +25,7 @@ typedef struct {
        uint32_t length;
 } sha2_small_common_ctx_t;
 
-void sha2_small_common_nextBlock(sha2_small_common_ctx_t* state, const void* block);
-void sha2_small_common_lastBlock(sha2_small_common_ctx_t* state, const void* block, uint16_t length_b);
+void sha2_small_common_nextBlock(sha2_small_common_ctx_t *state, const void *block);
+void sha2_small_common_lastBlock(sha2_small_common_ctx_t *state, const void *block, uint16_t length_b);
 
 #endif /* SHA2_SMALL_COMMON_H_ */
index 5781dc3c32a53c72247e28f319b790205d0458d8..6a3e9a0235d478caf1523472ca30ad540c98eff5 100644 (file)
 #include "sha384.h"
 
 
-void sha384_nextBlock (sha384_ctx_t* ctx, const void* block){
+void sha384_nextBlock (sha384_ctx_t *ctx, const void *block){
        sha2_large_common_nextBlock(ctx, block);
 }
 
-void sha384_lastBlock(sha384_ctx_t* ctx, const void* block, uint16_t length_b){
+void sha384_lastBlock(sha384_ctx_t *ctx, const void *block, uint16_t length_b){
        sha2_large_common_lastBlock(ctx, block, length_b);
 }
 
@@ -40,12 +40,12 @@ uint64_t sha384_init_values[8] PROGMEM = {
 };
 
 
-void sha384_init(sha384_ctx_tctx){
+void sha384_init(sha384_ctx_t *ctx){
        ctx->length = 0;
        memcpy_P(ctx->h, sha384_init_values, 8*8);
 }
 
-void sha384_ctx2hash(void* dest, const sha384_ctx_t* ctx){
+void sha384_ctx2hash(void *dest, const sha384_ctx_t *ctx){
        uint8_t i=6, j, *s = (uint8_t*)(ctx->h);
        do{
                j=7;
@@ -58,7 +58,7 @@ void sha384_ctx2hash(void* dest, const sha384_ctx_t* ctx){
 }
 
 
-void sha384(void* dest, const void* msg, uint32_t length_b){
+void sha384(void *dest, const void *msg, uint32_t length_b){
        sha384_ctx_t ctx;
        sha384_init(&ctx);
        while(length_b >= 1024){
index 59829b4ba5b2530f891233fc747abfb8017e0d82..5ec39cc9616bedd33dd5d2753464f8ca379e38f0 100644 (file)
@@ -33,10 +33,10 @@ typedef sha2_large_common_ctx_t sha384_ctx_t;
 
 
 void sha384_init(sha384_ctx_t *ctx);
-void sha384_nextBlock (sha384_ctx_t* ctx, const void* block);
-void sha384_lastBlock(sha384_ctx_t* ctx, const void* block, uint16_t length_b);
-void sha384_ctx2hash(void* dest, const sha384_ctx_t* ctx);
-void sha384(void* dest, const void* msg, uint32_t length_b);
+void sha384_nextBlock (sha384_ctx_t *ctx, const void *block);
+void sha384_lastBlock(sha384_ctx_t *ctx, const void *block, uint16_t length_b);
+void sha384_ctx2hash(void *dest, const sha384_ctx_t *ctx);
+void sha384(void *dest, const void *msg, uint32_t length_b);
 
 
 #endif /* SHA384_H_ */
index c09f109a236a057cc1a26019e20096ac4dbf7d9e..bc6edf4e23973e4fa75067a7e69a5581cbaf78bf 100644 (file)
 #include "sha512.h"
 
 
-void sha512_nextBlock (sha512_ctx_t* ctx, const void* block){
+void sha512_nextBlock (sha512_ctx_t *ctx, const void *block){
        sha2_large_common_nextBlock(ctx, block);
 }
 
-void sha512_lastBlock(sha512_ctx_t* ctx, const void* block, uint16_t length_b){
+void sha512_lastBlock(sha512_ctx_t *ctx, const void *block, uint16_t length_b){
        sha2_large_common_lastBlock(ctx, block, length_b);
 }
 
@@ -39,12 +39,12 @@ uint64_t sha512_init_values[8] PROGMEM = {
 };
 
 
-void sha512_init(sha512_ctx_tctx){
+void sha512_init(sha512_ctx_t *ctx){
        ctx->length = 0;
        memcpy_P(ctx->h, sha512_init_values, 8*8);
 }
 
-void sha512_ctx2hash(void* dest, const sha512_ctx_t* ctx){
+void sha512_ctx2hash(void *dest, const sha512_ctx_t *ctx){
        uint8_t i=8, j, *s = (uint8_t*)(ctx->h);
        do{
                j=7;
@@ -57,7 +57,7 @@ void sha512_ctx2hash(void* dest, const sha512_ctx_t* ctx){
 }
 
 
-void sha512(void* dest, const void* msg, uint32_t length_b){
+void sha512(void *dest, const void *msg, uint32_t length_b){
        sha512_ctx_t ctx;
        sha512_init(&ctx);
        while(length_b >= 1024){
index 7484dad98a54398cd88578f5e4101b94705b47fd..15a0ae340c2ae556813fe2b54cb7b58dd94fdfe7 100644 (file)
@@ -32,10 +32,10 @@ typedef sha2_large_common_ctx_t sha512_ctx_t;
 
 
 void sha512_init(sha512_ctx_t *ctx);
-void sha512_nextBlock (sha512_ctx_t* ctx, const void* block);
-void sha512_lastBlock(sha512_ctx_t* ctx, const void* block, uint16_t length_b);
-void sha512_ctx2hash(void* dest, const sha512_ctx_t* ctx);
-void sha512(void* dest, const void* msg, uint32_t length_b);
+void sha512_nextBlock (sha512_ctx_t *ctx, const void *block);
+void sha512_lastBlock(sha512_ctx_t *ctx, const void *block, uint16_t length_b);
+void sha512_ctx2hash(void *dest, const sha512_ctx_t *ctx);
+void sha512(void *dest, const void *msg, uint32_t length_b);
 
 
 #endif /* SHA512_H_ */
index 757ff7736ffb78b1b3ee28dec29e72e21e904255..3ee4b93da440a9a751f3b5e545ab2ed3f728ba35 100644 (file)
@@ -111,7 +111,7 @@ uint32_t k[]={
 /**
  * block must be, 512, Bit = 64, Byte, long !!!
  */
-void sha256_nextBlock (sha256_ctx_t *state, const voidblock){
+void sha256_nextBlock (sha256_ctx_t *state, const void *block){
        uint32_t w[64]; /* this is 256, byte, large, */
        uint8_t  i;
        uint32_t a[8],t1,t2;
@@ -158,7 +158,7 @@ void sha256_nextBlock (sha256_ctx_t *state, const void* block){
  *  bits are big endian, meaning high bits come first.
  *     if you have a message with bits at the end, the byte must be padded with zeros
  */
-void sha256_lastBlock(sha256_ctx_t *state, const voidblock, uint16_t length){
+void sha256_lastBlock(sha256_ctx_t *state, const void *block, uint16_t length){
        uint8_t lb[SHA256_BLOCK_BITS/8]; /* local block */
        while(length>=SHA256_BLOCK_BITS){
                sha256_nextBlock(state, block);
@@ -204,7 +204,7 @@ void sha256_lastBlock(sha256_ctx_t *state, const void* block, uint16_t length){
 /*
  * length in bits!
  */
-void sha256(sha256_hash_t *dest, const voidmsg, uint32_t length){ /* length could be choosen longer but this is for ÂµC */
+void sha256(sha256_hash_t *dest, const void *msg, uint32_t length){ /* length could be choosen longer but this is for ÂµC */
        sha256_ctx_t s;
        sha256_init(&s);
        while(length >= SHA256_BLOCK_BITS){
index 24960a3a43d9325d3cbb01ea15c4f2a7e6b31684..78704f57590f441851001e05756ec8c102a8dd3c 100644 (file)
@@ -67,7 +67,7 @@ typedef struct {
  * \brief SHA-256 hash value type
  * 
  * A variable of this type may hold the hash value produced by the
- * sha256_ctx2hash(sha256_hash_t* dest, const sha256_ctx_t* state) function.
+ * sha256_ctx2hash(sha256_hash_t *dest, const sha256_ctx_t *state) function.
  */
 typedef uint8_t sha256_hash_t[SHA256_HASH_BYTES];
 
@@ -79,7 +79,7 @@ typedef uint8_t sha256_hash_t[SHA256_HASH_BYTES];
  */
 void sha256_init(sha256_ctx_t *state);
 
-/** \fn void sha256_nextBlock (sha256_ctx_t* state, const void* block)
+/** \fn void sha256_nextBlock (sha256_ctx_t *state, const void *block)
  * \brief update the context with a given block
  * 
  * This function updates the SHA-256 hash context by processing the given block
@@ -87,9 +87,9 @@ void sha256_init(sha256_ctx_t *state);
  * \param state pointer to the SHA-256 hash context
  * \param block pointer to the block of fixed length (512 bit = 64 byte)
  */
-void sha256_nextBlock (sha256_ctx_t* state, const void* block);
+void sha256_nextBlock (sha256_ctx_t *state, const void *block);
 
-/** \fn void sha256_lastBlock(sha256_ctx_t* state, const void* block, uint16_t length_b)
+/** \fn void sha256_lastBlock(sha256_ctx_t *state, const void *block, uint16_t length_b)
  * \brief finalize the context with the given block 
  * 
  * This function finalizes the SHA-256 hash context by processing the given block
@@ -98,17 +98,17 @@ void sha256_nextBlock (sha256_ctx_t* state, const void* block);
  * \param block pointer to the block of fixed length (512 bit = 64 byte)
  * \param length_b the length of the block in bits
  */
-void sha256_lastBlock(sha256_ctx_t* state, const void* block, uint16_t length_b);
+void sha256_lastBlock(sha256_ctx_t *state, const void *block, uint16_t length_b);
 
-/** \fn void sha256_ctx2hash(sha256_hash_t* dest, const sha256_ctx_t* state)
+/** \fn void sha256_ctx2hash(sha256_hash_t *dest, const sha256_ctx_t *state)
  * \brief convert the hash state into the hash value
  * This function reads the context and writes the hash value to the destination
  * \param dest pointer to the location where the hash value should be written
  * \param state pointer to the SHA-256 hash context
  */
-void sha256_ctx2hash(sha256_hash_t* dest, const sha256_ctx_t* state);
+void sha256_ctx2hash(sha256_hash_t *dest, const sha256_ctx_t *state);
 
-/** \fn void sha256(sha256_hash_t* dest, const void* msg, uint32_t length_b)
+/** \fn void sha256(sha256_hash_t *dest, const void *msg, uint32_t length_b)
  * \brief simple SHA-256 hashing function for direct hashing
  * 
  * This function automaticaly hashes a given message of arbitary length with
@@ -117,6 +117,6 @@ void sha256_ctx2hash(sha256_hash_t* dest, const sha256_ctx_t* state);
  * \param msg pointer to the message thats going to be hashed
  * \param length_b length of the message in bits
  */
-void sha256(sha256_hash_t* dest, const void* msg, uint32_t length_b);
+void sha256(sha256_hash_t *dest, const void *msg, uint32_t length_b);
 
 #endif /*SHA256_H_*/
index 31879b383433cdb706bedebcfeb2e34d1bb28a1b..493cdbf606020ebc2ee7f9b45759b0f4b6b3d215 100644 (file)
@@ -28,7 +28,7 @@
 
 /******************************************************************************/
 /*
-void shabal_p(shabal_ctx_t* ctx, const void* m){
+void shabal_p(shabal_ctx_t *ctx, const void *m){
        uint8_t i,j;
        for(i=0;i<16;++i){
                ctx->b[i] = ROTL32(ctx->b[i],17);
@@ -459,9 +459,9 @@ mod12table:
        
 /******************************************************************************/
 /*
-void shabal_nextBlock(shabal_ctx_t* ctx, const void* block){
+void shabal_nextBlock(shabal_ctx_t *ctx, const void *block){
        uint8_t i;
-       uint32_tt;
+       uint32_t *t;
        for(i=0;i<16;++i){
                ctx->b[i] += ((uint32_t*)block)[i];
        }
@@ -570,9 +570,9 @@ shabal_nextBlock:
 
 /******************************************************************************/
 /*
-void shabal_lastBlock(shabal_ctx_t* ctx, const void* block, uint16_t length_b){
+void shabal_lastBlock(shabal_ctx_t *ctx, const void *block, uint16_t length_b){
        uint8_t i,j;
-       uint32_tt;
+       uint32_t *t;
        uint8_t buffer[64];
        while(length_b>=SHABAL_BLOCKSIZE){
                shabal_nextBlock(ctx, block);
index f18908ae6b4f9ccde632f5bbfe574b012b1c8897..0a32041284b466a51a157e06d3e9f2f133304d8e 100644 (file)
@@ -47,7 +47,7 @@ uint32_t shabal_v(uint32_t a){
 #define ROTL32(a,n) (((a)<<(n))|((a)>>(32-(n))))
 
 static
-void shabal_p(shabal_ctx_t* ctx, const void* m){
+void shabal_p(shabal_ctx_t *ctx, const void *m){
        uint8_t i,j;
        for(i=0;i<16;++i){
                ctx->b[i] = ROTL32(ctx->b[i],17);
@@ -70,9 +70,9 @@ void shabal_p(shabal_ctx_t* ctx, const void* m){
        }
 }
 
-void shabal_nextBlock(shabal_ctx_t* ctx, const void* block){
+void shabal_nextBlock(shabal_ctx_t *ctx, const void *block){
        uint8_t i;
-       uint32_tt;
+       uint32_t *t;
        for(i=0;i<16;++i){
                ctx->b[i] += ((uint32_t*)block)[i];
        }
@@ -88,9 +88,9 @@ void shabal_nextBlock(shabal_ctx_t* ctx, const void* block){
        ctx->b = t;
 }
 
-void shabal_lastBlock(shabal_ctx_t* ctx, const void* block, uint16_t length_b){
+void shabal_lastBlock(shabal_ctx_t *ctx, const void *block, uint16_t length_b){
        uint8_t i,j;
-       uint32_tt;
+       uint32_t *t;
        uint8_t buffer[64];
        while(length_b>=SHABAL_BLOCKSIZE){
                shabal_nextBlock(ctx, block);
@@ -116,6 +116,6 @@ void shabal_lastBlock(shabal_ctx_t* ctx, const void* block, uint16_t length_b){
         
 }
 
-void shabal_ctx2hash(void* dest, const shabal_ctx_t* ctx, uint16_t outlength_b){
+void shabal_ctx2hash(void *dest, const shabal_ctx_t *ctx, uint16_t outlength_b){
        memcpy(dest, &(ctx->c[16-outlength_b/32]), outlength_b/8);
 }
index fab23a1f24f91239d98bbee1efb882247b548ef1..f7477e17973d93c81bb938ae876c78489649942d 100644 (file)
@@ -49,27 +49,27 @@ typedef struct{
 }shabal_ctx_t;
 
 
-void shabal192_init(shabal_ctx_tctx);
-void shabal224_init(shabal_ctx_tctx);
-void shabal256_init(shabal_ctx_tctx);
-void shabal384_init(shabal_ctx_tctx);
-void shabal512_init(shabal_ctx_tctx);
+void shabal192_init(shabal_ctx_t *ctx);
+void shabal224_init(shabal_ctx_t *ctx);
+void shabal256_init(shabal_ctx_t *ctx);
+void shabal384_init(shabal_ctx_t *ctx);
+void shabal512_init(shabal_ctx_t *ctx);
 
-void shabal_nextBlock(shabal_ctx_t* ctx, const void* block);
-void shabal_lastBlock(shabal_ctx_t* ctx, const void* block, uint16_t length_b);
+void shabal_nextBlock(shabal_ctx_t *ctx, const void *block);
+void shabal_lastBlock(shabal_ctx_t *ctx, const void *block, uint16_t length_b);
 
-void shabal192_ctx2hash(void* dest, const shabal_ctx_t* ctx);
-void shabal224_ctx2hash(void* dest, const shabal_ctx_t* ctx);
-void shabal256_ctx2hash(void* dest, const shabal_ctx_t* ctx);
-void shabal384_ctx2hash(void* dest, const shabal_ctx_t* ctx);
-void shabal512_ctx2hash(void* dest, const shabal_ctx_t* ctx);
+void shabal192_ctx2hash(void *dest, const shabal_ctx_t *ctx);
+void shabal224_ctx2hash(void *dest, const shabal_ctx_t *ctx);
+void shabal256_ctx2hash(void *dest, const shabal_ctx_t *ctx);
+void shabal384_ctx2hash(void *dest, const shabal_ctx_t *ctx);
+void shabal512_ctx2hash(void *dest, const shabal_ctx_t *ctx);
 
-void shabal192(void* dest, void* msg, uint32_t length_b);
-void shabal224(void* dest, void* msg, uint32_t length_b);
-void shabal256(void* dest, void* msg, uint32_t length_b);
-void shabal384(void* dest, void* msg, uint32_t length_b);
-void shabal512(void* dest, void* msg, uint32_t length_b);
+void shabal192(void *dest, void *msg, uint32_t length_b);
+void shabal224(void *dest, void *msg, uint32_t length_b);
+void shabal256(void *dest, void *msg, uint32_t length_b);
+void shabal384(void *dest, void *msg, uint32_t length_b);
+void shabal512(void *dest, void *msg, uint32_t length_b);
 
-void shabal_ctx2hash(void* dest, const shabal_ctx_t* ctx, uint16_t outlength_b);
+void shabal_ctx2hash(void *dest, const shabal_ctx_t *ctx, uint16_t outlength_b);
 
 #endif /* SHABAL_H_ */
index 09b41d5baea6a6b13e9e2b3d4245cda85329d981..ac864adaa5facb49e999200d1084c79037b55192 100644 (file)
@@ -45,7 +45,7 @@ shabal192_iv:
 
 /******************************************************************************/
 /*
-void shabal192_init(shabal_ctx_tctx){
+void shabal192_init(shabal_ctx_t *ctx){
        uint8_t i;
        ctx->b = ctx->b_buffer;
        ctx->c = ctx->c_buffer;
@@ -121,7 +121,7 @@ shabal192_ctx2hash:
        
 /******************************************************************************/
 /*
-void shabal192(void* dest, void* msg, uint32_t length_b){
+void shabal192(void *dest, void *msg, uint32_t length_b){
        shabal_ctx_t ctx;
        shabal192_init(&ctx);
        while(length_b>=SHABAL_BLOCKSIZE){
index 73a9b401e02021869b757b4daf2de8d382c7d1c5..389f4f38be6aaa4ed31596e26fd21bef2f046dd6 100644 (file)
@@ -47,7 +47,7 @@ const uint32_t shabal192_iv[] PROGMEM = {
        0x1C096BF4, 0xAC76224B, 0x5215781C, 0xCD5D2669
 };
 
-void shabal192_init(shabal_ctx_tctx){
+void shabal192_init(shabal_ctx_t *ctx){
        uint8_t i;
        ctx->b = ctx->b_buffer;
        ctx->c = ctx->c_buffer;
@@ -63,11 +63,11 @@ void shabal192_init(shabal_ctx_t* ctx){
        }
 }
 
-void shabal192_ctx2hash(void* dest, const shabal_ctx_t* ctx){
+void shabal192_ctx2hash(void *dest, const shabal_ctx_t *ctx){
        shabal_ctx2hash(dest, ctx, 192);
 }
 
-void shabal192(void* dest, void* msg, uint32_t length_b){
+void shabal192(void *dest, void *msg, uint32_t length_b){
        shabal_ctx_t ctx;
        shabal192_init(&ctx);
        while(length_b>=SHABAL_BLOCKSIZE){
index cba98407a3cd9255142052d24042a457b936a3bb..00a13d01926146205409187091dea4e1609f5903 100644 (file)
@@ -47,7 +47,7 @@ const uint32_t shabal224_iv[] PROGMEM = {
        0x16F1AC05, 0x38BBEB56, 0x9B01DC60, 0xB1096D83
 };
 
-void shabal224_init(shabal_ctx_tctx){
+void shabal224_init(shabal_ctx_t *ctx){
        uint8_t i;
        ctx->b = ctx->b_buffer;
        ctx->c = ctx->c_buffer;
@@ -63,11 +63,11 @@ void shabal224_init(shabal_ctx_t* ctx){
        }
 }
 
-void shabal224_ctx2hash(void* dest, const shabal_ctx_t* ctx){
+void shabal224_ctx2hash(void *dest, const shabal_ctx_t *ctx){
        shabal_ctx2hash(dest, ctx, 224);
 }
 
-void shabal224(void* dest, void* msg, uint32_t length_b){
+void shabal224(void *dest, void *msg, uint32_t length_b){
        shabal_ctx_t ctx;
        shabal224_init(&ctx);
        while(length_b>=SHABAL_BLOCKSIZE){
index 7d0ced67a776faf540fef6f6d8e6143cdc284dc2..0ed81def4345b5cc07ac883a4279dacedca06bc6 100644 (file)
@@ -47,7 +47,7 @@ const uint32_t shabal256_iv[] PROGMEM = {
        0xBC968828, 0xE6E00BF7, 0xBA839E55, 0x9B491C60
 };
 
-void shabal256_init(shabal_ctx_tctx){
+void shabal256_init(shabal_ctx_t *ctx){
        uint8_t i;
        ctx->b = ctx->b_buffer;
        ctx->c = ctx->c_buffer;
@@ -63,11 +63,11 @@ void shabal256_init(shabal_ctx_t* ctx){
        }
 }
 
-void shabal256_ctx2hash(void* dest, const shabal_ctx_t* ctx){
+void shabal256_ctx2hash(void *dest, const shabal_ctx_t *ctx){
        shabal_ctx2hash(dest, ctx, 256);
 }
 
-void shabal256(void* dest, void* msg, uint32_t length_b){
+void shabal256(void *dest, void *msg, uint32_t length_b){
        shabal_ctx_t ctx;
        shabal256_init(&ctx);
        while(length_b>=SHABAL_BLOCKSIZE){
index 464ab97e3361a1abea2cd188c194e0503150c1b2..e11ead68cc53bb5501fed9377352d6a54a912170 100644 (file)
@@ -47,7 +47,7 @@ const uint32_t shabal384_iv[] PROGMEM = {
        0x7C35073B, 0x28D95E6D, 0xAA340E0D, 0xCB3DEE70
 };
 
-void shabal384_init(shabal_ctx_tctx){
+void shabal384_init(shabal_ctx_t *ctx){
        uint8_t i;
        ctx->b = ctx->b_buffer;
        ctx->c = ctx->c_buffer;
@@ -63,11 +63,11 @@ void shabal384_init(shabal_ctx_t* ctx){
        }
 }
 
-void shabal384_ctx2hash(void* dest, const shabal_ctx_t* ctx){
+void shabal384_ctx2hash(void *dest, const shabal_ctx_t *ctx){
        shabal_ctx2hash(dest, ctx, 384);
 }
 
-void shabal384(void* dest, void* msg, uint32_t length_b){
+void shabal384(void *dest, void *msg, uint32_t length_b){
        shabal_ctx_t ctx;
        shabal384_init(&ctx);
        while(length_b>=SHABAL_BLOCKSIZE){
index 2b94b4ec186f8bfe9a3a32291cfdada7c7f34293..23a7bfa1abccb768cc29f58ee735d97eb448f542 100644 (file)
@@ -47,7 +47,7 @@ const uint32_t shabal512_iv[] PROGMEM = {
        0x950C3434, 0xAED9A06D, 0x2537DC8D, 0x7CDB5969,
 };
 
-void shabal512_init(shabal_ctx_tctx){
+void shabal512_init(shabal_ctx_t *ctx){
        uint8_t i;
        ctx->b = ctx->b_buffer;
        ctx->c = ctx->c_buffer;
@@ -63,11 +63,11 @@ void shabal512_init(shabal_ctx_t* ctx){
        }
 }
 
-void shabal512_ctx2hash(void* dest, const shabal_ctx_t* ctx){
+void shabal512_ctx2hash(void *dest, const shabal_ctx_t *ctx){
        shabal_ctx2hash(dest, ctx, 512);
 }
 
-void shabal512(void* dest, void* msg, uint32_t length_b){
+void shabal512(void *dest, void *msg, uint32_t length_b){
        shabal_ctx_t ctx;
        shabal512_init(&ctx);
        while(length_b>=SHABAL_BLOCKSIZE){
index 87e5d456d52690269623fe3246ba751cbc527937..052dc2707d2ffe129d5c88d65c6cee46a3aa2160 100644 (file)
@@ -31,7 +31,7 @@
 #include "sha1.h"
 #include "shacal1_enc.h"
 
-void shacal1_enc(void* buffer, void* key, uint16_t keysize_b){
+void shacal1_enc(void *buffer, void *key, uint16_t keysize_b){
        sha1_ctx_t ctx, t_ctx;
        uint8_t i;
        memcpy(t_ctx.h, buffer, SHA1_HASH_BITS/8);
index e1bdd989e2c33b9ed3c620ae2d1a9976d787f583..7ff831bc4e01278301a1f794bbe768d744582b94 100644 (file)
@@ -26,6 +26,6 @@
 #define SHACAL1_KEYSIZE 512
 #define SHACAL1_KEYSIZE_B ((SHACAL1_KEYSIZE+7)/8)
 
-void shacal1_enc(void* buffer, void* key, uint16_t keysize_b);
+void shacal1_enc(void *buffer, void *key, uint16_t keysize_b);
 
 #endif /*SHACAL1_ENC_H_*/
index b5380e57f3f4fefb6d54877266be7752e00e6600..6d5e8aa6dff16138ca1ae1ad70650fdfe16c76c5 100644 (file)
@@ -32,7 +32,7 @@
 #include "shacal2_enc.h"
 
 
-void shacal2_enc(void* buffer, void* key, uint16_t keysize_b){
+void shacal2_enc(void *buffer, void *key, uint16_t keysize_b){
        uint8_t i;
        sha256_ctx_t ctx, t_ctx;
        memcpy(ctx.h, buffer, SHACAL2_BLOCKSIZE_B);
index ffa277c72c05ef30c84bb8f3f8bdcc26543d1c4e..6ae89b732f3cbe89e70f0b9e3e6f67fdfbb1dbea 100644 (file)
@@ -27,7 +27,7 @@
 #define SHACAL2_KEYSIZE SHA256_BLOCK_BITS
 #define SHACAL2_KEYSIZE_B ((SHACAL2_KEYSIZE+7)/8)
 
-void shacal2_enc(void* buffer, void* key, uint16_t keysize_b);
+void shacal2_enc(void *buffer, void *key, uint16_t keysize_b);
 
 
 #endif /*SHACAL2_ENC_H_*/
index 0fd5b51b5125f2d11ff37a87b928311d8159257a..fe12eeedf091d26f63ad5f62ca8dd0a6a59a2203 100644 (file)
@@ -45,32 +45,32 @@ typedef struct{
         ubi256_ctx_t ubictx;
 }skein256_ctx_t;
 
-void skein256_init(skein256_ctx_tctx, uint16_t outsize_b);
-void skein256_nextBlock(skein256_ctx_t* ctx, const void* block);
-void skein256_lastBlock(skein256_ctx_t* ctx, const void* block, uint16_t length_b);
-void skein256_ctx2hash(void* dest, skein256_ctx_t* ctx);
-void skein256(void* dest, uint16_t outlength_b, const void* msg, uint32_t length_b);
+void skein256_init(skein256_ctx_t *ctx, uint16_t outsize_b);
+void skein256_nextBlock(skein256_ctx_t *ctx, const void *block);
+void skein256_lastBlock(skein256_ctx_t *ctx, const void *block, uint16_t length_b);
+void skein256_ctx2hash(void *dest, skein256_ctx_t *ctx);
+void skein256(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b);
 
 typedef struct{
         uint16_t outsize_b;
         ubi512_ctx_t ubictx;
 }skein512_ctx_t;
 
-void skein512_init(skein512_ctx_tctx, uint16_t outsize_b);
-void skein512_nextBlock(skein512_ctx_t* ctx, const void* block);
-void skein512_lastBlock(skein512_ctx_t* ctx, const void* block, uint16_t length_b);
-void skein512_ctx2hash(void* dest, skein512_ctx_t* ctx);
-void skein512(void* dest, uint16_t outlength_b, const void* msg, uint32_t length_b);
+void skein512_init(skein512_ctx_t *ctx, uint16_t outsize_b);
+void skein512_nextBlock(skein512_ctx_t *ctx, const void *block);
+void skein512_lastBlock(skein512_ctx_t *ctx, const void *block, uint16_t length_b);
+void skein512_ctx2hash(void *dest, skein512_ctx_t *ctx);
+void skein512(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b);
 
 typedef struct{
         uint16_t outsize_b;
         ubi1024_ctx_t ubictx;
 }skein1024_ctx_t;
 
-void skein1024_init(skein1024_ctx_tctx, uint16_t outsize_b);
-void skein1024_nextBlock(skein1024_ctx_t* ctx, const void* block);
-void skein1024_lastBlock(skein1024_ctx_t* ctx, const void* block, uint16_t length_b);
-void skein1024_ctx2hash(void* dest, skein1024_ctx_t* ctx);
-void skein1024(void* dest, uint16_t outlength_b, const void* msg, uint32_t length_b);
+void skein1024_init(skein1024_ctx_t *ctx, uint16_t outsize_b);
+void skein1024_nextBlock(skein1024_ctx_t *ctx, const void *block);
+void skein1024_lastBlock(skein1024_ctx_t *ctx, const void *block, uint16_t length_b);
+void skein1024_ctx2hash(void *dest, skein1024_ctx_t *ctx);
+void skein1024(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b);
 
 #endif /* SKEIN_H_ */
index ac3162e53cb3f1370a40d482d1c74b1006870698..3434f9a9d5c55498f933dfb5de2ad9254374faf4 100644 (file)
@@ -30,7 +30,7 @@
 #include "skein.h"
 
 
-void skein1024_init(skein1024_ctx_tctx, uint16_t outsize_b){
+void skein1024_init(skein1024_ctx_t *ctx, uint16_t outsize_b){
        skein_config_t conf;
        uint8_t null[UBI1024_BLOCKSIZE_B];
        memset(null, 0, UBI1024_BLOCKSIZE_B);
@@ -47,15 +47,15 @@ void skein1024_init(skein1024_ctx_t* ctx, uint16_t outsize_b){
        ubi1024_init(&(ctx->ubictx), ctx->ubictx.g, UBI_TYPE_MSG);
 }
 
-void skein1024_nextBlock(skein1024_ctx_t* ctx, const void* block){
+void skein1024_nextBlock(skein1024_ctx_t *ctx, const void *block){
        ubi1024_nextBlock(&(ctx->ubictx), block);
 }
 
-void skein1024_lastBlock(skein1024_ctx_t* ctx, const void* block, uint16_t length_b){
+void skein1024_lastBlock(skein1024_ctx_t *ctx, const void *block, uint16_t length_b){
        ubi1024_lastBlock(&(ctx->ubictx), block, length_b);
 }
 
-void skein1024_ctx2hash(void* dest, skein1024_ctx_t* ctx){
+void skein1024_ctx2hash(void *dest, skein1024_ctx_t *ctx){
        ubi1024_ctx_t uctx;
        uint16_t outsize_b;
        
@@ -80,7 +80,7 @@ void skein1024_ctx2hash(void* dest, skein1024_ctx_t* ctx){
        }
 }
 
-void skein1024(void* dest, uint16_t outlength_b, const void* msg, uint32_t length_b){
+void skein1024(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b){
        skein1024_ctx_t ctx;
        skein1024_init(&ctx, outlength_b);
        while(length_b>SKEIN1024_BLOCKSIZE){
index 8983f6a2e539381b61bceeb93cce23cd499837e5..a96a930d04def83ee854181eae140bc81ad37e54 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void skein1024_init(skein1024_ctx_tctx, uint16_t outsize_b){
+void skein1024_init(skein1024_ctx_t *ctx, uint16_t outsize_b){
        skein_config_t conf;
        uint8_t null[UBI1024_BLOCKSIZE_B];
        memset(null, 0, UBI1024_BLOCKSIZE_B);
@@ -119,7 +119,7 @@ skein1024_lastBlock:
 
 /******************************************************************************/
 /*
-void skein1024_ctx2hash(void* dest, skein1024_ctx_t* ctx){
+void skein1024_ctx2hash(void *dest, skein1024_ctx_t *ctx){
        ubi1024_ctx_t uctx;
        uint16_t outsize_b;
        
@@ -282,7 +282,7 @@ skein1024_ctx2hash:
 
 /******************************************************************************/
 /*
-void skein1024(void* dest, uint16_t outlength_b, const void* msg, uint32_t length_b){
+void skein1024(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b){
        skein1024_ctx_t ctx;
        skein1024_init(&ctx, outlength_b);
        while(length_b>SKEIN1024_BLOCKSIZE){
index dfe6ef3a427c64f2e84cd72eda858cbea0fab3d5..acc0649ca1a6a65cbf75992c3d04c55886257630 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "cli.h"
 
-void skein256_init(skein256_ctx_tctx, uint16_t outsize_b){
+void skein256_init(skein256_ctx_t *ctx, uint16_t outsize_b){
        skein_config_t conf;
        uint8_t null[UBI256_BLOCKSIZE_B];
        memset(null, 0, UBI256_BLOCKSIZE_B);
@@ -48,15 +48,15 @@ void skein256_init(skein256_ctx_t* ctx, uint16_t outsize_b){
        ubi256_init(&(ctx->ubictx), ctx->ubictx.g, UBI_TYPE_MSG);
 }
 
-void skein256_nextBlock(skein256_ctx_t* ctx, const void* block){
+void skein256_nextBlock(skein256_ctx_t *ctx, const void *block){
        ubi256_nextBlock(&(ctx->ubictx), block);
 }
 
-void skein256_lastBlock(skein256_ctx_t* ctx, const void* block, uint16_t length_b){
+void skein256_lastBlock(skein256_ctx_t *ctx, const void *block, uint16_t length_b){
        ubi256_lastBlock(&(ctx->ubictx), block, length_b);
 }
 
-void skein256_ctx2hash(void* dest, skein256_ctx_t* ctx){
+void skein256_ctx2hash(void *dest, skein256_ctx_t *ctx){
        ubi256_ctx_t uctx;
        uint16_t outsize_b;
        
@@ -81,7 +81,7 @@ void skein256_ctx2hash(void* dest, skein256_ctx_t* ctx){
        }
 }
 
-void skein256(void* dest, uint16_t outlength_b,const void* msg, uint32_t length_b){
+void skein256(void *dest, uint16_t outlength_b,const void *msg, uint32_t length_b){
        skein256_ctx_t ctx;
        skein256_init(&ctx, outlength_b);
        while(length_b>SKEIN256_BLOCKSIZE){
index 0c6c2d0b691df67c60b60d907ebe0e7fb05ba4fb..b82ced825a8036bb267f68604a366f7854e0f074 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void skein256_init(skein256_ctx_tctx, uint16_t outsize_b){
+void skein256_init(skein256_ctx_t *ctx, uint16_t outsize_b){
        skein_config_t conf;
        uint8_t null[UBI256_BLOCKSIZE_B];
        memset(null, 0, UBI256_BLOCKSIZE_B);
@@ -118,7 +118,7 @@ skein256_lastBlock:
 
 /******************************************************************************/
 /*
-void skein256_ctx2hash(void* dest, skein256_ctx_t* ctx){
+void skein256_ctx2hash(void *dest, skein256_ctx_t *ctx){
        ubi256_ctx_t uctx;
        uint16_t outsize_b;
 
@@ -267,7 +267,7 @@ skein256_ctx2hash:
 
 /******************************************************************************/
 /*
-void skein256(void* dest, uint16_t outlength_b, const void* msg, uint32_t length_b){
+void skein256(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b){
        skein256_ctx_t ctx;
        skein256_init(&ctx, outlength_b);
        while(length_b>SKEIN256_BLOCKSIZE){
index 2558f340d6acea02889606dab16921fe66d2fc34..38d4b9bc32946f2e3886a95a3f860e4d6c5e9529 100644 (file)
@@ -30,7 +30,7 @@
 #include "skein.h"
 
 
-void skein512_init(skein512_ctx_tctx, uint16_t outsize_b){
+void skein512_init(skein512_ctx_t *ctx, uint16_t outsize_b){
        skein_config_t conf;
        uint8_t null[UBI512_BLOCKSIZE_B];
        memset(null, 0, UBI512_BLOCKSIZE_B);
@@ -47,15 +47,15 @@ void skein512_init(skein512_ctx_t* ctx, uint16_t outsize_b){
        ubi512_init(&(ctx->ubictx), ctx->ubictx.g, UBI_TYPE_MSG);
 }
 
-void skein512_nextBlock(skein512_ctx_t* ctx, const void* block){
+void skein512_nextBlock(skein512_ctx_t *ctx, const void *block){
        ubi512_nextBlock(&(ctx->ubictx), block);
 }
 
-void skein512_lastBlock(skein512_ctx_t* ctx, const void* block, uint16_t length_b){
+void skein512_lastBlock(skein512_ctx_t *ctx, const void *block, uint16_t length_b){
        ubi512_lastBlock(&(ctx->ubictx), block, length_b);
 }
 
-void skein512_ctx2hash(void* dest, skein512_ctx_t* ctx){
+void skein512_ctx2hash(void *dest, skein512_ctx_t *ctx){
        ubi512_ctx_t uctx;
        uint16_t outsize_b;
        
@@ -80,7 +80,7 @@ void skein512_ctx2hash(void* dest, skein512_ctx_t* ctx){
        }
 }
 
-void skein512(void* dest, uint16_t outlength_b,const void* msg, uint32_t length_b){
+void skein512(void *dest, uint16_t outlength_b,const void *msg, uint32_t length_b){
        skein512_ctx_t ctx;
        skein512_init(&ctx, outlength_b);
        while(length_b>SKEIN512_BLOCKSIZE){
index 8f6229d9796a8344d752bea4e465158f47e8335a..46c490744065c65a7908cee3c06256a4a20d9943 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void skein512_init(skein512_ctx_tctx, uint16_t outsize_b){
+void skein512_init(skein512_ctx_t *ctx, uint16_t outsize_b){
        skein_config_t conf;
        uint8_t null[UBI512_BLOCKSIZE_B];
        memset(null, 0, UBI512_BLOCKSIZE_B);
@@ -119,7 +119,7 @@ skein512_lastBlock:
 
 /******************************************************************************/
 /*
-void skein512_ctx2hash(void* dest, skein512_ctx_t* ctx){
+void skein512_ctx2hash(void *dest, skein512_ctx_t *ctx){
        ubi512_ctx_t uctx;
        uint16_t outsize_b;
        
@@ -275,7 +275,7 @@ skein512_ctx2hash:
 
 /******************************************************************************/
 /*
-void skein512(void* dest, uint16_t outlength_b,const void* msg, uint32_t length_b){
+void skein512(void *dest, uint16_t outlength_b,const void *msg, uint32_t length_b){
        skein512_ctx_t ctx;
        skein512_init(&ctx, outlength_b);
        while(length_b>SKEIN512_BLOCKSIZE){
index 3b4cc99f1eb506b29f511be8c00ab0dad1cec069..f1cf0f16d2c6c38f2c9cf6cc061c3159ae80f750 100644 (file)
@@ -72,19 +72,19 @@ typedef struct{
 } threefish1024_ctx_t;
 
 
-void threefish_mix(voiddata, uint8_t rot);
-void threefish_invmix(voiddata, uint8_t rot);
+void threefish_mix(void *data, uint8_t rot);
+void threefish_invmix(void *data, uint8_t rot);
 
-void threefish256_init(const void* key, const void* tweak, threefish256_ctx_t* ctx);
-void threefish512_init(const void* key, const void* tweak, threefish512_ctx_t* ctx);
-void threefish1024_init(const void* key, const void* tweak, threefish1024_ctx_t* ctx);
+void threefish256_init(const void *key, const void *tweak, threefish256_ctx_t *ctx);
+void threefish512_init(const void *key, const void *tweak, threefish512_ctx_t *ctx);
+void threefish1024_init(const void *key, const void *tweak, threefish1024_ctx_t *ctx);
 
-void threefish256_enc(void* data, const threefish256_ctx_t* ctx);
-void threefish512_enc(void* data, const threefish512_ctx_t* ctx);
-void threefish1024_enc(void* data, const threefish1024_ctx_t* ctx);
+void threefish256_enc(void *data, const threefish256_ctx_t *ctx);
+void threefish512_enc(void *data, const threefish512_ctx_t *ctx);
+void threefish1024_enc(void *data, const threefish1024_ctx_t *ctx);
 
-void threefish256_dec(void* data, const threefish256_ctx_t* ctx);
-void threefish512_dec(void* data, const threefish512_ctx_t* ctx);
-void threefish1024_dec(void* data, const threefish1024_ctx_t* ctx);
+void threefish256_dec(void *data, const threefish256_ctx_t *ctx);
+void threefish512_dec(void *data, const threefish512_ctx_t *ctx);
+void threefish1024_dec(void *data, const threefish1024_ctx_t *ctx);
 
 #endif /* THREEFISH_H_ */
index 3378e77ad13ef090154d7f3e935186f60bcf29ab..d01ff938780f433d5fcb4942174f598c59a75b84 100644 (file)
@@ -33,7 +33,7 @@
 #define X(a) (((uint64_t*)data)[(a)])
 
 static
-void permute_inv16(voiddata){
+void permute_inv16(void *data){
        uint64_t t;
        t = X(15);
        X(15) = X(7);
@@ -56,7 +56,7 @@ void permute_inv16(void* data){
 }
 
 static
-void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
+void add_key_16(void *data, const threefish1024_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<13; ++i){
                X(i) -= ctx->k[(s+i)%17];
@@ -66,7 +66,7 @@ void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
        X(15) -= ctx->k[(s+15)%17] + s;
 }
 
-void threefish1024_dec(void* data, const threefish1024_ctx_t* ctx){
+void threefish1024_dec(void *data, const threefish1024_ctx_t *ctx){
        uint8_t i=0,s=20;
        /* old round constants
        uint8_t r0[8] = {47, 58, 17, 28, 34, 33, 25, 55};
index 077281a0a8735f27e69dc98e9538f3c0493dca1d..a733094e8bfff899cebf091c6670d5c360b8a5cb 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void permute_inv16(voiddata){
+void permute_inv16(void *data){
        uint64_t t;
        t = X(15);
        X(15) = X(7);
@@ -48,7 +48,7 @@ void permute_inv16(void* data){
        X(10) = X(8);
        X(8) = t;
 }
-void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
+void add_key_16(void *data, const threefish1024_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<13; ++i){
                X(i) -= ctx->k[(s+i)%17];
@@ -57,7 +57,7 @@ void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
        X(14) -= ctx->k[(s+14)%17] + ctx->t[(s+1)%3];
        X(15) -= ctx->k[(s+15)%17] + s;
 }
-void threefish1024_dec(void* data, const threefish1024_ctx_t* ctx){
+void threefish1024_dec(void *data, const threefish1024_ctx_t *ctx){
        uint8_t i=0,s=20;
        uint8_t r0[8] = {0x69, 0x72, 0x21, 0x34, 0x42, 0x41, 0x31, 0x79};
        uint8_t r1[8] = {0x61, 0x19, 0x1a, 0x19, 0x53, 0x10, 0x31, 0x53};
index 09b031f634ebaea2db24d5ac1c94f89782bab56e..89c753505c40c96726257f1d47f18e1e41f6ed67 100644 (file)
@@ -33,7 +33,7 @@
 #define X(a) (((uint64_t*)data)[(a)])
 
 static
-void permute_inv16(voiddata){
+void permute_inv16(void *data){
        uint64_t t;
        t = X(15);
        X(15) = X(7);
@@ -56,7 +56,7 @@ void permute_inv16(void* data){
 }
 
 static
-void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
+void add_key_16(void *data, const threefish1024_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<13; ++i){
                X(i) -= ctx->k[(s+i)%17];
@@ -66,7 +66,7 @@ void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
        X(15) -= ctx->k[(s+15)%17] + s;
 }
 
-void threefish1024_dec(void* data, const threefish1024_ctx_t* ctx){
+void threefish1024_dec(void *data, const threefish1024_ctx_t *ctx){
        uint8_t i=0,s=20;
        uint8_t r0[8] = {0x69, 0x72, 0x21, 0x34, 0x42, 0x41, 0x31, 0x79};
        uint8_t r1[8] = {0x61, 0x19, 0x1a, 0x19, 0x53, 0x10, 0x31, 0x53};
index 5e6310b9cefb9a1eba006ab69fc2db6de51edea2..662e79dd1c03a54db44aba7ecaacef7e9664b1b2 100644 (file)
@@ -33,7 +33,7 @@
 #define X(a) (((uint64_t*)data)[(a)])
 
 static
-void permute_16(voiddata){
+void permute_16(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(9);
@@ -61,7 +61,7 @@ void permute_16(void* data){
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
 
-void threefish1024_init(const void* key, const void* tweak, threefish1024_ctx_t* ctx){
+void threefish1024_init(const void *key, const void *tweak, threefish1024_ctx_t *ctx){
        memcpy(ctx->k, key, 16*8);
        if(tweak){
                memcpy(ctx->t, tweak, 2*8);
@@ -77,7 +77,7 @@ void threefish1024_init(const void* key, const void* tweak, threefish1024_ctx_t*
 }
 
 static
-void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
+void add_key_16(void *data, const threefish1024_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<13; ++i){
                X(i) += ctx->k[(s+i)%17];
@@ -87,7 +87,7 @@ void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
        X(15) += ctx->k[(s+15)%17] + s;
 }
 
-void threefish1024_enc(void* data, const threefish1024_ctx_t* ctx){
+void threefish1024_enc(void *data, const threefish1024_ctx_t *ctx){
        uint8_t i=0,s=0;
        /* old constans, changed at round 2 of the SHA-3 contest
        uint8_t r0[8] = {55, 25, 33, 34, 28, 17, 58, 47};
index 17c1983c1ecc801e7ed294dd5eedb6278bf7dc39..38f85ed099c8e14e05c8f4e65ada3038a869a02f 100644 (file)
@@ -39,7 +39,7 @@ A7 = 21
 
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
-void threefish1024_init(const void* key, const void* tweak, threefish512_ctx_t* ctx){
+void threefish1024_init(const void *key, const void *tweak, threefish512_ctx_t *ctx){
        memcpy(ctx->k, key, 16*8);
        memcpy(ctx->t, tweak, 2*8);
        uint8_t i;
@@ -178,7 +178,7 @@ threefish1024_init:
 /******************************************************************************/
 /*
 #define X(a) (((uint64_t*)data)[(a)])
-void permute_16(voiddata){
+void permute_16(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(9);
@@ -199,7 +199,7 @@ void permute_16(void* data){
        X(12) = X(14);
        X(14) = t;
 }
-void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
+void add_key_16(void *data, const threefish1024_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<13; ++i){
                X(i) += ctx->k[(s+i)%17];
@@ -208,7 +208,7 @@ void add_key_16(void* data, const threefish1024_ctx_t* ctx, uint8_t s){
        X(14) += ctx->k[(s+14)%17] + ctx->t[(s+1)%3];
        X(15) += ctx->k[(s+15)%17] + s;
 }
-void threefish1024_enc(void* data, const threefish1024_ctx_t* ctx){
+void threefish1024_enc(void *data, const threefish1024_ctx_t *ctx){
        uint8_t i=0,s=0;
        uint8_t r0[8] = {55, 25, 33, 34, 28, 17, 58, 47};
        uint8_t r1[8] = {43, 25,  8, 43,  7,  6,  7, 49};
index 845cc199b3ef9aa6de85ce055438980752e2280a..658aa5b3bdc89b1e3ba917e2ac326cf9164f6dc5 100644 (file)
@@ -32,7 +32,7 @@
 
 #define X(a) (((uint64_t*)data)[(a)])
 static
-void permute_4(voiddata){
+void permute_4(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(3);
@@ -43,14 +43,14 @@ void permute_4(void* data){
 #define T(s) (((uint64_t*)tweak)[(s)])
 
 static
-void add_key_4(void* data, const threefish256_ctx_t* ctx, uint8_t s){
+void add_key_4(void *data, const threefish256_ctx_t *ctx, uint8_t s){
        X(0) -= ctx->k[(s+0)%5];
        X(1) -= ctx->k[(s+1)%5] + ctx->t[s%3];
        X(2) -= ctx->k[(s+2)%5] + ctx->t[(s+1)%3];
        X(3) -= ctx->k[(s+3)%5] + s;
 }
 
-void threefish256_dec(void* data, const threefish256_ctx_t* ctx){
+void threefish256_dec(void *data, const threefish256_ctx_t *ctx){
        uint8_t i=0,s=18;
 /* old constans, changed at round 2 of the SHA-3 contest
        uint8_t r0[8] = {59, 11, 53, 26, 58, 13, 36,  5};
index 4ae4f6efef16a1772bfa269328dc1cfbbb23955b..2cb5b2f86ceefce73ff04ac40287e49baf895bd3 100644 (file)
 
 /******************************************************************************/
 /*
-void permute_4(voiddata){
+void permute_4(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(3);
        X(3) = t;
 }
-void add_key_4(void* data, const threefish256_ctx_t* ctx, uint8_t s){
+void add_key_4(void *data, const threefish256_ctx_t *ctx, uint8_t s){
        X(0) -= ctx->k[(s+0)%5];
        X(1) -= ctx->k[(s+1)%5] + ctx->t[s%3];
        X(2) -= ctx->k[(s+2)%5] + ctx->t[(s+1)%3];
        X(3) -= ctx->k[(s+3)%5] + s;
 }
-void threefish256_dec(void* data, const threefish256_ctx_t* ctx){
+void threefish256_dec(void *data, const threefish256_ctx_t *ctx){
        uint8_t i=0,s=18;
        uint8_t r0[8] = {0x73, 0x13, 0x7b, 0x32, 0x72, 0x2b, 0x44, 0x1b};
        uint8_t r1[8] = {0x62, 0x52, 0x43, 0x24, 0x54, 0x6a, 0x34, 0x70};
index 1d8975614ea265bc51e8fd8e35fb65d6d39f5549..645322892daa18abc45f80b2aec598d4decd7104 100644 (file)
@@ -32,7 +32,7 @@
 
 #define X(a) (((uint64_t*)data)[(a)])
 static
-void permute_4(voiddata){
+void permute_4(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(3);
@@ -40,14 +40,14 @@ void permute_4(void* data){
 }
 
 static
-void add_key_4(void* data, const threefish256_ctx_t* ctx, uint8_t s){
+void add_key_4(void *data, const threefish256_ctx_t *ctx, uint8_t s){
        X(0) -= ctx->k[(s+0)%5];
        X(1) -= ctx->k[(s+1)%5] + ctx->t[s%3];
        X(2) -= ctx->k[(s+2)%5] + ctx->t[(s+1)%3];
        X(3) -= ctx->k[(s+3)%5] + s;
 }
 
-void threefish256_dec(void* data, const threefish256_ctx_t* ctx){
+void threefish256_dec(void *data, const threefish256_ctx_t *ctx){
        uint8_t i=0,s=18;
        uint8_t r0[8] = {0x73, 0x13, 0x7b, 0x32, 0x72, 0x2b, 0x44, 0x1b}; 
        uint8_t r1[8] = {0x62, 0x52, 0x43, 0x24, 0x54, 0x6a, 0x34, 0x70};
index ebfa03975aec82ebff4b2a0537f29447e4534741..4ed6153be62e5cf8df0b723f0d78a05d2ee43eff 100644 (file)
@@ -32,7 +32,7 @@
 
 #define X(a) (((uint64_t*)data)[(a)])
 static
-void permute_4(voiddata){
+void permute_4(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(3);
@@ -45,7 +45,7 @@ void permute_4(void* data){
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
 
-void threefish256_init(const void* key, const void* tweak, threefish256_ctx_t* ctx){
+void threefish256_init(const void *key, const void *tweak, threefish256_ctx_t *ctx){
        memcpy(ctx->k, key, 4*8);
        if(tweak){
                memcpy(ctx->t, tweak, 2*8);
@@ -61,14 +61,14 @@ void threefish256_init(const void* key, const void* tweak, threefish256_ctx_t* c
 }
 
 static
-void add_key_4(void* data, const threefish256_ctx_t* ctx, uint8_t s){
+void add_key_4(void *data, const threefish256_ctx_t *ctx, uint8_t s){
        X(0) += ctx->k[(s+0)%5];
        X(1) += ctx->k[(s+1)%5] + ctx->t[s%3];
        X(2) += ctx->k[(s+2)%5] + ctx->t[(s+1)%3];
        X(3) += ctx->k[(s+3)%5] + s;
 }
 
-void threefish256_enc(void* data, const threefish256_ctx_t* ctx){
+void threefish256_enc(void *data, const threefish256_ctx_t *ctx){
        uint8_t i=0,s=0;
 /* old constans, changed at round 2 of the SHA-3 contest
        uint8_t r0[8] = { 5, 36, 13, 58, 26, 53, 11, 59};
index 184d32a5aa6866bb5bad3341be5f7527f5be8ffe..b4db42f3cafc99e5852ce3d11d2e97f7194ae7ed 100644 (file)
@@ -40,7 +40,7 @@ A7 = 21
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
 
-void threefish256_init(void* key, void* tweak, threefish256_ctx_t* ctx){
+void threefish256_init(void *key, void *tweak, threefish256_ctx_t *ctx){
        memcpy(ctx->k, key, 4*8);
        memcpy(ctx->t, tweak, 2*8);
        uint8_t i;
@@ -180,19 +180,19 @@ threefish256_init:
 /******************************************************************************/
 /*
 #define X(a) (((uint64_t*)data)[(a)])
-void permute_4(voiddata){
+void permute_4(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(3);
        X(3) = t;
 }
-void add_key_4(void* data, threefish256_ctx_t* ctx, uint8_t s){ / * s: 0..19 * /
+void add_key_4(void *data, threefish256_ctx_t *ctx, uint8_t s){ / * s: 0..19 * /
        X(0) += ctx->k[(s+0)%5];
        X(1) += ctx->k[(s+1)%5] + ctx->t[s%3];
        X(2) += ctx->k[(s+2)%5] + ctx->t[(s+1)%3];
        X(3) += ctx->k[(s+3)%5] + s;
 }
-void threefish256_enc(void* data, threefish256_ctx_t* ctx){
+void threefish256_enc(void *data, threefish256_ctx_t *ctx){
        uint8_t i=0,s=0;
        uint8_t r0[8] = { 5, 36, 13, 58, 26, 53, 11, 59};
        uint8_t r1[8] = {56, 28, 46, 44, 20, 35, 42, 50};
index a9a713cc7a698aed79960291cc58606dbd3b0eba..c98f37fa0b7698b294dcd75f3999f284300896a9 100644 (file)
@@ -40,7 +40,7 @@ A7 = 21
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
 
-void threefish256_init(void* key, void* tweak, threefish256_ctx_t* ctx){
+void threefish256_init(void *key, void *tweak, threefish256_ctx_t *ctx){
        memcpy(ctx->k, key, 4*8);
        memcpy(ctx->t, tweak, 2*8);
        uint8_t i;
@@ -179,19 +179,19 @@ threefish256_init:
 /******************************************************************************/
 /*
 #define X(a) (((uint64_t*)data)[(a)])
-void permute_4(voiddata){
+void permute_4(void *data){
        uint64_t t;
        t = X(1);
        X(1) = X(3);
        X(3) = t;
 }
-void add_key_4(void* data, threefish256_ctx_t* ctx, uint8_t s){ / * s: 0..19 * /
+void add_key_4(void *data, threefish256_ctx_t *ctx, uint8_t s){ / * s: 0..19 * /
        X(0) += ctx->k[(s+0)%5];
        X(1) += ctx->k[(s+1)%5] + ctx->t[s%3];
        X(2) += ctx->k[(s+2)%5] + ctx->t[(s+1)%3];
        X(3) += ctx->k[(s+3)%5] + s;
 }
-void threefish256_enc(void* data, threefish256_ctx_t* ctx){
+void threefish256_enc(void *data, threefish256_ctx_t *ctx){
        uint8_t i=0,s=0;
        uint8_t r0[8] = { 5, 36, 13, 58, 26, 53, 11, 59};
        uint8_t r1[8] = {56, 28, 46, 44, 20, 35, 42, 50};
index 31e11af188b3558836043051b7a8839fc9037ef8..c5d9910019c82070d468267f95ec8418f61dc291 100644 (file)
@@ -35,7 +35,7 @@
 
 
 static
-void permute_inv8(voiddata){
+void permute_inv8(void *data){
        uint64_t t;
        t = X(6);
        X(6) = X(4);
@@ -48,7 +48,7 @@ void permute_inv8(void* data){
 }
 
 static
-void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
+void add_key_8(void *data, const threefish512_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<5; ++i){
                X(i) -= ctx->k[(s+i)%9];
@@ -58,7 +58,7 @@ void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
        X(7) -= ctx->k[(s+7)%9] + s;
 }
 
-void threefish512_dec(void* data, const threefish512_ctx_t* ctx){
+void threefish512_dec(void *data, const threefish512_ctx_t *ctx){
        uint8_t i=0,s=18;
        /* old round constants
        uint8_t r0[8] = {33, 29, 39, 33, 26, 34, 48, 38};
index 3f8f8f6f2d734468fb9bbbaf9540cb89f59568f6..795e05a1ec853ca3eb8ae37d55f9ee364e05bb0b 100644 (file)
@@ -31,7 +31,7 @@
 
 
 static
-void permute_inv8(voiddata){
+void permute_inv8(void *data){
        uint64_t t;
        t = X(6);
        X(6) = X(4);
@@ -44,7 +44,7 @@ void permute_inv8(void* data){
 }
 
 static
-void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
+void add_key_8(void *data, const threefish512_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<5; ++i){
                X(i) -= ctx->k[(s+i)%9];
@@ -54,7 +54,7 @@ void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
        X(7) -= ctx->k[(s+7)%9] + s;
 }
 
-void threefish512_dec(void* data, const threefish512_ctx_t* ctx){
+void threefish512_dec(void *data, const threefish512_ctx_t *ctx){
        uint8_t i=0,s=18;
        uint8_t r0[8] = {0x41, 0x4b, 0x59, 0x41, 0x32, 0x42, 0x60, 0x5a};
        uint8_t r1[8] = {0x63, 0x32, 0x33, 0x61, 0x14, 0x2a, 0x24, 0x4a};
index aaa9886c0450ca1a238f9e3aeb716092a241c0f4..df513bc1b9ac98e1944767ac6f84aaf953022408 100644 (file)
@@ -35,7 +35,7 @@
 
 
 static
-void permute_inv8(voiddata){
+void permute_inv8(void *data){
        uint64_t t;
        t = X(6);
        X(6) = X(4);
@@ -48,7 +48,7 @@ void permute_inv8(void* data){
 }
 
 static
-void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
+void add_key_8(void *data, const threefish512_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<5; ++i){
                X(i) -= ctx->k[(s+i)%9];
@@ -58,7 +58,7 @@ void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
        X(7) -= ctx->k[(s+7)%9] + s;
 }
 
-void threefish512_dec(void* data, const threefish512_ctx_t* ctx){
+void threefish512_dec(void *data, const threefish512_ctx_t *ctx){
        uint8_t i=0,s=18;
        uint8_t r0[8] = {0x41, 0x4b, 0x59, 0x41, 0x32, 0x42, 0x60, 0x5a};
        uint8_t r1[8] = {0x63, 0x32, 0x33, 0x61, 0x14, 0x2a, 0x24, 0x4a};
index ea7f1b7e8d9f7aef07e4ddc6e32700d4f1a61d16..4fbc886f47fc89a149ac9f10fa9b4de4345b30b6 100644 (file)
@@ -35,7 +35,7 @@
 
 
 static
-void permute_8(voiddata){
+void permute_8(void *data){
        uint64_t t;
        t = X(0);
        X(0) = X(2);
@@ -48,7 +48,7 @@ void permute_8(void* data){
 }
 /*
 static
-void permute_inv8(voiddata){
+void permute_inv8(void *data){
        uint64_t t;
        t = X(6);
        X(6) = X(4);
@@ -67,7 +67,7 @@ void permute_inv8(void* data){
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
 
-void threefish512_init(const void* key, const void* tweak, threefish512_ctx_t* ctx){
+void threefish512_init(const void *key, const void *tweak, threefish512_ctx_t *ctx){
        memcpy(ctx->k, key, 8*8);
        if(tweak){
                memcpy(ctx->t, tweak, 2*8);
@@ -83,7 +83,7 @@ void threefish512_init(const void* key, const void* tweak, threefish512_ctx_t* c
 }
 
 static
-void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
+void add_key_8(void *data, const threefish512_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<5; ++i){
                X(i) += ctx->k[(s+i)%9];
@@ -93,7 +93,7 @@ void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
        X(7) += ctx->k[(s+7)%9] + s;
 }
 
-void threefish512_enc(void* data, const threefish512_ctx_t* ctx){
+void threefish512_enc(void *data, const threefish512_ctx_t *ctx){
        uint8_t i=0,s=0;
        /* old constans, changed at round 2 of the SHA-3 contest
        uint8_t r0[8] = {38, 48, 34, 26, 33, 39, 29, 33};
index 687b9b68edf74dedd1ed2920bcdaed61e2968695..49ead01ebf25a7d265e556eed09fa1ee0e7131e4 100644 (file)
@@ -39,7 +39,7 @@ A7 = 21
 
 #define K(s) (((uint64_t*)key)[(s)])
 #define T(s) (((uint64_t*)tweak)[(s)])
-void threefish512_init(const void* key, const void* tweak, threefish512_ctx_t* ctx){
+void threefish512_init(const void *key, const void *tweak, threefish512_ctx_t *ctx){
        memcpy(ctx->k, key, 8*8);
        memcpy(ctx->t, tweak, 2*8);
        uint8_t i;
@@ -178,7 +178,7 @@ threefish512_init:
 /******************************************************************************/
 /*
 #define X(a) (((uint64_t*)data)[(a)])
-void permute_8(voiddata){
+void permute_8(void *data){
        uint64_t t;
        t = X(0);
        X(0) = X(2);
@@ -189,7 +189,7 @@ void permute_8(void* data){
        X(3) = X(7);
        X(7) = t;
 }
-void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
+void add_key_8(void *data, const threefish512_ctx_t *ctx, uint8_t s){
        uint8_t i;
        for(i=0; i<5; ++i){
                X(i) += ctx->k[(s+i)%9];
@@ -198,7 +198,7 @@ void add_key_8(void* data, const threefish512_ctx_t* ctx, uint8_t s){
        X(6) += ctx->k[(s+6)%9] + ctx->t[(s+1)%3];
        X(7) += ctx->k[(s+7)%9] + s;
 }
-void threefish512_enc(void* data, const threefish512_ctx_t* ctx){
+void threefish512_enc(void *data, const threefish512_ctx_t *ctx){
        uint8_t i=0,s=0;
        uint8_t r0[8] = {38, 48, 34, 26, 33, 39, 29, 33};
        uint8_t r1[8] = {30, 20, 14, 12, 49, 27, 26, 51};
index 1e55cf28556414b88dec0831f18eec7bdffeb6cb..bae51c50016f228d0a907f98485aa8c2f54c54ef 100644 (file)
@@ -28,7 +28,7 @@
 /*
 #define X0 (((uint64_t*)data)[0])
 #define X1 (((uint64_t*)data)[1])
-void threefish_invmix(voiddata, uint8_t rot){
+void threefish_invmix(void *data, uint8_t rot){
        uint64_t x;
        x = X1;
        x ^= X0;
index 59cc5453ae43f02e06d56a6fb3f02de2ba02bd4f..c512aca6038616aec6c923db44a0ef460f13bc0b 100644 (file)
@@ -28,7 +28,7 @@
 /*
 #define X0 (((uint64_t*)data)[0])
 #define X1 (((uint64_t*)data)[1])
-void threefish_invmix(voiddata, uint8_t rot){
+void threefish_invmix(void *data, uint8_t rot){
        uint64_t x;
        x = X1;
        x ^= X0;
index f66488856fe09c32c6c9802a1dd27e29b912bbde..45cb1701e3c1ec965fd816f4a110b5a838939533 100644 (file)
@@ -30,7 +30,7 @@
 
 #define X0 (((uint64_t*)data)[0])
 #define X1 (((uint64_t*)data)[1])
-void threefish_invmix(voiddata, uint8_t rot){
+void threefish_invmix(void *data, uint8_t rot){
        uint64_t x;
        x = X1;
        x ^= X0;
index 07d076f341e97389dda8214a9aa3e89d24d05d81..40092209089ed9d05bfcdb08953f421af3fe2626 100644 (file)
@@ -29,7 +29,7 @@
 #define B0 (((uint64_t*)data)[0])
 #define B1 (((uint64_t*)data)[1])
 static
-void mix(voiddata, uint8_t rot){
+void mix(void *data, uint8_t rot){
        uint64_t x;
        x = B1;
        B0 += x;
index 063232e02ee585ec51c652d480ba25dc5ff00459..f18e3078c2b97479c61041260525dc97a4a21336 100644 (file)
@@ -29,7 +29,7 @@
 #define B0 (((uint64_t*)data)[0])
 #define B1 (((uint64_t*)data)[1])
 static
-void mix(voiddata, uint8_t rot){
+void mix(void *data, uint8_t rot){
        uint64_t x;
        x = B1;
        B0 += x;
index 2031bc8dbdd8b9e890b2fb2063178a4f4b4a0fbf..21b08d843548f190cf67fba6b1b56c9d23d01f72 100644 (file)
@@ -30,7 +30,7 @@
 
 #define X0 (((uint64_t*)data)[0])
 #define X1 (((uint64_t*)data)[1])
-void threefish_mix(voiddata, uint8_t rot){
+void threefish_mix(void *data, uint8_t rot){
        uint64_t x;
        x = X1;
        X0 += x;
index 3ad83cd23e4bbe5d9a17399636cd7cfaa997ad0a..b8c53e102e9ee5b3119788fcc2d6942ad0efb2c2 100644 (file)
@@ -78,20 +78,20 @@ typedef struct{
        uint8_t g[128];
 }ubi1024_ctx_t;
 
-void ubi256_init(ubi256_ctx_t* ctx, const void* g, uint8_t type);
-void ubi256_nextBlock(ubi256_ctx_t* ctx, const void* block);
-void ubi256_lastBlock(ubi256_ctx_t* ctx, const void* block, uint16_t length_b);
-void ubi256_ctx2hash(void* dest, const ubi256_ctx_t* ctx);
-
-void ubi512_init(ubi512_ctx_t* ctx, const void* g, uint8_t type);
-void ubi512_nextBlock(ubi512_ctx_t* ctx, const void* block);
-void ubi512_lastBlock(ubi512_ctx_t* ctx, const void* block, uint16_t length_b);
-void ubi512_ctx2hash(void* dest, const ubi512_ctx_t* ctx);
-
-void ubi1024_init(ubi1024_ctx_t* ctx, const void* g, uint8_t type);
-void ubi1024_nextBlock(ubi1024_ctx_t* ctx, const void* block);
-void ubi1024_lastBlock(ubi1024_ctx_t* ctx, const void* block, uint16_t length_b);
-void ubi1024_ctx2hash(void* dest, const ubi1024_ctx_t* ctx);
+void ubi256_init(ubi256_ctx_t *ctx, const void *g, uint8_t type);
+void ubi256_nextBlock(ubi256_ctx_t *ctx, const void *block);
+void ubi256_lastBlock(ubi256_ctx_t *ctx, const void *block, uint16_t length_b);
+void ubi256_ctx2hash(void *dest, const ubi256_ctx_t *ctx);
+
+void ubi512_init(ubi512_ctx_t *ctx, const void *g, uint8_t type);
+void ubi512_nextBlock(ubi512_ctx_t *ctx, const void *block);
+void ubi512_lastBlock(ubi512_ctx_t *ctx, const void *block, uint16_t length_b);
+void ubi512_ctx2hash(void *dest, const ubi512_ctx_t *ctx);
+
+void ubi1024_init(ubi1024_ctx_t *ctx, const void *g, uint8_t type);
+void ubi1024_nextBlock(ubi1024_ctx_t *ctx, const void *block);
+void ubi1024_lastBlock(ubi1024_ctx_t *ctx, const void *block, uint16_t length_b);
+void ubi1024_ctx2hash(void *dest, const ubi1024_ctx_t *ctx);
 
 typedef struct{
        char     schema[4];
index dafffbb29afd675dd677350566c4bbd73e7a02cb..97a1c834891e5a497ee6682290775bb0efb85da0 100644 (file)
 #include "memxor.h"
 #include "ubi.h"
 
-void ubi1024_init(ubi1024_ctx_t* ctx, const void* g, uint8_t type){
+void ubi1024_init(ubi1024_ctx_t *ctx, const void *g, uint8_t type){
        memset(ctx->tweak.v8, 0, 15);
        ctx->tweak.v8[15] = 0x40+type;
        memcpy(ctx->g, g, UBI1024_BLOCKSIZE_B);
 }
 
-void ubi1024_nextBlock(ubi1024_ctx_t* ctx, const void* block){
+void ubi1024_nextBlock(ubi1024_ctx_t *ctx, const void *block){
        threefish1024_ctx_t tfctx;
        ctx->tweak.v64[0] += UBI1024_BLOCKSIZE_B;
        threefish1024_init(ctx->g, ctx->tweak.v8, &tfctx);
@@ -47,7 +47,7 @@ void ubi1024_nextBlock(ubi1024_ctx_t* ctx, const void* block){
 } 
 
 
-void ubi1024_lastBlock(ubi1024_ctx_t* ctx, const void* block, uint16_t length_b){
+void ubi1024_lastBlock(ubi1024_ctx_t *ctx, const void *block, uint16_t length_b){
        threefish1024_ctx_t tfctx;
        while(length_b>UBI1024_BLOCKSIZE){
                ubi1024_nextBlock(ctx, block);
@@ -70,7 +70,7 @@ void ubi1024_lastBlock(ubi1024_ctx_t* ctx, const void* block, uint16_t length_b)
        }
 } 
 
-void ubi1024_ctx2hash(void* dest, const ubi1024_ctx_t* ctx){
+void ubi1024_ctx2hash(void *dest, const ubi1024_ctx_t *ctx){
        memcpy(dest, ctx->g, UBI1024_BLOCKSIZE_B);
 }
 
index 28b64518eb96c6e958732510dcbb54b93b36c5e7..070242a0b2338e6c39521443d9861fcd7269bca5 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void ubi1024_init(ubi1024_ctx_t* ctx, const void* g, uint8_t type){
+void ubi1024_init(ubi1024_ctx_t *ctx, const void *g, uint8_t type){
        memset(ctx->tweak, 0, 15);
        ctx->tweak[15] = 0x40+type;
        memcpy(ctx->g, g, UBI1024_BLOCKSIZE_B);
@@ -57,7 +57,7 @@ ubi1024_init:
 
 /******************************************************************************/
 /*
-void ubi1024_ctx2hash(void* dest, const ubi1024_ctx_t* ctx){
+void ubi1024_ctx2hash(void *dest, const ubi1024_ctx_t *ctx){
        memcpy(dest, ctx->g, UBI1024_BLOCKSIZE_B);
 }
 */
@@ -79,7 +79,7 @@ ubi1024_ctx2hash:
 
 /******************************************************************************/
 /*
-void ubi1024_nextBlock(ubi1024_ctx_t* ctx, const void* block){
+void ubi1024_nextBlock(ubi1024_ctx_t *ctx, const void *block){
        threefish1024_ctx_t tfctx;
        ((uint64_t*)(ctx->tweak))[0] += UBI1024_BLOCKSIZE_B;
        threefish1024_init(ctx->g, ctx->tweak, &tfctx);
@@ -162,7 +162,7 @@ exit:
 
 /******************************************************************************/
 /*
-void ubi1024_lastBlock(ubi1024_ctx_t* ctx, const void* block, uint16_t length_b){
+void ubi1024_lastBlock(ubi1024_ctx_t *ctx, const void *block, uint16_t length_b){
        threefish1024_ctx_t tfctx;
        while(length_b>UBI1024_BLOCKSIZE){
                ubi1024_nextBlock(ctx, block);
index 8e60d341301bac76c534b17fa5429b5ae95b6d73..6b7509e8d3fa7b3180d5d093fa31f5c3fda1974b 100644 (file)
 #include "memxor.h"
 #include "ubi.h"
 
-void ubi256_init(ubi256_ctx_t* ctx, const void* g, uint8_t type){
+void ubi256_init(ubi256_ctx_t *ctx, const void *g, uint8_t type){
        memset(ctx->tweak.v8, 0, 15);
        ctx->tweak.v8[15] = 0x40+type;
        memcpy(ctx->g, g, 32);
 }
 
-void ubi256_nextBlock(ubi256_ctx_t* ctx, const void* block){
+void ubi256_nextBlock(ubi256_ctx_t *ctx, const void *block){
        threefish256_ctx_t tfctx;
        ctx->tweak.v64[0] += UBI256_BLOCKSIZE_B;
        threefish256_init(ctx->g, ctx->tweak.v8, &tfctx);
@@ -47,7 +47,7 @@ void ubi256_nextBlock(ubi256_ctx_t* ctx, const void* block){
 } 
 
 
-void ubi256_lastBlock(ubi256_ctx_t* ctx, const void* block, uint16_t length_b){
+void ubi256_lastBlock(ubi256_ctx_t *ctx, const void *block, uint16_t length_b){
        threefish256_ctx_t tfctx;
        while(length_b>UBI256_BLOCKSIZE){
                ubi256_nextBlock(ctx, block);
@@ -74,7 +74,7 @@ void ubi256_lastBlock(ubi256_ctx_t* ctx, const void* block, uint16_t length_b){
 
 } 
 
-void ubi256_ctx2hash(void* dest, const ubi256_ctx_t* ctx){
+void ubi256_ctx2hash(void *dest, const ubi256_ctx_t *ctx){
        memcpy(dest, ctx->g, UBI256_BLOCKSIZE_B);
 }
 
index e5e6f9c60db54ef4980973ef2ce7c537e2013c8a..c5d1bc6e856ffb4690c06c36c5b282df57d4c562 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void ubi256_init(ubi256_ctx_t* ctx, const void* g, uint8_t type){
+void ubi256_init(ubi256_ctx_t *ctx, const void *g, uint8_t type){
        memset(ctx->tweak, 0, 15);
        ctx->tweak[15] = 0x40+type;
        memcpy(ctx->g, g, 32);
@@ -57,7 +57,7 @@ ubi256_init:
 
 /******************************************************************************/
 /*
-void ubi256_ctx2hash(void* dest, const ubi256_ctx_t* ctx){
+void ubi256_ctx2hash(void *dest, const ubi256_ctx_t *ctx){
        memcpy(dest, ctx->g, UBI256_BLOCKSIZE_B);
 }
 */
@@ -79,7 +79,7 @@ ubi256_ctx2hash:
 
 /******************************************************************************/
 /*
-void ubi256_nextBlock(ubi256_ctx_t* ctx, const void* block){
+void ubi256_nextBlock(ubi256_ctx_t *ctx, const void *block){
        threefish256_ctx_t tfctx;
        ((uint64_t*)(ctx->tweak))[0] += UBI256_BLOCKSIZE_B;
        threefish256_init(ctx->g, ctx->tweak, &tfctx);
@@ -160,7 +160,7 @@ exit:
 
 /******************************************************************************/
 /*
-void ubi256_lastBlock(ubi256_ctx_t* ctx, const void* block, uint16_t length_b){
+void ubi256_lastBlock(ubi256_ctx_t *ctx, const void *block, uint16_t length_b){
        threefish256_ctx_t tfctx;
        while(length_b>UBI256_BLOCKSIZE){
                ubi256_nextBlock(ctx, block);
index 526018fc9e4c96b6e097a4c8dabc484c1874f8a1..83621ed0613695132f62c6bc1344c305a8fc521b 100644 (file)
 #include "memxor.h"
 #include "ubi.h"
 
-void ubi512_init(ubi512_ctx_t* ctx, const void* g, uint8_t type){
+void ubi512_init(ubi512_ctx_t *ctx, const void *g, uint8_t type){
        memset(ctx->tweak.v8, 0, 15);
        ctx->tweak.v8[15] = 0x40+type;
        memcpy(ctx->g, g, UBI512_BLOCKSIZE_B);
 }
 
-void ubi512_nextBlock(ubi512_ctx_t* ctx, const void* block){
+void ubi512_nextBlock(ubi512_ctx_t *ctx, const void *block){
        threefish512_ctx_t tfctx;
        ctx->tweak.v64[0] += UBI512_BLOCKSIZE_B;
        threefish512_init(ctx->g, ctx->tweak.v8, &tfctx);
@@ -47,7 +47,7 @@ void ubi512_nextBlock(ubi512_ctx_t* ctx, const void* block){
 } 
 
 
-void ubi512_lastBlock(ubi512_ctx_t* ctx, const void* block, uint16_t length_b){
+void ubi512_lastBlock(ubi512_ctx_t *ctx, const void *block, uint16_t length_b){
        threefish512_ctx_t tfctx;
        while(length_b>UBI512_BLOCKSIZE){
                ubi512_nextBlock(ctx, block);
@@ -70,7 +70,7 @@ void ubi512_lastBlock(ubi512_ctx_t* ctx, const void* block, uint16_t length_b){
        }
 } 
 
-void ubi512_ctx2hash(void* dest, const ubi512_ctx_t* ctx){
+void ubi512_ctx2hash(void *dest, const ubi512_ctx_t *ctx){
        memcpy(dest, ctx->g, UBI512_BLOCKSIZE_B);
 }
 
index 6a17c48d46b7a8f658795fd8321025baee6909e7..b61ef9cf951aaf05b9ff364421880756df928b96 100644 (file)
@@ -27,7 +27,7 @@
 
 /******************************************************************************/
 /*
-void ubi512_init(ubi512_ctx_t* ctx, const void* g, uint8_t type){
+void ubi512_init(ubi512_ctx_t *ctx, const void *g, uint8_t type){
        memset(ctx->tweak, 0, 15);
        ctx->tweak[15] = 0x40+type;
        memcpy(ctx->g, g, UBI512_BLOCKSIZE_B);
@@ -57,7 +57,7 @@ ubi512_init:
 
 /******************************************************************************/
 /*
-void ubi512_ctx2hash(void* dest, const ubi512_ctx_t* ctx){
+void ubi512_ctx2hash(void *dest, const ubi512_ctx_t *ctx){
        memcpy(dest, ctx->g, UBI512_BLOCKSIZE_B);
 }
 */
@@ -79,7 +79,7 @@ ubi512_ctx2hash:
 
 /******************************************************************************/
 /*
-void ubi512_nextBlock(ubi512_ctx_t* ctx, const void* block){
+void ubi512_nextBlock(ubi512_ctx_t *ctx, const void *block){
        threefish512_ctx_t tfctx;
        ((uint64_t*)(ctx->tweak))[0] += UBI512_BLOCKSIZE_B;
        threefish512_init(ctx->g, ctx->tweak, &tfctx);
@@ -161,7 +161,7 @@ exit:
 
 /******************************************************************************/
 /*
-void ubi512_lastBlock(ubi512_ctx_t* ctx, const void* block, uint16_t length_b){
+void ubi512_lastBlock(ubi512_ctx_t *ctx, const void *block, uint16_t length_b){
        threefish512_ctx_t tfctx;
        while(length_b>UBI512_BLOCKSIZE){
                ubi512_nextBlock(ctx, block);
index 0b432492f38bac1c64b14a60e6037a444d05f3fa..588c4cb056ed69124d7f9ef95d54341ba4ab8049 100644 (file)
@@ -114,7 +114,7 @@ uint16_t skipjack_g_inv(uint16_t g, uint8_t k, uint8_t *key){
 
 /*****************************************************************************/
 static
-void skipjack_a(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_a(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[0];
        w[0] = w[1];
@@ -125,7 +125,7 @@ void skipjack_a(uint16_t* w, uint8_t k, uint8_t* key){
 
 /*****************************************************************************/
 static
-void skipjack_a_inv(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_a_inv(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[3] ^ w[2];
        w[3] = skipjack_g_inv(w[2],k,key);
@@ -136,7 +136,7 @@ void skipjack_a_inv(uint16_t* w, uint8_t k, uint8_t* key){
 
 /*****************************************************************************/
 static
-void skipjack_b(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_b(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[3];
        w[3] = w[0];
@@ -147,7 +147,7 @@ void skipjack_b(uint16_t* w, uint8_t k, uint8_t* key){
 
 /*****************************************************************************/
 static
-void skipjack_b_inv(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_b_inv(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[1];
        w[1] = w[0];
@@ -161,7 +161,7 @@ void skipjack_b_inv(uint16_t* w, uint8_t k, uint8_t* key){
  * block is 64 bits (=8 bytes) in size, key is 80 bits (=10 bytes) in size.
  * 
  */
-void skipjack_enc(void* block, void* key){
+void skipjack_enc(void *block, void *key){
        uint8_t k;
        for(k=0; k<32; ++k){
                if(k & 0x08){
@@ -176,7 +176,7 @@ void skipjack_enc(void* block, void* key){
  * block is 64 bits (=8 bytes) in size, key is 80 bits (=10 bytes) in size.
  * 
  */
-void skipjack_dec(void* block, void* key){
+void skipjack_dec(void *block, void *key){
        int8_t k;
        for(k=31; k>=0; --k){
                if(k & 0x08){
index 00f033d677f3d493e9e8d9a522b3c621c4d2e839..9aee2c400c4a2c22903828d2987baead3987e6df 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <stdint.h>
 
-/** \fn void skipjack_enc(void* block, void* key)
+/** \fn void skipjack_enc(void *block, void *key)
  * \brief skipjack encryption function
  * 
  * This function encrypts a block of plaintext with the Skipjac encryption
@@ -40,9 +40,9 @@
  * \param block pointer to the 64 bit (8 byte) block to encrypt
  * \param key   pointer to the 80 bit (10 byte) key 
  */
-void skipjack_enc(void* block, void* key);
+void skipjack_enc(void *block, void *key);
 
-/** \fn void skipjack_dec(void* block, void* key)
+/** \fn void skipjack_dec(void *block, void *key)
  * \brief skipjack decryption function
  * 
  * This function decrypts a block of ciphertext encrypted with the Skipjac
@@ -51,6 +51,6 @@ void skipjack_enc(void* block, void* key);
  * \param block pointer to the 64 bit (8 byte) block to decrypt
  * \param key   pointer to the 80 bit (10 byte) key 
  */
-void skipjack_dec(void* block, void* key);
+void skipjack_dec(void *block, void *key);
 
 #endif /*SKIPJACK_H_*/
index cb9e61626d85f5b8f97dc02b4e37a506c3c7829e..440c825903447a0dd13b9bdfba1d55aeb29631c8 100644 (file)
@@ -109,7 +109,7 @@ uint16_t skipjack_g_inv(uint16_t g, uint8_t k, uint8_t *key){
 
 /*****************************************************************************/
 
-void skipjack_a(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_a(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
 
        t = w[3];
@@ -121,7 +121,7 @@ void skipjack_a(uint16_t* w, uint8_t k, uint8_t* key){
 
 /*****************************************************************************/
 
-void skipjack_a_inv(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_a_inv(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[0] ^ w[1];
        w[0] = skipjack_g_inv(w[1],k,key);
@@ -132,7 +132,7 @@ void skipjack_a_inv(uint16_t* w, uint8_t k, uint8_t* key){
 
 /*****************************************************************************/
 
-void skipjack_b(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_b(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[0];
        w[0] = w[3];
@@ -143,7 +143,7 @@ void skipjack_b(uint16_t* w, uint8_t k, uint8_t* key){
 
 /*****************************************************************************/
 
-void skipjack_b_inv(uint16_t* w, uint8_t k, uint8_t* key){
+void skipjack_b_inv(uint16_t *w, uint8_t k, uint8_t *key){
        uint16_t t;
        t = w[2];
        w[2] = w[3];
@@ -158,7 +158,7 @@ void skipjack_b_inv(uint16_t* w, uint8_t k, uint8_t* key){
  * 
  */
 #if NO_FIX
-void skipjack_enc(void* block, void* key){
+void skipjack_enc(void *block, void *key){
        uint8_t k;
        for(k=0; k<32; ++k){
                if(k & 0x08){
@@ -169,7 +169,7 @@ void skipjack_enc(void* block, void* key){
        }
 }
 #else
-void skipjack_enc(void* block, void* key){
+void skipjack_enc(void *block, void *key){
        uint8_t k;
        uint8_t buffer[8], local_key[10];
        for(k=0; k<8; ++k){
@@ -196,7 +196,7 @@ void skipjack_enc(void* block, void* key){
  * 
  */
 #if NO_FIX
-void skipjack_dec(void* block, void* key){
+void skipjack_dec(void *block, void *key){
        int8_t k;
        for(k=31; k>=0; --k){
                if(k & 0x08){
@@ -207,7 +207,7 @@ void skipjack_dec(void* block, void* key){
        }
 }
 #else
-void skipjack_dec(void* block, void* key){
+void skipjack_dec(void *block, void *key){
        int8_t k;
        uint8_t buffer[8], local_key[10];
        for(k=0; k<8; ++k){
index 23ca63e80d36afea66decabb75b79a5b4947e142..0b9a8b778f322658c8b650d8b8edd367f0f0f84d 100644 (file)
@@ -28,8 +28,8 @@ typedef struct {
        uint8_t pattern;
 } stack_measuring_ctx_t;
 
-void stack_measure_init(stack_measuring_ctx_tctx, uint8_t pattern);
-uint16_t stack_measure_final(const stack_measuring_ctx_tctx);
+void stack_measure_init(stack_measuring_ctx_t *ctx, uint8_t pattern);
+uint16_t stack_measure_final(const stack_measuring_ctx_t *ctx);
 /* for testing only
  void stack_measure_usestack(uint16_t size, uint8_t value); */
 
index 56815cc9361f978ae61c15bf5065ee33a81452a4..54f4ef6033d87f2ecb5db0760c086fd9c8237ef2 100644 (file)
@@ -100,7 +100,7 @@ typedef struct {
 } scdesc_t; /* streamcipher descriptor type */
 
 typedef struct{
-       const scdesc_tdesc_ptr;
+       const scdesc_t *desc_ptr;
        uint16_t        keysize;
        uint16_t        ivsize;
        uint16_t        index;
index bf2cbf7fe0019e00d1484181a652381d4f320b49..857602098099d1bbcd13bf94244675b50440101d 100644 (file)
@@ -24,7 +24,7 @@
  * 
  */
 
-/** \fn stridentcnt_P(chara, PGM_P b)
+/** \fn stridentcnt_P(char *a, PGM_P b)
  * \brief counts the number of identic chars
  * 
  * This function compares the supplyed strings and returns the index of the 
@@ -33,9 +33,9 @@
  * \param b pointer to string in Flash
  * \return index of the first char where \c a and \c b differ
  */
-uint16_t stridentcnt_P(chara, PGM_P b);
+uint16_t stridentcnt_P(char *a, PGM_P b);
 
-/** \fn firstword_length(chars)
+/** \fn firstword_length(char *s)
  * \brief compute the length of the first word in supllyed string
  * 
  * This function searches for the first whitespace in the string and returns the
@@ -43,13 +43,13 @@ uint16_t stridentcnt_P(char* a, PGM_P b);
  * \param s string
  * \return number of chars in first word
  */
-uint16_t firstword_length(chars);
+uint16_t firstword_length(char *s);
 
-/** \fn strstrip(charstr)
+/** \fn strstrip(char *str)
  * \brief removes whitespace at the beginning and the end of a string
  * 
  * This function removes whitespaces at the end of a string.
  * \param str sting
  * \return pointer to the first non-whitespace char in string
  */
-char* strstrip(char* str);
+char *strstrip(char *str);
index 199c86a38327cf38292f840b9d48ac9318b1c738..fcd48f45617f52caf7d1980c3464d0d0cad4ee08 100644 (file)
  typedef struct {
         uint8_t buffer_size;
         uint8_t fillcount;
-        uint8_tbuffer;
-        uint8_thead;
-        uint8_ttail;
-        uint8_ttop;
+        uint8_t *buffer;
+        uint8_t *head;
+        uint8_t *tail;
+        uint8_t *top;
 } circularbytebuffer_t;
 */
 
@@ -57,7 +57,7 @@
 
 /******************************************************************************/
 /*
- *     uint8_t circularbytebuffer_init(uint8_t buffersize, circularbytebuffer_tcb){
+ *     uint8_t circularbytebuffer_init(uint8_t buffersize, circularbytebuffer_t *cb){
  *             cb->buffer_size = buffersize;
  *             cb->buffer = malloc(buffersize);
  *             cb->head = cb->tail = cb->buffer;
@@ -105,7 +105,7 @@ circularbytebuffer_init:
 
 /******************************************************************************/
 /*
- *     void circularbytebuffer_free(circularbytebuffer_tcb){
+ *     void circularbytebuffer_free(circularbytebuffer_t *cb){
  *             free(cb->buffer);
  *     }
  *
@@ -124,7 +124,7 @@ circularbytebuffer_free:
 
 /******************************************************************************/
 /*
- *     void circularbytebuffer_init2(uint8_t buffersize, circularbytebuffer_t* cb, void* buffer){
+ *     void circularbytebuffer_init2(uint8_t buffersize, circularbytebuffer_t *cb, void *buffer){
  *             cb->buffer_size = buffersize;
  *             cb->buffer = buffer
  *             cb->head = cb->tail = cb->buffer;
@@ -157,7 +157,7 @@ circularbytebuffer_init2:
 
 /******************************************************************************/
 /*
- *     uint8_t circularbytebuffer_cnt(circularbytebuffer_tcb){
+ *     uint8_t circularbytebuffer_cnt(circularbytebuffer_t *cb){
  *             return (cb->fillcount);
  *     }
  *
@@ -172,7 +172,7 @@ circularbytebuffer_cnt:
        
 /******************************************************************************/
 /*
- *     uint16_t circularbytebuffer_get_lifo(circularbytebuffer_tcb){
+ *     uint16_t circularbytebuffer_get_lifo(circularbytebuffer_t *cb){
  *             uint8_t ret;
  *             if(cb->fillcount==0)
  *                     return 0xffff;
@@ -216,7 +216,7 @@ circularbytebuffer_get_lifo:
 
 /******************************************************************************/
 /*
- *     uint16_t circularbytebuffer_get_fifo(circularbytebuffer_tcb){
+ *     uint16_t circularbytebuffer_get_fifo(circularbytebuffer_t *cb){
  *             uint8_t ret;
  *             if(cb->fillcount==0)
  *                     return 0xffff;
@@ -264,7 +264,7 @@ circularbytebuffer_get_fifo:
 
 /******************************************************************************/
 /*
- *     uint8_t circularbytebuffer_append(uint8_t elem, circularbytebuffer_tcb){
+ *     uint8_t circularbytebuffer_append(uint8_t elem, circularbytebuffer_t *cb){
  *             if(cb->fillcount==cb->buffer_size)
  *                     return 1;
  *             cb->fillcount++;        
@@ -322,7 +322,7 @@ circularbytebuffer_append:
 
 /******************************************************************************/
 /*
- *     uint8_t circularbytebuffer_push(uint8_t elem, circularbytebuffer_tcb){
+ *     uint8_t circularbytebuffer_push(uint8_t elem, circularbytebuffer_t *cb){
  *             if(cb->fillcount==cb->buffer_size)
  *                     return 1;
  *             cb->fillcount++;        
index 9f2900328dfde17a497c214d17288db58473e0dd..917ee2acf6434d3f087383ec72cb0a876bc5e208 100644 (file)
  typedef struct {
         uint8_t buffer_size; /**< holds the amount of bytes which may be stored in the buffer */
         uint8_t fillcount; /**< holds the amount of bytes actually stored in the buffer */
-        uint8_tbuffer; /**< pointer to the actual  buffer */
-        uint8_thead; /**< pointer to the head of the buffer */
-        uint8_ttail; /**< pointer to the tail of the buffer */
-        uint8_ttop; /**< pointer to the last free address in the buffer */
+        uint8_t *buffer; /**< pointer to the actual  buffer */
+        uint8_t *head; /**< pointer to the head of the buffer */
+        uint8_t *tail; /**< pointer to the tail of the buffer */
+        uint8_t *top; /**< pointer to the last free address in the buffer */
 } circularbytebuffer_t;
 
 
@@ -55,7 +55,7 @@
  * \param buffersize size of the buffer to allocate
  * \param cb buffer context to be initialized
  */
-uint8_t circularbytebuffer_init(uint8_t buffersize, circularbytebuffer_tcb);
+uint8_t circularbytebuffer_init(uint8_t buffersize, circularbytebuffer_t *cb);
 #endif
 #if CIRCULARBYTEBUFFER_NO_INIT2==0
 /** \brief buffer initialisation without automatic allocation
@@ -66,18 +66,18 @@ uint8_t circularbytebuffer_init(uint8_t buffersize, circularbytebuffer_t* cb);
  * \param cb buffer context to be initialized
  * \param buffer buffer for the storage of data (you are responisble for allocation and freeing)
  */
-void    circularbytebuffer_init2(uint8_t buffersize, circularbytebuffer_t* cb, void* buffer);
+void    circularbytebuffer_init2(uint8_t buffersize, circularbytebuffer_t *cb, void *buffer);
 #endif
 /** \brief
  *
  *
  */
-uint16_t circularbytebuffer_get_lifo(circularbytebuffer_tcb);
-uint16_t circularbytebuffer_get_fifo(circularbytebuffer_tcb);
-uint8_t circularbytebuffer_append(uint8_t, circularbytebuffer_tcb);
-uint8_t circularbytebuffer_push(uint8_t, circularbytebuffer_tcb);
-uint8_t circularbytebuffer_cnt(circularbytebuffer_tcb);
-void circularbytebuffer_free(circularbytebuffer_tcb);
+uint16_t circularbytebuffer_get_lifo(circularbytebuffer_t *cb);
+uint16_t circularbytebuffer_get_fifo(circularbytebuffer_t *cb);
+uint8_t circularbytebuffer_append(uint8_t, circularbytebuffer_t *cb);
+uint8_t circularbytebuffer_push(uint8_t, circularbytebuffer_t *cb);
+uint8_t circularbytebuffer_cnt(circularbytebuffer_t *cb);
+void circularbytebuffer_free(circularbytebuffer_t *cb);
 
 /*@}*/
 #endif /* CIRCULARBYTEBUFFER_H_ */
index 2c572e53e5b31ff0c1be3b692dabb7f9604b78d4..43dcb6c21c0995576ce4a8acbffdcce6ca0c4e1f 100644 (file)
@@ -24,7 +24,7 @@
 /******************************************************************************/
 /* uint16_t max_cmd_length(PGM_VOID_P cmdlist){
        uint16_t t,ret=0;
-       charstr;
+       char *str;
        for(;;){
                str = (char*)pgm_read_word(cmdlist);
                cmdlist = (uint8_t*)cmdlist + CMDLIST_ENTRY_SIZE;
@@ -134,7 +134,7 @@ pecho:
 .asciz "\r\necho is o"
 
 /******************************************************************************/
-/* int8_t search_and_call(charcmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist)
+/* int8_t search_and_call(char *cmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist)
  *    param cmd:          r24:r25
  *    param maxcmdlength: r22:r23
  *    param cmdlist:      r20:r21
@@ -257,7 +257,7 @@ nocommand_str:
 .asciz "\r\ncommand not found, try 'help'"
 
 /******************************************************************************/
-/* void cli_option_listing(charbuffer, PGM_VOID_P cmdlist)
+/* void cli_option_listing(char *buffer, PGM_VOID_P cmdlist)
  *   param buffer:    r24:r25
  *   param cmdlist:   r22:r23
  */
index 032f59b0f6662928dc7c24d550fffc00cffe5003..419ed1ce213eb811670619ec1787846aadbbac7c 100644 (file)
@@ -127,7 +127,7 @@ cli_hexdump2:
        rjmp 1b
 
 /******************************************************************************/
-/* void cli_hexdump_block(const voiddata, uint16_t length, uint8_t indent, uint8_t width)
+/* void cli_hexdump_block(const void *data, uint16_t length, uint8_t indent, uint8_t width)
  *   param data:     r24:r25
  *   param length:   r22:r23
  *   param indent:   r20
index cb3d27103c0df6fc075db3c96e482bcd73a87705..619892a249b02fafd142cc7b3e321b656002b8ba 100644 (file)
@@ -40,10 +40,10 @@ cli_rx_fpt cli_rx = NULL;
 cli_tx_fpt cli_tx = NULL;
 uint8_t    cli_echo = 1;
 
-void     echo_ctrl(chars);
+void     echo_ctrl(char *s);
 uint16_t max_cmd_length(PGM_VOID_P cmdlist);
-int8_t   search_and_call(charcmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist);
-void     cli_option_listing(charbuffer, PGM_VOID_P cmdlist);
+int8_t   search_and_call(char *cmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist);
+void     cli_option_listing(char *buffer, PGM_VOID_P cmdlist);
 void     cli_auto_help(uint16_t maxcmdlength, PGM_VOID_P cmdlist);
 
 typedef void(*str_fpt)(char*);
@@ -51,10 +51,10 @@ typedef void(*str_fpt)(char*);
 #define CLI_BACKSPACE  8
 #define CLI_TABULATOR  9
 
-uint8_t cli_completion(charbuffer, uint16_t maxcmdlength, PGM_VOID_P cmdlist){
+uint8_t cli_completion(char *buffer, uint16_t maxcmdlength, PGM_VOID_P cmdlist){
        uint8_t i=0;
        char ref[maxcmdlength+1];
-       charitemstr;
+       char *itemstr;
        ref[0]='\0';
        /* check if we are behind the first word */
        while(buffer[i]){
@@ -85,7 +85,7 @@ int8_t cmd_interface(PGM_VOID_P cmd_desc){
        uint16_t cli_buffer_index;
        int8_t exit_code;
        uint8_t completion_failed=0;
-       charcli_buffer;
+       char *cli_buffer;
        char c;
        uint16_t maxcmdlength = max_cmd_length(cmd_desc);
        cli_buffer = calloc(1,cli_buffer_size=maxcmdlength+2);
index 70c421072ab1018c8e52fc225adf12f59c218747..e463d2ffa9456cbd7b472812fea42678c0a2b8c6 100644 (file)
@@ -45,7 +45,7 @@ typedef struct {
        PGM_P        cmd_name;      /* string containing the function name */
        PGM_P        cmd_param_str; /* param descriptor string */
        void_fpt     cmd_function;  /* function pointer */
-       cmdoption_toptions;
+       cmdoption_t *options;
 } cmdlist_entry_t;
 
 extern cli_rx_fpt cli_rx;
@@ -57,17 +57,17 @@ extern uint8_t cli_echo;
 void cli_putc(char c);
 uint16_t cli_getc(void);
 uint16_t cli_getc_cecho(void);
-uint8_t cli_getsn(chars, size_t n);
-uint8_t cli_getsn_cecho(chars, uint16_t n);
-void cli_putstr(const chars);
+uint8_t cli_getsn(char *s, size_t n);
+uint8_t cli_getsn_cecho(char *s, uint16_t n);
+void cli_putstr(const char *s);
 void cli_putstr_P(PGM_P s);
 void cli_hexdump_byte(uint8_t byte);
-void cli_hexdump(const voiddata, size_t length);
-void cli_hexdump_rev(const voiddata, size_t length);
-void cli_hexdump2(const voiddata, size_t length);
-void cli_hexdump_block(const voiddata, size_t length, uint8_t indent, uint8_t width);
+void cli_hexdump(const void *data, size_t length);
+void cli_hexdump_rev(const void *data, size_t length);
+void cli_hexdump2(const void *data, size_t length);
+void cli_hexdump_block(const void *data, size_t length, uint8_t indent, uint8_t width);
 
-void echo_ctrl(chars);
+void echo_ctrl(char *s);
 int8_t cmd_interface(PGM_VOID_P cmd_desc);
 
 
index 64bfd0b86d7cc27758a8f8c8d11566a1352b4fe8..c86380f66d36e2a8ca4260e0b6739890e407309d 100644 (file)
@@ -54,7 +54,7 @@ bcdesc_t** cmacvs_algolist=NULL;
 void cmacvs_listalgos(void){
        char option = 'a';
 
-       bcdesc_tt;
+       bcdesc_t *t;
        uint8_t i=0;
        cli_putstr_P(PSTR("\r\nthe following algorithms are available:\r\n"));
        while(option<='z' && (t=(bcdesc_t*)pgm_read_word(&(cmacvs_algolist[i])))){
@@ -68,7 +68,7 @@ void cmacvs_listalgos(void){
        }
 }
 
-void cmacvs_setalgo(charparam){
+void cmacvs_setalgo(char *param){
        param = strstrip(param);
        if(param[1]=='\0'){ /* single letter specified */
                uint8_t i,option = param[0]-'a';
@@ -85,7 +85,7 @@ void cmacvs_setalgo(char* param){
                }
                cmacvs_algo=(bcdesc_t*)pgm_read_word(&(cmacvs_algolist[option]));
        } else { /* name specifyed */
-               bcdesc_tt=NULL;
+               bcdesc_t *t=NULL;
                uint8_t i=0;
                while((t=(bcdesc_t*)pgm_read_word(&(cmacvs_algolist[i]))) &&
                       strcasecmp_P(param, (void*)pgm_read_word(&(t->name))))
@@ -105,7 +105,7 @@ typedef struct {
        uint16_t buffersize_B;
        uint32_t blocks;
        bcal_cmac_ctx_t ctx;
-       uint8_tbuffer;
+       uint8_t *buffer;
        uint8_t  in_byte;
 } cmacvs_ctx_t;
 
@@ -148,7 +148,7 @@ uint8_t buffer_add(char c){
 int32_t getValue_P(PGM_P key){
        uint32_t val=0;
        char instr[21];
-       charstr2;
+       char *str2;
        for(;;){
                memset(instr, 0, 21);
                cli_getsn_cecho(instr, 20);
@@ -173,7 +173,7 @@ int32_t getValue_P(PGM_P key){
        return -2;
 }
 
-uint8_t getKey(voidkey_buffer, uint8_t klen_B){
+uint8_t getKey(void *key_buffer, uint8_t klen_B){
        char c;
        uint8_t v,i=0;
        memset(key_buffer, 0x00, klen_B);
@@ -213,7 +213,7 @@ uint8_t getKey(void* key_buffer, uint8_t klen_B){
        return 0;
 }
 
-uint8_t getMac(voidmac_buffer, uint8_t mlen_B){
+uint8_t getMac(void *mac_buffer, uint8_t mlen_B){
        char c;
        uint8_t v,i=0;
        memset(mac_buffer, 0x00, mlen_B);
index f436275d150f63dbec8b60abf7528aef82bdbb9a..599e4b73ea1ab52fe9d5fa0e2fb5062094e108bb 100644 (file)
@@ -34,7 +34,7 @@ extern bcdesc_t*  cmacvs_algo;
 extern bcdesc_t** cmacvs_algolist;
 
 void cmacvs_listalgos(void);
-void cmacvs_setalgo(charparam);
+void cmacvs_setalgo(char *param);
 void cmacvs_test1(void);
 void cmacvs_test2(void);
 
index 436bf8c151b72c145b115bfbb223be7fa37bebb8..2c3d1c68ee0bd9c5348d8dd68d39d531dc0554fe 100644 (file)
@@ -33,7 +33,7 @@
  
 /******************************************************************************/
 
-uint8_t dbz_strcount(const charstr){
+uint8_t dbz_strcount(const char *str){
        uint8_t ret=1;
        if(*str=='\0' && *(str+1)=='\0')
                        return 0;
@@ -48,7 +48,7 @@ uint8_t dbz_strcount(const char* str){
 
 /******************************************************************************/
 
-void dbz_splitup(chardbzstr, char** strings){
+void dbz_splitup(char *dbzstr, char** strings){
        if(*dbzstr=='\0' && *(dbzstr+1)=='\0')
                return;
        *strings++ = dbzstr;
@@ -78,7 +78,7 @@ uint8_t dbz_strcount_P(PGM_P str){
 
 /******************************************************************************/
 
-void dbz_splitup_P(PGM_P dbzstr, PGM_Pstrings){
+void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings){
        if(pgm_read_byte(dbzstr)=='\0' && pgm_read_byte(dbzstr+1)=='\0')
                return;
        *strings++ = dbzstr;
index 76c8b75f8597a99aff29f901eda1be12ee98474a..a1bc8d1f22cd5f2611acb6777dddb7c258d3964b 100644 (file)
 #include <stdint.h>
 #include <avr/pgmspace.h>
 
-/** \fn uint8_t dbz_strcount(const charstr)
+/** \fn uint8_t dbz_strcount(const char *str)
  * \brief count stings in dbz-terminated string
  * 
  * Count the single zero terminated strings in a 
  * double terminated string
  * \param str pointer to the double-zero-terminated string
  */
-uint8_t dbz_strcount(const charstr);
+uint8_t dbz_strcount(const char *str);
 
-/** \fn void dbz_splitup(chardbzstr, char** strings)
+/** \fn void dbz_splitup(char *dbzstr, char** strings)
  * \brief split up a dbz-terminated string
  * 
  * Fills an array with pointers to the single terminated string
@@ -51,7 +51,7 @@ uint8_t dbz_strcount(const char* str);
  * \param dbzstr pointer to the double-zero-terminated string
  * \param strings pointer to the array of strings (char pointers)
  */
-void dbz_splitup(chardbzstr, char** strings);
+void dbz_splitup(char *dbzstr, char** strings);
 
 /** \fn uint8_t dbz_strcount_P(PGM_P str)
  * \brief count stings in dbz-terminated string in flash
@@ -62,7 +62,7 @@ void dbz_splitup(char* dbzstr, char** strings);
  */
 uint8_t dbz_strcount_P(PGM_P str);
 
-/** \fn void dbz_splitup_P(PGM_P dbzstr, PGM_Pstrings)
+/** \fn void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings)
  * \brief split up a dbz-terminated string in flash
  * 
  * Fills an array with pointers (PGM_P) to the single terminated string
@@ -70,6 +70,6 @@ uint8_t dbz_strcount_P(PGM_P str);
  * \param dbzstr  pointer to the double-zero-terminated string in flash
  * \param strings pointer to the array of strings (PGM_P)
  */
-void dbz_splitup_P(PGM_P dbzstr, PGM_Pstrings);
+void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings);
 
 #endif /*DBZ_STRINGS_H_*/
index 65264795c00526edfa9f467fcafe525e4a7ba318..797fd2e4cecce4ea3a0991ad44f6ef785e449913 100644 (file)
@@ -47,7 +47,7 @@
        uart0_putc(c);
  }
 
- void debug_str(chars){
+ void debug_str(char *s){
        while (*s)
                debug_char(*s++);
  }
index 26f04bd4e8bf93a5a66e97e7db359c81db4a4502..971365a96d309daa227e0fc9e8f3050d71b0a454 100644 (file)
@@ -43,7 +43,7 @@ charisinstr_P:
        ret
        
 /******************************************************************************/
-/* void dump_chars(uint8_tbuffer, uint8_t len)
+/* void dump_chars(uint8_t *buffer, uint8_t len)
  *   param buffer:  r24:r25
  *   param len:     r22
  */
@@ -130,7 +130,7 @@ print_aligned:
        ret 
 
  /*****************************************************************************/
- /* void dump(chars)
+ /* void dump(char *s)
   *    param s: r24:r25
   */
 
@@ -354,7 +354,7 @@ suffix:
 .byte 0
 
 /******************************************************************************/
-/* void pgm_read_block(voidbuffer, uint32_t addr, uint8_t length)
+/* void pgm_read_block(void *buffer, uint32_t addr, uint8_t length)
  *   param buffer:  r24:r25
  *   param addr:    r20:r23
  *   param length:  r18
@@ -390,7 +390,7 @@ pgm_read_block:
 #endif 
        
 /******************************************************************************/
-/* void ram_read_block(voidbuffer, uint32_t addr, uint8_t length)
+/* void ram_read_block(void *buffer, uint32_t addr, uint8_t length)
  *   param buffer:  r24:r25
  *   param addr:    r20:r23
  *   param length:  r18
@@ -410,7 +410,7 @@ ram_read_block:
        ret
 
 /******************************************************************************/
-/* void ee_read_block(voidbuffer, uint32_t addr, uint8_t length)
+/* void ee_read_block(void *buffer, uint32_t addr, uint8_t length)
  *   param buffer:  r24:r25
  *   param addr:    r20:r23
  *   param length:  r18
index 984b8bd5d7dd22bd74aa4bd9a3f91d90fa282360..ba74727f3daad81337454efa012919af4300e210 100644 (file)
@@ -36,9 +36,9 @@
  
 #define DUMP_WIDTH 16
 
-void pgm_read_block(voidbuffer, uint32_t addr, uint8_t length);
-void ee_read_block(voidbuffer, uint32_t addr, uint8_t length);
-void ram_read_block(voidbuffer, uint32_t addr, uint8_t length);
+void pgm_read_block(void *buffer, uint32_t addr, uint8_t length);
+void ee_read_block(void *buffer, uint32_t addr, uint8_t length);
+void ram_read_block(void *buffer, uint32_t addr, uint8_t length);
 
 const char flash_trigger[]  PROGMEM = "fF";
 const char ram_trigger[]    PROGMEM = "sSrRmM";
@@ -61,4 +61,4 @@ memtype_desc_t memtype_desc[] PROGMEM = {
        { NULL,            NULL,            NULL        }
 };
 
-void dump(chars);
+void dump(char *s);
index 0561b4e61cfaa4915a7757fb5d5b49dec68b5810..2f43dc223134e301e3a00a12493f2e17a3e08c5c 100644 (file)
@@ -37,6 +37,6 @@
  
 #define DUMP_WIDTH 16
 
-void dump(chars);
+void dump(char *s);
 
 #endif /* DUMP_H_ */
index 6addf1aa8ee5fb44ff442b61b7e5bd1e7d8d4120..d9d6abcf65db7dc130dcb8c5e753f412b77cab03 100644 (file)
 #include "A5_1.h"
 #include "nessie_stream_test.h"
 
-charalgo_name = "A5_1";
+char *algo_name = "A5_1";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void a51_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
+void a51_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){
        a5_1_init(ctx,key, keysize, NULL, 0);
 }
 
index 67e928e1703d4dbfaf55bed433eb6be81dc378f7..92ac560410489f5081b9bc9e0f1df79b7f73bba0 100644 (file)
@@ -40,9 +40,9 @@
 #include "bcal-performance.h"
 #include "bcal-nessie.h"
 
-const charalgo_name = "AES";
+const char *algo_name = "AES";
 
-const bcdesc_tconst const algolist[] PROGMEM = {
+const bcdesc_t *const const algolist[] PROGMEM = {
        (bcdesc_t*)&aes128_desc,
        (bcdesc_t*)&aes192_desc,
        (bcdesc_t*)&aes256_desc,
index 89df1c71d6246f7c7f542b642b541c54b25466b8..eb2e63e56dd870a4735aa3ed58749972263a48d2 100644 (file)
 #include "scal-basic.h"
 #include "scal-nessie.h"
 
-charalgo_name = "Arcfour";
+char *algo_name = "Arcfour";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void arcfour_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
+void arcfour_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){
        arcfour_init(key, (uint8_t)((keysize+7)/8), ctx);
 }
 
index 9a1e4611a6305308557a3c9c1d912b533cf474a2..894179b3ccc45e454067adaa36a53895487d32f4 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "performance_test.h"
 
-charalgo_name = "Base64";
+char *algo_name = "Base64";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index b757f28f342e42882b02f871ecbfe0a414dd63d5..21ab09c758363fd8be7fc1df4d930f8475cb38fe 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "performance_test.h"
 
-charalgo_name = "BigInt";
+char *algo_name = "BigInt";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index c15dad5b03469b27f24baf91bfb02e2d8abeea4f..941a57a4bc6db7eef10b19d5b4e4df9238ebfba6 100644 (file)
@@ -34,9 +34,9 @@
 #include "nessie_hash_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Blake";
+char *algo_name = "Blake";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&blake224_desc,
        (hfdesc_t*)&blake256_desc,
        (hfdesc_t*)&blake384_desc,
@@ -51,19 +51,19 @@ const hfdesc_t* const algolist[] PROGMEM = {
 void testrun_nessie_blake(void){
        hfal_nessie_multiple(algolist);
 }
-void blake224_test(voidmsg, uint32_t length_b){
+void blake224_test(void *msg, uint32_t length_b){
        hfal_test(&blake224_desc, msg, length_b);
 }
 
-void blake256_test(voidmsg, uint32_t length_b){
+void blake256_test(void *msg, uint32_t length_b){
        hfal_test(&blake256_desc, msg, length_b);
 }
 
-void blake384_test(voidmsg, uint32_t length_b){
+void blake384_test(void *msg, uint32_t length_b){
        hfal_test(&blake384_desc, msg, length_b);
 }
 
-void blake512_test(voidmsg, uint32_t length_b){
+void blake512_test(void *msg, uint32_t length_b){
        hfal_test(&blake512_desc, msg, length_b);
 }
 void testrun_stdtest_blake(void){
index 18d91a68ff3cc891c79fafeb751335b6f60f4a3e..bfa53bc54240eb9bcf3bb58c29e50470ee93d68a 100644 (file)
 #include "hfal-test.h"
 #include "performance_test.h"
 
-charalgo_name = "BlueMidnightWish";
+char *algo_name = "BlueMidnightWish";
 
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&bmw224_desc,
        (hfdesc_t*)&bmw256_desc,
        (hfdesc_t*)&bmw384_desc,
@@ -58,18 +58,18 @@ void testrun_nessie_bmw(void){
        hfal_nessie_multiple(algolist);
 }
 
-void bmw224_test(voidmsg, uint32_t length_b){
+void bmw224_test(void *msg, uint32_t length_b){
        hfal_test(&bmw224_desc, msg, length_b);
 }
 
-void bmw256_test(voidmsg, uint32_t length_b){
+void bmw256_test(void *msg, uint32_t length_b){
        hfal_test(&bmw256_desc, msg, length_b);
 }
-void bmw384_test(voidmsg, uint32_t length_b){
+void bmw384_test(void *msg, uint32_t length_b){
        hfal_test(&bmw384_desc, msg, length_b);
 }
 
-void bmw512_test(voidmsg, uint32_t length_b){
+void bmw512_test(void *msg, uint32_t length_b){
        hfal_test(&bmw512_desc, msg, length_b);
 }
 
@@ -102,8 +102,8 @@ void test507(void){
 }
 
 void testrun_stdtest_bmw(void){
-       charmsg0 = "abc";
-       charmsg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+       char *msg0 = "abc";
+       char *msg1 = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
        bmw224_test(msg0, strlen(msg0)*8);
        bmw224_test(msg1, strlen(msg1)*8);
        bmw256_test(msg0, strlen(msg0)*8);
@@ -114,18 +114,18 @@ void testrun_stdtest_bmw(void){
        bmw512_test(msg1, strlen(msg1)*8);
 }
 
-void bmw256_short_test(voidmsg, uint32_t length_b){
+void bmw256_short_test(void *msg, uint32_t length_b){
        bmw256_test("abc", 3*8);
 }
 
 
 void testshort(void){
-       charmsg0 = "abc";
+       char *msg0 = "abc";
        bmw224_test(msg0, strlen(msg0)*8);
 }
 
 void testlshort(void){
-       charmsg0 = "abc";
+       char *msg0 = "abc";
        bmw384_test(msg0, strlen(msg0)*8);
 }
 
index 39702db4012b67576c41f9f3ac11a22f5f02d22b..5e1246b521ab54f3581ed483952375d313c0b58b 100644 (file)
@@ -29,9 +29,9 @@
 #include "bcal-performance.h"
 #include "bcal-nessie.h"
 
-charalgo_name = "Camellia";
+char *algo_name = "Camellia";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&camellia128_desc,
        NULL
 };
@@ -61,7 +61,7 @@ const uint8_t test_keys[] PROGMEM = {
        0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE
 };
 
-void hexdump128(voiddata){
+void hexdump128(void *data){
        uint8_t i;
        for(i=0; i<16; ++i){
                cli_hexdump(data, 1);
index 76af0848ef0c21ab32aac62517e4f3353842e2e6..d23ba8a3b339f9f8bba6989c8f9934683016b7f2 100644 (file)
@@ -29,9 +29,9 @@
 #include "bcal-nessie.h"
 #include "bcal_cast5.h"
 
-charalgo_name = "cast-128 (cast5)";
+char *algo_name = "cast-128 (cast5)";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&cast5_desc,
        NULL
 };
index 63fd3caf43a0314bdf99d1fe1cce0b4f470a5224..30d49f8d5579f2b050254b5be8ac721efa50d842 100644 (file)
@@ -11,9 +11,9 @@
 #include "bcal-nessie.h"
 #include "bcal_cast6.h"
 
-charalgo_name = "CAST-256";
+char *algo_name = "CAST-256";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&cast6_desc,
        NULL
 };
index b8191f783b95b85ce34847a5d478b154c952fb29..0e96709fe53d61812b667d21f6a586686de9d274 100644 (file)
@@ -29,9 +29,9 @@
 #include "bcal-performance.h"
 #include "bcal_cscipher.h"
 
-charalgo_name = "CS-Cipher";
+char *algo_name = "CS-Cipher";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&cscipher_desc,
        NULL
 };
@@ -40,7 +40,7 @@ const bcdesc_t* const algolist[] PROGMEM = {
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void cscipher_init_dummy(const uint8_t* key, uint16_t keysize_b, void* ctx){
+void cscipher_init_dummy(const uint8_t *key, uint16_t keysize_b, void *ctx){
        cscipher_init(key, ctx);
 }
 
index 5014476a7b13931ed6c13a3fe2acb3f5313e52c2..0d22e07a2e2632d04f8359999bf04f9ab6e20d17 100644 (file)
 #include "hfal-performance.h"
 #include "hfal-test.h"
 
-charalgo_name = "CubeHash";
+char *algo_name = "CubeHash";
 
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&cubehash224_desc,
        (hfdesc_t*)&cubehash256_desc,
        (hfdesc_t*)&cubehash384_desc,
index d85a8303d656b77295d851ec711a66ac3680bdf9..a8029f7fff4946bc54fe9d05e6d28816cca49f18 100644 (file)
@@ -31,9 +31,9 @@
 #include "bcal_tdes.h"
 #include "bcal_tdes2.h"
 
-charalgo_name = "DES";
+char *algo_name = "DES";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&des_desc,
        (bcdesc_t*)&tdes2_desc,
        (bcdesc_t*)&tdes_desc,
@@ -43,12 +43,12 @@ const bcdesc_t* const algolist[] PROGMEM = {
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void testrun_nessie_des(const charparam){
+void testrun_nessie_des(const char *param){
        if(!param){
                bcal_nessie_multiple(algolist);
        }else{
                uint8_t i=0;
-               bcdesc_tptr;
+               bcdesc_t *ptr;
                for(;;){
                        ptr = (bcdesc_t*)pgm_read_word(&algolist[i++]);
                        if(ptr == NULL){
index f3710c0868a39b8b0ac6c9feb5c7b973b9b6c010..1c66a9331c3e7918a56a92ade14389f88986f9a9 100644 (file)
@@ -35,7 +35,7 @@
 #include "base64_enc.h"
 #include "base64_dec.h"
 
-charalgo_name = "DSA";
+char *algo_name = "DSA";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
@@ -47,7 +47,7 @@ void load_fix_dsa(void){
        load_dsa_key_blob(&dsa_ctx);
 }
 
-void dsa_print_item(bigint_ta, PGM_P pstr){
+void dsa_print_item(bigint_t *a, PGM_P pstr){
        uint8_t *p;
        cli_putstr_P(PSTR("\r\n"));
        cli_putstr_P(pstr);
@@ -68,7 +68,7 @@ void dsa_print_item(bigint_t* a, PGM_P pstr){
        cli_hexdump(p, 1);
 }
 
-void dsa_print_signature_b64(dsa_signature_ts){
+void dsa_print_signature_b64(dsa_signature_t *s){
        uint16_t size_r, size_s, size_o, i,j;
        size_r = s->r.length_W +2;
        size_s = s->s.length_W +2;
@@ -92,7 +92,7 @@ void dsa_print_signature_b64(dsa_signature_t* s){
        cli_putstr(b64_b);
 }
 
-void dsa_print_ctx(dsa_ctx_tctx){
+void dsa_print_ctx(dsa_ctx_t *ctx){
        dsa_print_item(&(ctx->priv), PSTR("private"));
        dsa_print_item(&(ctx->pub), PSTR("public"));
        dsa_print_item(&(ctx->domain.p), PSTR("P"));
@@ -100,7 +100,7 @@ void dsa_print_ctx(dsa_ctx_t* ctx){
        dsa_print_item(&(ctx->domain.g), PSTR("G"));
 }
 
-void dsa_print_signature(const dsa_signature_tsig){
+void dsa_print_signature(const dsa_signature_t *sig){
        cli_putstr_P(PSTR("\r\nDSA-Signature:\r\n r:"));
        bigint_print_hex(&(sig->r));
        cli_putstr_P(PSTR("\r\n s:"));
index f5b0db3ee648bfe90e447c46f8b77f1c0abebbd7..7aa1e308ff1414e01d973e8a6f27dd9aa3c1b7d4 100644 (file)
@@ -45,7 +45,7 @@
 #include "base64_enc.h"
 #include "base64_dec.h"
 
-charalgo_name = "ECDSA";
+char *algo_name = "ECDSA";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
@@ -95,7 +95,7 @@ uint8_t convert_hex_to_byte(char a, char b){
     return (convert_hexchar_to_value(a) << 4) | convert_hexchar_to_value(b);
 }
 
-void *hash_message(hfdesc_thash_function){
+void *hash_message(hfdesc_t *hash_function){
     uint8_t *block, *hash_value;
     uint16_t index = 0;
     hfgen_ctx_t ctx;
@@ -642,7 +642,7 @@ const uint8_t ecdsa_test_1_k[] PROGMEM = {
     0x83, 0x07, 0xa1, 0x43, 0x70, 0xbc, 0x0a, 0xcb
 };
 
-void hash_mem_P(const hfdesc_t* hfdesc, void* dest, const void* msg, uint16_t msg_len_b){
+void hash_mem_P(const hfdesc_t *hfdesc, void *dest, const void *msg, uint16_t msg_len_b){
     uint16_t blocksize = hfal_hash_getBlocksize(hfdesc);
     uint8_t block[blocksize / 8];
     hfgen_ctx_t ctx;
index ff2d7a3a7b990157c87fa9b929b88181ce815454..878946f3b007b782c02ba894965557faa9d3a604 100644 (file)
 #include "hfal-performance.h"
 #include "hfal-test.h"
 
-charalgo_name = "Echo";
+char *algo_name = "Echo";
 
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&echo224_desc,
        (hfdesc_t*)&echo256_desc,
        (hfdesc_t*)&echo384_desc,
index 687f40b992fd5ccafeb2e11a46199dae3e452b23..812d2134683d4b54faa2463087381a71ead27aea 100644 (file)
@@ -27,7 +27,7 @@
 #include "nessie_bc_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Entropium";
+char *algo_name = "Entropium";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index 99ab49380e895e0928ab3cd581f657fb90fa174e..3e8bd7a853f73e14a3216b9bf6ce7ed2639ffcc7 100644 (file)
 #include "scal-nessie.h"
 #include "performance_test.h"
 
-charalgo_name = "Grain";
+char *algo_name = "Grain";
 
 /*****************************************************************************
  *  additional validation-functions                                          *
  *****************************************************************************/
-void grain_genctx_dummy(uint8_t* key, uint16_t keysize_b, void* ctx){
+void grain_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
        uint8_t iv[8]={0};
        grain_init(key, &iv, ctx);
 }
 
-uint8_t grain_getbyte_dummy(grain_ctx_tctx){
+uint8_t grain_getbyte_dummy(grain_ctx_t *ctx){
        uint8_t i,ret=0;
        for(i=0; i<8; ++i){
                ret<<=1;
@@ -48,7 +48,7 @@ uint8_t grain_getbyte_dummy(grain_ctx_t* ctx){
        return ret;
 }
 
-uint8_t grain_getbyte_dummy_rev(grain_ctx_tctx){
+uint8_t grain_getbyte_dummy_rev(grain_ctx_t *ctx){
        uint8_t i,ret=0;
        for(i=0; i<8; ++i){
                ret >>= 1;
index 0c7b0b3b1fa6dc3e253e4be30a0d49d1ed012d52..4122e3376f7c4dcabcd94ec729118422a12960cd 100644 (file)
 #include "nessie_hash_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Groestl";
+char *algo_name = "Groestl";
 
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&groestl224_desc,
        (hfdesc_t*)&groestl256_desc,
        (hfdesc_t*)&groestl384_desc,
@@ -52,19 +52,19 @@ const hfdesc_t* const algolist[] PROGMEM = {
 void testrun_nessie_groestl(void){
        hfal_nessie_multiple(algolist);
 }
-void groestl224_test(voidmsg, uint32_t length_b){
+void groestl224_test(void *msg, uint32_t length_b){
        hfal_test(&groestl224_desc, msg, length_b);
 }
 
-void groestl256_test(voidmsg, uint32_t length_b){
+void groestl256_test(void *msg, uint32_t length_b){
        hfal_test(&groestl256_desc, msg, length_b);
 }
 
-void groestl384_test(voidmsg, uint32_t length_b){
+void groestl384_test(void *msg, uint32_t length_b){
        hfal_test(&groestl384_desc, msg, length_b);
 }
 
-void groestl512_test(voidmsg, uint32_t length_b){
+void groestl512_test(void *msg, uint32_t length_b){
        hfal_test(&groestl512_desc, msg, length_b);
 }
 
index 410592c90f7dc8c9f23ee44fb4e3ce462e1c465b..d5d6d3d7e9e6b8491266d57656a4ea3677ebd266 100644 (file)
@@ -27,7 +27,7 @@
 #include "hmac-md5.h"
 #include "nessie_mac_test.h"
 
-charalgo_name = "HMAC-MD5";
+char *algo_name = "HMAC-MD5";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
@@ -87,7 +87,7 @@ void hmacmd5_interactive(void){
        cli_hexdump(hmac, HMAC_MD5_BYTES);
 }
 
-void strhexdump(char* dest, void* src, uint16_t length){
+void strhexdump(char *dest, void *src, uint16_t length){
        char table[] = { '0', '1', '2', '3', 
                         '4', '5', '6', '7', 
                                         '8', '9', 'a', 'b', 
index c8e671016bc48133b35105b5af3f57c9787eda40..0cf9a1baab6cfb6bc56caa490972922523edb573 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "nessie_mac_test.h"
 
-charalgo_name = "HMAC-SHA1";
+char *algo_name = "HMAC-SHA1";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index 3e7f51e73d127df48972dfd493f301a331dd0625..1aad96676ea03e5a1c87b548cb6059f01a22dccd 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "nessie_mac_test.h"
 
-charalgo_name = "HMAC-SHA256";
+char *algo_name = "HMAC-SHA256";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index f29a6964deac7ecfa3ed243142d028ad3e667536..a54e913a21d1e6d61f554c9ab5ae4f62ffa66749 100644 (file)
 #include "nessie_hash_test.h"
 #include "performance_test.h"
 
-charalgo_name = "JH";
+char *algo_name = "JH";
 
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&jh224_desc,
        (hfdesc_t*)&jh256_desc,
        (hfdesc_t*)&jh384_desc,
index 127cb62d130297d4cb538ef586b034df768aae4f..ab5f9a29e062e6ecbbbf38cba457647da0b463c8 100644 (file)
 #include "hfal-performance.h"
 #include "hfal-test.h"
 
-charalgo_name = "Keccak";
+char *algo_name = "Keccak";
 
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&keccak224_desc,
        (hfdesc_t*)&keccak256_desc,
        (hfdesc_t*)&keccak384_desc,
index 859e71513b5e065743b324acf1b52fc1faef00e8..84e6086ba25a44cacf447e833767f410604407fe 100644 (file)
@@ -28,9 +28,9 @@
 #include "bcal-nessie.h"
 #include "bcal_khazad.h"
 
-charalgo_name = "Khazad";
+char *algo_name = "Khazad";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&khazad_desc,
        NULL
 };
index a4054c9add65453b55657fc11dce873d082b2156..afb0ab0689a519f89f1b722f76456c8f585a8ad6 100644 (file)
@@ -29,9 +29,9 @@
 #include "hfal_md5.h"
 #include "hfal-performance.h"
 
-charalgo_name = "MD5";
+char *algo_name = "MD5";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&md5_desc,
        NULL
 };
@@ -40,7 +40,7 @@ const hfdesc_t* const algolist[] PROGMEM = {
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void md5_ctx2hash_dummy(void* buffer, void* ctx){
+void md5_ctx2hash_dummy(void *buffer, void *ctx){
        memcpy(buffer, ctx, 16);
 }
 
@@ -77,7 +77,7 @@ void testrun_nessie_md5(void){
 
 void testrun_md5(void){
        md5_hash_t hash;
-       chartestv[]={
+       char *testv[]={
                "", 
                "a", 
                "abc", 
index 927680a2e8fac890073eac9a1a29bb6a6ab7623c..1da8b4d6c78eef0f312f7d3cc34bed7d8a31465d 100644 (file)
@@ -11,7 +11,7 @@
 #include "scal-basic.h"
 #include "scal-nessie.h"
 
-charalgo_name = "Mickey128";
+char *algo_name = "Mickey128";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index 56c168e555be4f0700465efe239703323e099ca5..5e889d548db39806fa66f824db618bc70f6a1a14 100644 (file)
@@ -29,7 +29,7 @@
 #include "performance_test.h"
 #include "stack_measuring.h"
 
-charalgo_name = "MQQ160-sign";
+char *algo_name = "MQQ160-sign";
 
 
 /*****************************************************************************
index a741cc00c10e6fd99acb31aebd5368785defd292..2f1a213f8a4f01ef521459396215ae5753985c35 100644 (file)
@@ -27,7 +27,7 @@
 #include "nessie_stream_test.h"
 #include "performance_test.h"
 
-charalgo_name = "MUGI";
+char *algo_name = "MUGI";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index 95664b0fe1b894da44eb087cfd138082969d4ee2..99362ed31b2530295b4f38eb8ea7ab446fe3983d 100644 (file)
@@ -29,9 +29,9 @@
 #include "bcal-performance.h"
 #include "bcal_noekeon.h"
 
-charalgo_name = "Noekeon";
+char *algo_name = "Noekeon";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&noekeon_direct_desc,
        (bcdesc_t*)&noekeon_indirect_desc,
        NULL
@@ -45,7 +45,7 @@ void testrun_nessie_noekeon(void){
 }
 
 
-void testrun_stdtest_rundirect(void* data, void* key){
+void testrun_stdtest_rundirect(void *data, void *key){
        cli_putstr_P(PSTR("\r\n                     "));
        cli_putstr_P(PSTR("k = "));
        cli_hexdump(key,16);
@@ -64,7 +64,7 @@ void testrun_stdtest_rundirect(void* data, void* key){
        cli_putstr_P(PSTR("\r\n"));
 }
 
-void testrun_stdtest_runindirect(void* data, void* key){
+void testrun_stdtest_runindirect(void *data, void *key){
        noekeon_ctx_t ctx;
        cli_putstr_P(PSTR("\r\n                     "));
        cli_putstr_P(PSTR("k = "));
index fae8b35bb833168d64e039d339f21057d9dcb927..503c886ffaf7c4333a2e536ed1a585fedfff105a 100644 (file)
 #include "nessie_mac_test.h"
 #include "performance_test.h"
 
-charalgo_name = "OMAC-Noekeon";
+char *algo_name = "OMAC-Noekeon";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void test_mac(void* key, void* data, uint16_t datalength_b){
+void test_mac(void *key, void *data, uint16_t datalength_b){
        uint8_t mac[16];
        cli_putstr_P(PSTR("\r\n-----------\r\n msg length (bit): 0x"));
        cli_hexdump(((uint8_t*)&datalength_b)+1, 1);
@@ -64,16 +64,16 @@ void testrun_test_omac_noekeon(void){
 
 uint8_t stat_key[16];
 
-void omac_noekeon_next_dummy(void* ctx, const void* buffer){
+void omac_noekeon_next_dummy(void *ctx, const void *buffer){
        omac_noekeon_next(buffer, stat_key, ctx);
 }
 
-void omac_noekeon_init_dummy(void* ctx, const void* key, uint16_t keysize_b){
+void omac_noekeon_init_dummy(void *ctx, const void *key, uint16_t keysize_b){
        omac_noekeon_init(ctx);
        memcpy(stat_key, key, 16);
 }
 
-void omac_noekeon_last_dummy(void* ctx, const void* buffer, uint16_t size_b){
+void omac_noekeon_last_dummy(void *ctx, const void *buffer, uint16_t size_b){
        while(size_b>128){
                omac_noekeon_next(buffer, stat_key, ctx);
                size_b -= 128;
@@ -82,7 +82,7 @@ void omac_noekeon_last_dummy(void* ctx, const void* buffer, uint16_t size_b){
        omac_noekeon_last(buffer, size_b, stat_key, ctx);
 }
 
-void omac_noekeon_conv_dummy(void* buffer, void* ctx){
+void omac_noekeon_conv_dummy(void *buffer, void *ctx){
        memcpy(buffer, ctx, 16);
 }
 
index bd20b1e2820af8b5d3767fb7b8f16aa4ab29b09a..226fcf7a4d62c351d9f34be5854503d7791c3286 100644 (file)
@@ -31,9 +31,9 @@
 #include "bcal_present80.h"
 #include "bcal_present128.h"
 
-charalgo_name = "Present";
+char *algo_name = "Present";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&present80_desc,
        (bcdesc_t*)&present128_desc,
        NULL
@@ -45,7 +45,7 @@ void testrun_nessie_present(void){
        bcal_nessie_multiple(algolist);
 }
 
-void testrun_selfenc(uint8_t* key, uint8_t* buffer){
+void testrun_selfenc(uint8_t *key, uint8_t *buffer){
 
        present80_ctx_t ctx;
        cli_putstr_P(PSTR("\r\nkey   : "));
@@ -62,7 +62,7 @@ void testrun_selfenc(uint8_t* key, uint8_t* buffer){
        cli_putstr_P(PSTR("\r\n"));
 }
 
-void testrun_selfenc_128(uint8_t* key, uint8_t* buffer){
+void testrun_selfenc_128(uint8_t *key, uint8_t *buffer){
 
        present128_ctx_t ctx;
        cli_putstr_P(PSTR("\r\nkey   : "));
@@ -78,7 +78,7 @@ void testrun_selfenc_128(uint8_t* key, uint8_t* buffer){
        cli_hexdump(buffer, 8);
        cli_putstr_P(PSTR("\r\n"));
 }
-// void present_key_test(const uint8_tkey);
+// void present_key_test(const uint8_t *key);
 
 
 void testrun_self_present(void){
index 4f66c66702dcb6c85ccdf29fed05c0ca2d421594..46ee61c8d7e1190853409d01ebbe0bbabbd30a06 100644 (file)
 #include "scal-basic.h"
 #include "scal-nessie.h"
 
-const charalgo_name = "Rabbit";
+const char *algo_name = "Rabbit";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void test_vector(void* key, void* iv, const void* ref){
+void test_vector(void *key, void *iv, const void *ref){
        rabbit_ctx_t ctx;
        uint8_t fail=0;
        cli_putstr_P(PSTR("\r\n testing with\r\n key:  "));
index 827a966dc5ffd5552a57e8038798b22af92626af..23e183c04da24c67645172852a0197504457129e 100644 (file)
@@ -30,9 +30,9 @@
 #include "bcal_rc5.h"
 
 #define RC5_ROUNDS 12
-charalgo_name = "RC5-32/12/16";
+char *algo_name = "RC5-32/12/16";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&rc5_desc,
        NULL
 };
@@ -40,7 +40,7 @@ const bcdesc_t* const algolist[] PROGMEM = {
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void rc5_genctx_dummy(uint8_t* key, uint16_t keysize_b, void* ctx){
+void rc5_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
        rc5_init(key, keysize_b, RC5_ROUNDS, ctx);
 }
 
index f486ee3a5469dc277b50745374cd899b4a275fb6..41fb19b5fbb08451fd219b3c64685b4368162255 100644 (file)
 #include "bcal_rc6.h"
 
 #define RC6_ROUNDS 20
-charalgo_name = "RC6-32/20/16";
+char *algo_name = "RC6-32/20/16";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&rc6_desc,
        NULL
 };
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void rc6_genctx_dummy(uint8_t* key, uint16_t keysize_b, void* ctx){
+void rc6_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
        rc6_initl(key, keysize_b, RC6_ROUNDS, ctx);
 }
 
index 5f86ec2b59f3ced81ee52ec238321b9f53100ded..9d6ad40646787e4c07bd4dc9ae8cb509c7aafa7d 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "performance_test.h"
 
-const charalgo_name = "RSAES-OAEP";
+const char *algo_name = "RSAES-OAEP";
 
 #define BIGINT_CEIL(x) ((((x) + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t)) *  sizeof(bigint_word_t))
 #define BIGINT_OFF(x) ((sizeof(bigint_word_t) - (x) % sizeof(bigint_word_t)) % sizeof(bigint_word_t))
@@ -356,7 +356,7 @@ uint8_t convert_nibble(uint8_t c){
 
 const char *block_ignore_string=" \t\r\n,;";
 #define BUFFER_LIMIT 120
-uint16_t read_os(void* dst, uint16_t length, const char* ignore_string){
+uint16_t read_os(void *dst, uint16_t length, const char *ignore_string){
        uint16_t counter = 0;
        uint16_t c;
        uint8_t v, tmp = 0, idx = 0;
@@ -389,7 +389,7 @@ uint16_t read_os(void* dst, uint16_t length, const char* ignore_string){
        return counter;
 }
 
-uint16_t own_atou(const charstr){
+uint16_t own_atou(const char *str){
        uint16_t r=0;
        while(*str && *str >= '0' && *str <= '9'){
                r *= 10;
@@ -398,7 +398,7 @@ uint16_t own_atou(const char* str){
        return r;
 }
 
-uint8_t read_bigint(bigint_t* a, char* prompt){
+uint8_t read_bigint(bigint_t *a, char *prompt){
        uint16_t read_length, actual_length;
        uint8_t off;
        uint8_t *buffer;
@@ -490,7 +490,7 @@ uint8_t read_key_conv(void){
        return r;
 }
 
-uint8_t load_bigint_from_os(bigint_ta, PGM_VOID_P os, uint16_t length_B){
+uint8_t load_bigint_from_os(bigint_t *a, PGM_VOID_P os, uint16_t length_B){
        a->length_W = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
        a->wordv = malloc(BIGINT_CEIL(length_B));
        if(!a->wordv){
index 268c1201709c21b1be29ec83b151ba72def66728..8933b0227867e53d9a7788dfa7eb11f2be3a231e 100644 (file)
@@ -34,7 +34,7 @@
 
 #define DEBUG 1
 
-const charalgo_name = "RSAES-PKCS1V15";
+const char *algo_name = "RSAES-PKCS1V15";
 
 #define BIGINT_CEIL(x) ((((x) + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t)) *  sizeof(bigint_word_t))
 #define BIGINT_OFF(x) ((sizeof(bigint_word_t) - (x) % sizeof(bigint_word_t)) % sizeof(bigint_word_t))
@@ -174,7 +174,7 @@ uint8_t convert_nibble(uint8_t c){
 
 const char *block_ignore_string=" \t\r\n,;";
 #define BUFFER_LIMIT 120
-uint16_t read_os(void* dst, uint16_t length, const char* ignore_string){
+uint16_t read_os(void *dst, uint16_t length, const char *ignore_string){
        uint16_t counter = 0;
        uint16_t c;
        uint8_t v, tmp = 0, idx = 0;
@@ -207,7 +207,7 @@ uint16_t read_os(void* dst, uint16_t length, const char* ignore_string){
        return counter;
 }
 
-uint16_t own_atou(const charstr){
+uint16_t own_atou(const char *str){
        uint16_t r=0;
        while(*str && *str >= '0' && *str <= '9'){
                r *= 10;
@@ -216,7 +216,7 @@ uint16_t own_atou(const char* str){
        return r;
 }
 
-uint8_t read_bigint(bigint_t* a, char* prompt){
+uint8_t read_bigint(bigint_t *a, char *prompt){
        uint16_t read_length, actual_length;
        uint8_t off;
        uint8_t *buffer;
@@ -308,7 +308,7 @@ uint8_t read_key_conv(void){
        return r;
 }
 
-uint8_t load_bigint_from_os(bigint_ta, PGM_VOID_P os, uint16_t length_B){
+uint8_t load_bigint_from_os(bigint_t *a, PGM_VOID_P os, uint16_t length_B){
        a->length_W = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
        a->wordv = malloc(BIGINT_CEIL(length_B));
        if(!a->wordv){
@@ -521,7 +521,7 @@ void load_priv_crt_mono(void){
        }
 }
 
-uint8_t load_bigint_from_os(bigint_ta, PGM_VOID_P os, uint16_t length_B){
+uint8_t load_bigint_from_os(bigint_t *a, PGM_VOID_P os, uint16_t length_B){
        a->length_W = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
        a->wordv = malloc(BIGINT_CEIL(length_B));
        if(!a->wordv){
index fda3cf97b2336eef809338a4f379fd3604907f8e..e3ad8273a630e2885d3ddabc9f3e4f49f35f3e0b 100644 (file)
@@ -27,7 +27,7 @@
 #include "scal-basic.h"
 #include "scal-nessie.h"
 
-charalgo_name = "Salsa20";
+char *algo_name = "Salsa20";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index d8a4ec2b253a81be4f783d52b5fc912940e3c299..ca9dbb9703ccae11182a830060cf60f7c307fbea 100644 (file)
 #include "bcal-nessie.h"
 #include "bcal_seed.h"
 
-charalgo_name = "Seed";
+char *algo_name = "Seed";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&seed_desc,
        NULL
 };
 /*****************************************************************************
  *  additional validation-functions                                          *
  *****************************************************************************/
-void seed_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
+void seed_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){
        seed_init(key, ctx);
 }
 
@@ -62,7 +62,7 @@ void testrun_performance_seed(void){
  *  self tests                                                               *
  *****************************************************************************/
 
-void testencrypt(uint8_t* block, uint8_t* key){
+void testencrypt(uint8_t *block, uint8_t *key){
        seed_ctx_t ctx;
        cli_putstr("\r\n==testy-encrypt==\r\n key:   ");
        cli_hexdump(key,16);
@@ -74,7 +74,7 @@ void testencrypt(uint8_t* block, uint8_t* key){
        cli_hexdump(block,16);
 }
 
-void testdecrypt(uint8_t* block, uint8_t* key){
+void testdecrypt(uint8_t *block, uint8_t *key){
        seed_ctx_t ctx;
        cli_putstr("\r\n==testy-decrypt==\r\n key:   ");
        cli_hexdump(key,16);
index 14d7b07ba64ef7e523b449fda3c6109af070379d..7cbf1514f975944b5417e8a5320d8f7b76498d5c 100644 (file)
@@ -30,9 +30,9 @@
 #include "bcal-nessie.h"
 #include "bcal_serpent.h"
 
-charalgo_name = "Serpent";
+char *algo_name = "Serpent";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&serpent_desc,
        NULL
 };
@@ -40,7 +40,7 @@ const bcdesc_t* const algolist[] PROGMEM = {
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void serpent_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
+void serpent_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){
        serpent_init(key, keysize&0xff, ctx);
 }
 
index 53ca357f6c0ee55d7a337a5ba84aa14c8f04471b..95e003cf20aec1c7db03902aaeadf2b600895b43 100644 (file)
@@ -33,9 +33,9 @@
 #include "hfal_sha1.h"
 #include "dump.h"
 
-charalgo_name = "SHA-1";
+char *algo_name = "SHA-1";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&sha1_desc,
        NULL
 };
index 7b320c446d31ce4382cc6fe279b5f17fea1e9234..e86af0bb410a33956ab6d01ef9b3b2f33784716c 100644 (file)
@@ -40,9 +40,9 @@
 #include "sha512.h"
 #include "hfal_sha512.h"
 
-const charalgo_name = "SHA-2";
+const char *algo_name = "SHA-2";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&sha224_desc,
        (hfdesc_t*)&sha256_desc,
        (hfdesc_t*)&sha384_desc,
index 0aac309d337631655d063481c94ffc64cbe4c959..d6182860039d9f9e71c52560c1890170414935b2 100644 (file)
@@ -35,9 +35,9 @@
 
 #include "dump.h"
 
-charalgo_name = "SHA-256";
+char *algo_name = "SHA-256";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&sha256_desc,
        NULL
 };
index 638f5b793208d3ae248da76070333f770e4e5be8..3140b769df55ee5f85acbeea90e9ed0e063a929f 100644 (file)
@@ -33,9 +33,9 @@
 #include "nessie_hash_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Shabal";
+char *algo_name = "Shabal";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&shabal192_desc,
        (hfdesc_t*)&shabal224_desc,
        (hfdesc_t*)&shabal256_desc,
@@ -47,23 +47,23 @@ const hfdesc_t* const algolist[] PROGMEM = {
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void testrun_stdtest_shabal192(voidmsg, uint16_t size_b){
+void testrun_stdtest_shabal192(void *msg, uint16_t size_b){
        hfal_test(&shabal192_desc, msg, size_b);
 }
 
-void testrun_stdtest_shabal224(voidmsg, uint16_t size_b){
+void testrun_stdtest_shabal224(void *msg, uint16_t size_b){
        hfal_test(&shabal224_desc, msg, size_b);
 }
 
-void testrun_stdtest_shabal256(voidmsg, uint16_t size_b){
+void testrun_stdtest_shabal256(void *msg, uint16_t size_b){
        hfal_test(&shabal256_desc, msg, size_b);
 }
 
-void testrun_stdtest_shabal384(voidmsg, uint16_t size_b){
+void testrun_stdtest_shabal384(void *msg, uint16_t size_b){
        hfal_test(&shabal384_desc, msg, size_b);
 }
 
-void testrun_stdtest_shabal512(voidmsg, uint16_t size_b){
+void testrun_stdtest_shabal512(void *msg, uint16_t size_b){
        hfal_test(&shabal512_desc, msg, size_b);
 }
 
@@ -94,9 +94,9 @@ void testshort(void){
        testrun_stdtest_shabal192(ma, 64*8);
 }
 
-void shabal_ctx_dump(shabal_ctx_tctx){
+void shabal_ctx_dump(shabal_ctx_t *ctx){
        uint8_t i;
-       voidp;
+       void *p;
        cli_putstr_P(PSTR("\r\n=== shabal ctx dump ===\r\n  size = "));
        i=sizeof(shabal_ctx_t);
        if(i>=100)
index 471881eac18c81fb40cb68cbf39e703e71f0d9a9..d35a29cd11926da112b5096e5e315d8d413488e8 100644 (file)
 #include "nessie_bc_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Shabea";
+char *algo_name = "Shabea";
 
 /*****************************************************************************
  *  additional validation-functions                                          *
  *****************************************************************************/
-void shabea_genctx_dummy(uint8_t* key, uint16_t keysize_b, void* ctx){
+void shabea_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
        memcpy(ctx, key, (keysize_b+7)/8);
 }
 
-void shabea_enc_dummy(void* buffer, void* ctx){
+void shabea_enc_dummy(void *buffer, void *ctx){
        shabea256(buffer, ctx, 256, 1, 16);
 }
 
-void shabea_dec_dummy(void* buffer, void* ctx){
+void shabea_dec_dummy(void *buffer, void *ctx){
        shabea256(buffer, ctx, 256, 0, 16);
 }
 
@@ -96,7 +96,7 @@ void testrun_performance_shabea(void){
  *  self tests                                                                                                                          *
  *****************************************************************************/
 
-void testencrypt(uint8_t* block, uint8_t* key){
+void testencrypt(uint8_t *block, uint8_t *key){
        cli_putstr("\r\n==testy-encrypt==\r\n key: ");
        cli_hexdump(key,16);
        cli_putstr("\r\n plain: ");
@@ -106,7 +106,7 @@ void testencrypt(uint8_t* block, uint8_t* key){
        cli_hexdump(block,32);
 }
 
-void testdecrypt(uint8_t* block, uint8_t* key){
+void testdecrypt(uint8_t *block, uint8_t *key){
 
        cli_putstr("\r\n==testy-decrypt==\r\n key: ");
        cli_hexdump(key,16);
index e3267b54d6ed7a2245d1e5f31af28392b8620c4f..464c7e1de578760bf3a34e680e1c75e3ac2210ec 100644 (file)
 #include "nessie_bc_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Shacal1 encryption only";
+char *algo_name = "Shacal1 encryption only";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void shacal1_genctx_dummy(uint8_t* key, uint16_t keysize_b, void* ctx){
+void shacal1_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
        memcpy(ctx, key, (keysize_b+7)/8);
 }
 
-void shacal1_enc_dummy(void* buffer, void* ctx){
+void shacal1_enc_dummy(void *buffer, void *ctx){
        shacal1_enc(buffer, ctx, 512);
 }
 
index bf631ebb29bd2ed3f7352c7e20d4296d5a2ea578..58e77d4141c3ee0a4ee9aa402ca224b406a653e2 100644 (file)
 #include "nessie_bc_test.h"
 #include "performance_test.h"
 
-charalgo_name = "Shacal2 encryption only";
+char *algo_name = "Shacal2 encryption only";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void shacal2_genctx_dummy(uint8_t* key, uint16_t keysize_b, void* ctx){
+void shacal2_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
        memcpy(ctx, key, (keysize_b+7)/8);
 }
 
-void shacal2_enc_dummy(void* buffer, void* ctx){
+void shacal2_enc_dummy(void *buffer, void *ctx){
        shacal2_enc(buffer, ctx, SHACAL2_KEYSIZE);
 }
 
index e38bf878cf54f4678185a45c9262f20599519906..7cd7c0d3246fd70dd0f9b0bc812916dee7261253 100644 (file)
@@ -34,9 +34,9 @@
 #include "hfal-nessie.h"
 #include "hfal-basic.h"
 
-charalgo_name = "Skein";
+char *algo_name = "Skein";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&skein256_128_desc,
        (hfdesc_t*)&skein256_160_desc,
        (hfdesc_t*)&skein256_224_desc,
@@ -181,7 +181,7 @@ void zeromsg_test_skein(uint16_t outsize_b){
        cli_hexdump_block(hash, (outsize_b+7)/8, 4, 16);
 }
 
-void zeromsg_test_common(charp){
+void zeromsg_test_common(char *p){
        uint8_t i;
        uint16_t s=0;
        uint16_t sizes[]={128, 160, 224, 256, 384, 512, 1024};
index 0d2fe022e47a5a16417900bb2ff802e09356fa00..b39eee4dcaa452029bc28864dbfbf97766acc28d 100644 (file)
 #include "bcal-nessie.h"
 #include "bcal_skipjack.h"
 
-charalgo_name = "Skipjack";
+char *algo_name = "Skipjack";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&skipjack_desc,
        NULL
 };
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
-void skipjack_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
+void skipjack_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){
        memcpy(ctx, key, 10);
 }
 
@@ -52,7 +52,7 @@ void testrun_performance_skipjack(void){
        bcal_performance_multiple(algolist);
 }
 
-int test_enc(const void* buffer, void* key){
+int test_enc(const void *buffer, void *key){
        uint8_t data[8];
        int r;
        memcpy(data, buffer, 8);
@@ -104,7 +104,7 @@ void testrun_nist_vectors(void){
  *  self tests                                                                                                                          *
  *****************************************************************************/
 
-void testencrypt(uint8_t* block, uint8_t* key){
+void testencrypt(uint8_t *block, uint8_t *key){
        cli_putstr("\r\n==testy-encrypt==\r\n key: ");
        cli_hexdump(key,10);
        cli_putstr("\r\n plain: ");
@@ -114,7 +114,7 @@ void testencrypt(uint8_t* block, uint8_t* key){
        cli_hexdump(block,8);
 }
 
-void testdecrypt(uint8_t* block, uint8_t* key){
+void testdecrypt(uint8_t *block, uint8_t *key){
        cli_putstr("\r\n==testy-decrypt==\r\n key: ");
        cli_hexdump(key,10);
        cli_putstr("\r\n crypt: ");
index e26cc912d59d20013e1caa3cd5e472959f9b8e2e..29435b9a2c9a9c8c44f73e5fa765b785b90bfa44 100644 (file)
@@ -30,9 +30,9 @@
 #include "bcal_tdes.h"
 #include "bcal_tdes2.h"
 
-charalgo_name = "TDES";
+char *algo_name = "TDES";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&tdes_desc,
        (bcdesc_t*)&tdes2_desc,
        NULL
index f5aed4a03563bfa41fa0282c3f57eb137d298158..2e1be81433825c54256b0a2dc211f5cb886cc6b3 100644 (file)
@@ -20,7 +20,7 @@
 #include "main-test-common.h"
 
 static
-int std_stream_put(char c, FILEf){
+int std_stream_put(char c, FILE *f){
     static uint8_t did_r = 0;
     if(!did_r && c == '\n'){
         uart0_putc('\r');
@@ -31,7 +31,7 @@ int std_stream_put(char c, FILE* f){
 }
 
 static
-int std_stream_get(FILEf){
+int std_stream_get(FILE *f){
     return (int)uart0_getc();
 }
 
@@ -42,7 +42,7 @@ void main_setup(void){
        fdevopen(std_stream_put, std_stream_get);
 }
 
-void welcome_msg(const charalgoname){
+void welcome_msg(const char *algoname){
 /*
     cli_putstr_P(PSTR("\r\n\r\nAVR-Crypto-Lib VS ("));
        cli_putstr(algoname);
index 9c65523d718d007bfd777d8828db37eaa6f2cf82..d1e4cbd3f3798c43c341dc74a87b13cc416f8f0a 100644 (file)
@@ -33,6 +33,6 @@
 #include <avr/pgmspace.h>
 
 void main_setup(void);
-void welcome_msg(const charalgoname);
+void welcome_msg(const char *algoname);
 
 #endif /* MAINTESTCOMMON_H_ */
index a1e0a63596d92b326bb2f476f58e4de7d2e30390..5dea4b773438bab7a21fbc1e0b5e4fde3c9f1f5a 100644 (file)
@@ -32,9 +32,9 @@
 #include "bcal_threefish512.h"
 #include "bcal_threefish1024.h"
 
-charalgo_name = "Threefish";
+char *algo_name = "Threefish";
 
-const bcdesc_tconst algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
        (bcdesc_t*)&threefish256_desc,
        (bcdesc_t*)&threefish512_desc,
        (bcdesc_t*)&threefish1024_desc,
@@ -44,7 +44,7 @@ const bcdesc_t* const algolist[] PROGMEM = {
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void threefish256_dump(threefish256_ctx_tctx){
+void threefish256_dump(threefish256_ctx_t *ctx){
        uint8_t i;
        cli_putstr_P(PSTR("\r\n=== ctx dump (256) === \r\n k: "));
        for(i=0; i<5; ++i){
index bee2710cf82ca8a08d56ab0ac8287334f5a6c435..b131830807d4c7a38602ec1c85094a8f49fb560b 100644 (file)
@@ -29,7 +29,7 @@
 #include "scal-nessie.h"
 #include "performance_test.h"
 
-charalgo_name = "Trivium";
+char *algo_name = "Trivium";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index 6e23154ed378cb2ce3ef71d83d5c8c9fabfa5ac4..b2f11d7048ba43b5d88a28737d10c2ded97d0376 100644 (file)
@@ -37,9 +37,9 @@
 #include "hfal-test.h"
 #include "shavs.h"
 
-charalgo_name = "TWISTER";
+char *algo_name = "TWISTER";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&twister224_desc,
        (hfdesc_t*)&twister256_desc,
        (hfdesc_t*)&twister384_desc,
@@ -60,27 +60,27 @@ void testrun_nessie_twister(void){
  *
  *****************************************************************************/
 
-void test_twister224( voidmsg, uint32_t length_b){
+void test_twister224( void *msg, uint32_t length_b){
        hfal_test(&twister224_desc, msg, length_b);
 }
 
-void test_twister256( voidmsg, uint32_t length_b){
+void test_twister256( void *msg, uint32_t length_b){
        hfal_test(&twister256_desc, msg, length_b);
 }
 
-void test_twister384( voidmsg, uint32_t length_b){
+void test_twister384( void *msg, uint32_t length_b){
        hfal_test(&twister384_desc, msg, length_b);
 }
 
-void test_twister512( voidmsg, uint32_t length_b){
+void test_twister512( void *msg, uint32_t length_b){
        hfal_test(&twister512_desc, msg, length_b);
 }
 
 void testrun_twister(void){
-       const hfdesc_tdesc[4] = { &twister224_desc, &twister256_desc,
+       const hfdesc_t *desc[4] = { &twister224_desc, &twister256_desc,
                                    &twister384_desc, &twister512_desc };
        uint8_t i,j; 
-       chartestv[]={
+       char *testv[]={
                "", 
                "a", 
                "abc", 
index 435b7163fadcc91adf3cc68bd851b348552bbb9c..79ba647314941beaf931d2c4f35208772c18016b 100644 (file)
@@ -26,7 +26,7 @@
 #include "ubi.h"
 #include "performance_test.h"
 
-charalgo_name = "UBI-Threefish";
+char *algo_name = "UBI-Threefish";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
index a044ddf8690e62e7f2c4497590af8d2468be622e..a1811a01e82dd5b77d9151bf529b91ae568d3e46 100644 (file)
@@ -33,9 +33,9 @@
 #include "hfal_whirlpool_0.h"
 #include "dump.h"
 
-charalgo_name = "Whirlpool-0";
+char *algo_name = "Whirlpool-0";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&whirlpool_0_desc,
        NULL
 };
index 0474039997c4a71d89d154829976fdd563ff86e2..c85a9673bb4f382459b9f7b0b01c59a2460d3109 100644 (file)
@@ -34,9 +34,9 @@
 #include "hfal_whirlpool_t.h"
 #include "dump.h"
 
-charalgo_name = "Whirlpool-T";
+char *algo_name = "Whirlpool-T";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&whirlpool_t_desc,
        NULL
 };
index 4d2978b2fb25c9211b7868f26386b8e0147eaa0a..1e1cea3d236a2e8a270d67e00447294725b3b149 100644 (file)
@@ -33,9 +33,9 @@
 #include "hfal_whirlpool.h"
 #include "dump.h"
 
-charalgo_name = "Whirlpool";
+char *algo_name = "Whirlpool";
 
-const hfdesc_tconst algolist[] PROGMEM = {
+const hfdesc_t *const algolist[] PROGMEM = {
        (hfdesc_t*)&whirlpool_desc,
        NULL
 };
index 26a42a3785874530c5a211d10361ce08536df40a..2371e1c0a66e828ca17eba2d79766e9cce51df0b 100644 (file)
@@ -31,9 +31,9 @@
 #include "bcal-nessie.h"
 #include "bcal_xtea.h"
 
-charalgo_name = "XTEA";
+char *algo_name = "XTEA";
 
-const bcdesc_tconst const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const algolist[] PROGMEM = {
+const bcdesc_t *const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const const algolist[] PROGMEM = {
        (bcdesc_t*)&xtea_desc,
        NULL
 };
index 6d55c57f539866533bf4139fa474cc7d7ea054fe..7959f3f90911e70259eacc0ae7793b531ab1b6c1 100644 (file)
@@ -36,12 +36,12 @@ void nessie_bc_init(void){
        memset(&nessie_bc_ctx, 0, sizeof(nessie_bc_ctx_t));     
 }
 static
-void nessie_bc_free(voidctx){
+void nessie_bc_free(void *ctx){
        if(nessie_bc_ctx.cipher_free)
                nessie_bc_ctx.cipher_free(ctx);
 }
 
-void nessie_bc_enc(uint8_t* key, uint8_t* pt){
+void nessie_bc_enc(uint8_t *key, uint8_t *pt){
        uint8_t ctx[nessie_bc_ctx.ctx_size_B];
        uint8_t buffer[nessie_bc_ctx.blocksize_B];
        uint16_t i;
@@ -76,7 +76,7 @@ void nessie_bc_enc(uint8_t* key, uint8_t* pt){
        nessie_bc_free(ctx);
 }
 
-void nessie_bc_dec(uint8_t* key, uint8_t* ct){
+void nessie_bc_dec(uint8_t *key, uint8_t *ct){
        uint8_t ctx[nessie_bc_ctx.ctx_size_B];
        uint8_t buffer[nessie_bc_ctx.blocksize_B];
        
index 350ea4bd637adb6dbdf9d0016c395c2ce5693906..0197b0ec0691cf9d958c3a8ddd24cf3edaa43d98 100644 (file)
 
 #include <stdint.h>
 
-typedef void (*nessie_bc_gen_fpt)(const uint8_t* key, uint16_t keysize_b, void* ctx);
-typedef void (*nessie_bc_free_fpt)(voidctx);
-typedef void (*nessie_bc_enc_fpt)(void* buffer, const void* ctx);
-typedef void (*nessie_bc_dec_fpt)(void* buffer, const void* ctx);
+typedef void (*nessie_bc_gen_fpt)(const uint8_t *key, uint16_t keysize_b, void *ctx);
+typedef void (*nessie_bc_free_fpt)(void *ctx);
+typedef void (*nessie_bc_enc_fpt)(void *buffer, const void *ctx);
+typedef void (*nessie_bc_dec_fpt)(void *buffer, const void *ctx);
 
 typedef struct nessie_bc_ctx_st{
        uint16_t keysize_b;
        uint16_t blocksize_B;
        uint16_t ctx_size_B;
-       charname; 
+       char *name; 
        nessie_bc_gen_fpt  cipher_genctx;
        nessie_bc_free_fpt cipher_free;
        nessie_bc_enc_fpt  cipher_enc;
index 4a8cfbc19ae4a5f9bd18535eff55c131e86ee163..518a5a7219f3889f194f869d10c02a3665b9e5ea 100644 (file)
@@ -35,7 +35,7 @@
 
 #define nessie_out_file stdout
 
-void nessie_set_output_stream(FILEout_stream){
+void nessie_set_output_stream(FILE *out_stream){
     nessie_out_file = out_stream;
 }
 
@@ -51,7 +51,7 @@ void nessie_send_alive_a(uint16_t i){
 }
 #endif
 
-void nessie_print_block(uint8_tblock, uint16_t blocksize_bit){
+void nessie_print_block(uint8_t *block, uint16_t blocksize_bit){
        uint16_t i;
        for(i=0; i<(blocksize_bit+7)/8; ++i){
                putc(pgm_read_byte(hexdigit_tab_uc_P + ((block[i]) >>   4)), nessie_out_file);
@@ -62,7 +62,7 @@ void nessie_print_block(uint8_t* block, uint16_t blocksize_bit){
 #define SPACES 31
 #define BYTESPERLINE 16
 
-void nessie_print_item(const char* name, uint8_t* buffer, uint16_t size_B){
+void nessie_print_item(const char *name, uint8_t *buffer, uint16_t size_B){
        uint8_t name_len;
        uint8_t i;
        name_len = strlen(name);
@@ -121,7 +121,7 @@ Key size: 256 bits
 Block size: 128 bits
 */
 
-void nessie_print_header(const charname,
+void nessie_print_header(const char *name,
                          uint16_t keysize_b, 
                          uint16_t blocksize_b,
                          uint16_t hashsize_b, 
index bfbcc1ff1fcd40497402a53ffdc01d23225ee35a..7eba1e3b0975cca7f4d0aad592867bb16c024794 100644 (file)
@@ -57,13 +57,13 @@ void nessie_send_alive_a(uint16_t i);
 #endif
 */
 
-void nessie_set_output_stream(FILEout_stream);
+void nessie_set_output_stream(FILE *out_stream);
 
-void nessie_print_block(uint8_tblock, uint16_t blocksize_bit);
-void nessie_print_item(const char* name, uint8_t* buffer, uint16_t size_B);
+void nessie_print_block(uint8_t *block, uint16_t blocksize_bit);
+void nessie_print_item(const char *name, uint8_t *buffer, uint16_t size_B);
 void nessie_print_set_vector(uint8_t set, uint16_t vector);
 void nessie_print_setheader(uint8_t set);
-void nessie_print_header(const charname,
+void nessie_print_header(const char *name,
                          uint16_t keysize_b, 
                          uint16_t blocksize_b,
                          uint16_t hashsize_b, 
index f112f4c229dabb842a5aee9d0a7ad60a7cea99bf..d80c70fffde378cac1a670667ee33e2e0adab02b 100644 (file)
@@ -112,7 +112,7 @@ void one_in512_hash(uint16_t pos){
        uint8_t hash[(nessie_hash_ctx.hashsize_b+7)/8];
        uint8_t block[nessie_hash_ctx.blocksize_B];
        uint16_t n=512;
-       chartab[8] = { "80", "40", "20", "10",
+       char *tab[8] = { "80", "40", "20", "10",
                         "08", "04", "02", "01" };
 
        pos&=511;
@@ -184,7 +184,7 @@ void nessie_hash_run(void){
        
        nessie_print_header(nessie_hash_ctx.name, 0, 0, nessie_hash_ctx.hashsize_b, 0, 0);
        /* test set 1 */
-       const charchallange_dbz= PSTR(
+       const char *challange_dbz= PSTR(
                  "\0"
                "\"\" (empty string)\0"
                  "a\0"
index c3bf13146c1e58f315ffad459b2cf7abeb00ffbf..b010129d0f55b7b71eb4a435d107e2d218979277 100644 (file)
 
 #include <stdint.h>
 
-typedef void (*nessie_hash_init_fpt)(voidctx);
-typedef void (*nessie_hash_next_fpt)(void* ctx, const void* buffer);
-typedef void (*nessie_hash_last_fpt)(void* ctx, const void* buffer, uint16_t size_b);
-typedef void (*nessie_hash_conv_fpt)(void* buffer, void* ctx);
+typedef void (*nessie_hash_init_fpt)(void *ctx);
+typedef void (*nessie_hash_next_fpt)(void *ctx, const void *buffer);
+typedef void (*nessie_hash_last_fpt)(void *ctx, const void *buffer, uint16_t size_b);
+typedef void (*nessie_hash_conv_fpt)(void *buffer, void *ctx);
 
 
 typedef struct nessie_hash_ctx_st{
        uint16_t hashsize_b;
        uint16_t blocksize_B;
        uint16_t ctx_size_B;
-       charname; 
+       char *name; 
        nessie_hash_init_fpt hash_init;
        nessie_hash_next_fpt hash_next;
        nessie_hash_last_fpt hash_last;
index 90f3be6d4efbba01417abda9ff1b44180457ab66..9c5d2ee5a69ab3869b7964d1a6158991ad6b5500 100644 (file)
@@ -50,7 +50,7 @@ const uint8_t keyproto[] PROGMEM = {
                           0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
 
 static
-void ascii_mac_P(PGM_P data, PGM_P desc, uint8_tkey){
+void ascii_mac_P(PGM_P data, PGM_P desc, uint8_t *key){
        uint8_t ctx[nessie_mac_ctx.ctx_size_B];
        uint8_t mac[MACSIZE_B];
        uint16_t sl;
@@ -76,7 +76,7 @@ void ascii_mac_P(PGM_P data, PGM_P desc, uint8_t* key){
 // message=1 million times "a"
 
 static
-void amillion_mac(uint8_tkey){
+void amillion_mac(uint8_t *key){
        uint8_t ctx[nessie_mac_ctx.ctx_size_B];
        uint8_t mac[MACSIZE_B];
        uint8_t block[nessie_mac_ctx.blocksize_B];
@@ -101,7 +101,7 @@ void amillion_mac(uint8_t* key){
 
 
 static
-void zero_mac(uint16_t n, uint8_tkey){
+void zero_mac(uint16_t n, uint8_t *key){
        uint8_t ctx[nessie_mac_ctx.ctx_size_B];
        uint8_t mac[MACSIZE_B];
        uint8_t block[nessie_mac_ctx.blocksize_B];
@@ -122,12 +122,12 @@ void zero_mac(uint16_t n, uint8_t* key){
 }
 
 static
-void one_in512_mac(uint16_t pos, uint8_tkey){
+void one_in512_mac(uint16_t pos, uint8_t *key){
        uint8_t ctx[nessie_mac_ctx.ctx_size_B];
        uint8_t mac[MACSIZE_B];
        uint8_t block[nessie_mac_ctx.blocksize_B];
        uint16_t n=512;
-       chartab[8] = { "80", "40", "20", "10",
+       char *tab[8] = { "80", "40", "20", "10",
                         "08", "04", "02", "01" };
 
        pos&=511;
@@ -140,7 +140,7 @@ void one_in512_mac(uint16_t pos, uint8_t* key){
        /* now the real stuff */
        memset(block, 0, 512/8);
        block[pos>>3] = 0x80>>(pos&0x7);
-       uint8_tbp;
+       uint8_t *bp;
        bp = block;
        nessie_mac_ctx.mac_init(ctx, key, nessie_mac_ctx.keysize_b);
        while(n>nessie_mac_ctx.blocksize_B*8){
@@ -194,7 +194,7 @@ void nessie_mac_run(void){
        nessie_print_header(nessie_mac_ctx.name, nessie_mac_ctx.keysize_b, 0, 0,
                            nessie_mac_ctx.macsize_b, 0);
        /* test set 1 */
-       const charchallange_dbz= PSTR(
+       const char *challange_dbz= PSTR(
                  "\0"
                "\"\" (empty string)\0"
                  "a\0"
index 411d843f5494d56841987a49a4779d27c6887eb2..0f92f9c73e77957ecdabea4d1906fef9f4c67ad5 100644 (file)
 
 #include <stdint.h>
 
-typedef void (*nessie_mac_init_fpt)(void* ctx, const void* key, uint16_t keysize_b);
-typedef void (*nessie_mac_next_fpt)(void* ctx, const void* buffer);
-typedef void (*nessie_mac_last_fpt)(void* ctx, const void* buffer, uint16_t size_b);
-typedef void (*nessie_mac_conv_fpt)(void* buffer, void* ctx);
+typedef void (*nessie_mac_init_fpt)(void *ctx, const void *key, uint16_t keysize_b);
+typedef void (*nessie_mac_next_fpt)(void *ctx, const void *buffer);
+typedef void (*nessie_mac_last_fpt)(void *ctx, const void *buffer, uint16_t size_b);
+typedef void (*nessie_mac_conv_fpt)(void *buffer, void *ctx);
 
 
 typedef struct nessie_mac_ctx_st{
@@ -32,7 +32,7 @@ typedef struct nessie_mac_ctx_st{
        uint16_t keysize_b;
        uint16_t blocksize_B;
        uint16_t ctx_size_B;
-       charname; 
+       char *name; 
        nessie_mac_init_fpt mac_init;
        nessie_mac_next_fpt mac_next;
        nessie_mac_last_fpt mac_last;
index 662259da15d44a48f686665e9362148f2aa0cb4c..f9128a2949605d9966e6ea9293227335001afa80 100644 (file)
@@ -38,7 +38,7 @@ nessie_stream_ctx_t nessie_stream_ctx;
 
 
 static 
-void nessie_gen_block(void* ctx, uint8_t* block){
+void nessie_gen_block(void *ctx, uint8_t *block){
        uint16_t i;
        for(i=0; i<BLOCKSIZE_B; ++i){
                block[i] = nessie_stream_ctx.cipher_enc(ctx);
@@ -46,7 +46,7 @@ void nessie_gen_block(void* ctx, uint8_t* block){
 }
 
 static
-void nessie_stream_enc(uint8_tkey){
+void nessie_stream_enc(uint8_t *key){
        uint8_t ctx[nessie_stream_ctx.ctx_size_B];
        uint8_t buffer[BLOCKSIZE_B];
        uint8_t xorbuffer[BLOCKSIZE_B];
@@ -90,7 +90,7 @@ void nessie_stream_enc(uint8_t* key){
 
 
 static
-void nessie_stream_enc_large(uint8_tkey){
+void nessie_stream_enc_large(uint8_t *key){
        uint8_t ctx[nessie_stream_ctx.ctx_size_B];
        uint8_t buffer[BLOCKSIZE_B];
        uint8_t xorbuffer[BLOCKSIZE_B];
index 116d11cdaa0a273e5e3f37989a84934f179df72a..616ca4a65f7bec1758caaca0137a6a3f0b65c095 100644 (file)
 
 #include <stdint.h>
 
-typedef void (*nessie_stream_genctx_fpt)(uint8_t* key, uint16_t keylength_b, void* ctx);
-typedef uint8_t (*nessie_stream_genenc_fpt)(voidctx);
+typedef void (*nessie_stream_genctx_fpt)(uint8_t *key, uint16_t keylength_b, void *ctx);
+typedef uint8_t (*nessie_stream_genenc_fpt)(void *ctx);
 
 typedef struct nessie_stream_ctx_st{
        uint16_t keysize_b;
        uint16_t ivsize_b;
        uint16_t outsize_b;
        uint16_t ctx_size_B;
-       charname; 
+       char *name; 
        nessie_stream_genctx_fpt cipher_genctx;
        nessie_stream_genenc_fpt cipher_enc;
 } nessie_stream_ctx_t; 
index a5e897f16702a9ebdc3e4e13b334ab60c620f578..b3fff709ca54b3cc0d006063708bbafd9ff5a083 100644 (file)
@@ -80,7 +80,7 @@ uint64_t stopTimer(void){
        return ret;
 }
 
-void getOverhead(uint16_t* constoh, uint16_t* intoh){
+void getOverhead(uint16_t *constoh, uint16_t *intoh){
        *constoh = const_overhead;
        *intoh   = int_overhead;
 }
index 4b2329e2649d9db5eacf5f689c9f8561a1039d71..f40a496cd1b6bf4d8510d4f069d397ee4f36a5da 100644 (file)
@@ -31,7 +31,7 @@
 void calibrateTimer(void);
 void startTimer(uint8_t granularity);
 uint64_t stopTimer(void);
-void getOverhead(uint16_t* constoh, uint16_t* intoh);
+void getOverhead(uint16_t *constoh, uint16_t *intoh);
 
 void print_time_P(PGM_P s, uint64_t t);
 void print_overhead(void);
index 53fd488e6e24d798ae17a6e35c9ebeb827ab742e..4ba97f90d79b180bff4ae0e8b5e2f6d3c901bbad 100644 (file)
@@ -56,7 +56,7 @@ hfdesc_t** shavs_algolist=NULL;
 void shavs_listalgos(void){
        char option = 'a';
 
-       hfdesc_tt;
+       hfdesc_t *t;
        uint8_t i=0;
        fputs_P(PSTR("\nthe following algorithms are available:\n"), shavs_out_file);
        while(option <= 'z' && (t = (hfdesc_t*)pgm_read_word(&(shavs_algolist[i])))){
@@ -66,7 +66,7 @@ void shavs_listalgos(void){
        }
 }
 
-void shavs_setalgo(charparam){
+void shavs_setalgo(char *param){
        param = strstrip(param);
        if(param[1]=='\0'){ /* single letter specified */
                uint8_t i, option = param[0] - 'a';
@@ -83,7 +83,7 @@ void shavs_setalgo(char* param){
                }
                shavs_algo=(hfdesc_t*)pgm_read_word(&(shavs_algolist[option]));
        } else { /* name specifyed */
-               hfdesc_tt=NULL;
+               hfdesc_t *t=NULL;
                uint8_t i=0;
                while((t=(hfdesc_t*)pgm_read_word(&(shavs_algolist[i]))) &&
                       strcasecmp_P(param, (void*)pgm_read_word(&(t->name))))
@@ -104,7 +104,7 @@ typedef struct {
        uint16_t buffersize_B;
        uint32_t blocks;
        hfgen_ctx_t ctx;
-       uint8_tbuffer;
+       uint8_t *buffer;
        uint8_t  in_byte;
 } shavs_ctx_t;
 
@@ -143,7 +143,7 @@ uint8_t buffer_add(char c){
 }
 
 static
-uint32_t my_strtoul(const charstr){
+uint32_t my_strtoul(const char *str){
        uint32_t r=0;
        while(*str && (*str<'0' || *str>'9')){
                str++;
@@ -162,7 +162,7 @@ uint32_t my_strtoul(const char* str){
 int32_t getLength(void){
        uint32_t len=0;
        char lenstr[21];
-       charlen2;
+       char *len2;
        for(;;){
                memset(lenstr, 0, 21);
                cli_getsn_cecho(lenstr, 20);
index 21993518c1b0af60f0135b2b5ce70de31a203f01..555304e3ae28d15a113274c3992a4da7f51d8342 100644 (file)
@@ -34,7 +34,7 @@ extern hfdesc_t*  shavs_algo;
 extern hfdesc_t** shavs_algolist;
 
 void shavs_listalgos(void);
-void shavs_setalgo(charparam);
+void shavs_setalgo(char *param);
 void shavs_test1(void);
 void shavs_test2(void);
 void shavs_test3(void);
index 256ecd7a3279bd37965630fcd6a51a34dcabbcb0..92467919bd41c471684d3970653e0407f62dfc5e 100644 (file)
@@ -21,7 +21,7 @@
 
 /******************************************************************************/
 /*
-       uint16_t stridentcnt_P(chara, PGM_P b){
+       uint16_t stridentcnt_P(char *a, PGM_P b){
                uint16_t i=0;
                char c;
                for(;;){
@@ -55,7 +55,7 @@ stridentcnt_P:
 
 /******************************************************************************/
 /*
-       uint16_t firstword_length(chars){
+       uint16_t firstword_length(char *s){
                uint16_t ret=0;
                while(isgraph(*s++))
                        ret++;
@@ -91,10 +91,10 @@ firstword_length:
 
 /******************************************************************************/
 /*
-       char* strstrip(char* str){
+       char *strstrip(char *str){
                if(!str)
                        return str;
-               charendptr;
+               char *endptr;
                while(*str && (*str==' ' || *str=='\t'))
                        ++str;
                endptr=str;
index bf2cbf7fe0019e00d1484181a652381d4f320b49..857602098099d1bbcd13bf94244675b50440101d 100644 (file)
@@ -24,7 +24,7 @@
  * 
  */
 
-/** \fn stridentcnt_P(chara, PGM_P b)
+/** \fn stridentcnt_P(char *a, PGM_P b)
  * \brief counts the number of identic chars
  * 
  * This function compares the supplyed strings and returns the index of the 
@@ -33,9 +33,9 @@
  * \param b pointer to string in Flash
  * \return index of the first char where \c a and \c b differ
  */
-uint16_t stridentcnt_P(chara, PGM_P b);
+uint16_t stridentcnt_P(char *a, PGM_P b);
 
-/** \fn firstword_length(chars)
+/** \fn firstword_length(char *s)
  * \brief compute the length of the first word in supllyed string
  * 
  * This function searches for the first whitespace in the string and returns the
@@ -43,13 +43,13 @@ uint16_t stridentcnt_P(char* a, PGM_P b);
  * \param s string
  * \return number of chars in first word
  */
-uint16_t firstword_length(chars);
+uint16_t firstword_length(char *s);
 
-/** \fn strstrip(charstr)
+/** \fn strstrip(char *str)
  * \brief removes whitespace at the beginning and the end of a string
  * 
  * This function removes whitespaces at the end of a string.
  * \param str sting
  * \return pointer to the first non-whitespace char in string
  */
-char* strstrip(char* str);
+char *strstrip(char *str);
index cbad46197bf3abb5440d4580cd6ab1ae2801e54d..737a0680be7190db331ca40aacb68bd5930d5341 100644 (file)
@@ -32,7 +32,7 @@
 
 #define G(i) ((((*ctx)[(i)/8])>>(((i)%8)))&1)
 #define S(i,v) ((*ctx)[(i)/8] = (((*ctx)[(i)/8]) & (uint8_t)~(1<<((i)%8))) | ((v)<<((i)%8)))
-uint8_t trivium_enc(trivium_ctx_tctx){
+uint8_t trivium_enc(trivium_ctx_t *ctx){
        uint8_t t1,t2,t3,z;
        
        t1 = G(65)  ^ G(92);
@@ -77,9 +77,9 @@ static const uint8_t rev_table[16] PROGMEM = {
        0x03, 0x0B, 0x07, 0x0F    /* 0011 1011 0111 1111 */
 };
 
-void trivium_init(const voidkey, uint16_t keysize_b,
-                  const voidiv,  uint16_t ivsize_b,
-                  trivium_ctx_tctx){
+void trivium_init(const void *key, uint16_t keysize_b,
+                  const void *iv,  uint16_t ivsize_b,
+                  trivium_ctx_t *ctx){
        uint16_t i;
        uint8_t c1,c2;
        uint8_t t1,t2;
index ced7784229dc780010dd2ee348f837119434ad93..4211c2147240d06b8eb3f655e490099733384219 100644 (file)
 
 typedef uint8_t trivium_ctx_t[36]; /* 288bit */
 
-uint8_t trivium_enc(trivium_ctx_tctx);
-uint8_t trivium_getbyte(trivium_ctx_tctx);
-void trivium_init(const voidkey, uint16_t keysize_b,
-                  const voidiv,  uint16_t ivsize_b,
-                  trivium_ctx_tctx);
+uint8_t trivium_enc(trivium_ctx_t *ctx);
+uint8_t trivium_getbyte(trivium_ctx_t *ctx);
+void trivium_init(const void *key, uint16_t keysize_b,
+                  const void *iv,  uint16_t ivsize_b,
+                  trivium_ctx_t *ctx);
 
 #endif /*TRIVIUM_H_*/
index 746ea097fb7545c858c15a788276bb0da76a7dae..475309b00a8cab8a0d8aa66ad4441e09baeb5ae6 100644 (file)
@@ -438,7 +438,7 @@ twister_ctx2hash:
 
 
 /*********************************************************************/
-/* void twister_small_nextBlock(twister_state_t* ctx, void* msg) */   
+/* void twister_small_nextBlock(twister_state_t *ctx, void *msg) */   
 /*
  * param ctx: r24:r25
  * param msg: r22:r23
index be10546a991afef5c873cb3838b95d9e72d818df..1e904ecdd1074adbddfd215902bd66ce7cfd96a6 100644 (file)
@@ -27,7 +27,7 @@
  
  #include "avr-asm-macros.S"
 
-/* void checksum_update(twister_large_ctx_tctx, uint8_t col) */
+/* void checksum_update(twister_large_ctx_t *ctx, uint8_t col) */
 /*
  * param ctx: r24:r25
  * param col: r22
@@ -117,7 +117,7 @@ checksum_update:
        ret
 
 /*********************************************************************/
-/* void twister_large_init(twister_large_ctx_tctx, uint16_t hashsize_b)*/
+/* void twister_large_init(twister_large_ctx_t *ctx, uint16_t hashsize_b)*/
 /* 
  * param ctx:        r24:r25
  * param hashsize_b: r22:r23
@@ -163,7 +163,7 @@ twister_large_init:
        ret
 
 /*********************************************************************/
-/* void twister_large_nextBlock(twister_state_t* ctx, void* msg) */   
+/* void twister_large_nextBlock(twister_state_t *ctx, void *msg) */   
 /*
  * param ctx: r24:r25
  * param msg: r22:r23
@@ -350,7 +350,7 @@ twister_large_nextBlock:
        ret
        
 /*********************************************************************/
-/* void twister_large_lastBlock(twister_state_t* ctx, void* msg, uint16_t length_b) */   
+/* void twister_large_lastBlock(twister_state_t *ctx, void *msg, uint16_t length_b) */   
 /*
  * param ctx:      r24:r25
  * param msg:      r22:r23
index 36506be6d29231ff95cb38e4ebcc4aa0c5898e8d..905cd59001e8d8722e0799f5a82ca5cde94e35c1 100644 (file)
@@ -26,7 +26,7 @@
 /*********************************************************************/
 
 static
-void checksum_update(twister_large_ctx_tctx, uint8_t col){
+void checksum_update(twister_large_ctx_t *ctx, uint8_t col){
        uint8_t i, col2;
        uint8_t carry = 0;
        int sum = 0;
@@ -46,7 +46,7 @@ void checksum_update(twister_large_ctx_t* ctx, uint8_t col){
 
 /*********************************************************************/
 
-void twister_large_init(twister_large_ctx_tctx, uint16_t hashsize_b){
+void twister_large_init(twister_large_ctx_t *ctx, uint16_t hashsize_b){
        memset(ctx->state.s,  0, 64);
        memset(ctx->checksum, 0, 64);
        ctx->state.counter=0xffffffffffffffffLL;
@@ -57,7 +57,7 @@ void twister_large_init(twister_large_ctx_t* ctx, uint16_t hashsize_b){
 
 /*********************************************************************/
 
-void twister_large_nextBlock(twister_large_ctx_t* ctx, const void* msg){
+void twister_large_nextBlock(twister_large_ctx_t *ctx, const void *msg){
        uint8_t tmp[8][8];
 
        /* 1st maxi round */
@@ -108,7 +108,7 @@ void twister_large_nextBlock(twister_large_ctx_t* ctx, const void* msg){
 
 /*********************************************************************/
 
-void twister_inject_chksum(twister_large_ctx_tctx, uint8_t col){
+void twister_inject_chksum(twister_large_ctx_t *ctx, uint8_t col){
        uint8_t i=7;
        do{
                ctx->state.s[7][i] ^= ctx->checksum[col][i];
@@ -119,7 +119,7 @@ void twister_inject_chksum(twister_large_ctx_t* ctx, uint8_t col){
 
 /*********************************************************************/
 
-void twister_large_lastBlock(twister_large_ctx_t* ctx, const void* msg, uint16_t length_b){
+void twister_large_lastBlock(twister_large_ctx_t *ctx, const void *msg, uint16_t length_b){
        uint8_t tmp[64];        
        while(length_b>=512){
                twister_large_nextBlock(ctx, msg);
@@ -155,38 +155,38 @@ void twister_large_lastBlock(twister_large_ctx_t* ctx, const void* msg, uint16_t
 
 /*********************************************************************/
 
-void twister_large_ctx2hash(void* dest, twister_large_ctx_t* ctx, uint16_t hashsize_b){
+void twister_large_ctx2hash(void *dest, twister_large_ctx_t *ctx, uint16_t hashsize_b){
        twister_ctx2hash(dest, &(ctx->state), hashsize_b);
 }
 
 /*********************************************************************/
 /*********************************************************************/
 
-void twister384_init(twister384_ctx_tctx){
+void twister384_init(twister384_ctx_t *ctx){
        twister_large_init(ctx, 384);
 }
 
 /*********************************************************************/
 
-void twister384_nextBlock(twister384_ctx_t* ctx, const void* msg){
+void twister384_nextBlock(twister384_ctx_t *ctx, const void *msg){
        twister_large_nextBlock(ctx, msg);
 }
 
 /*********************************************************************/
 
-void twister384_lastBlock(twister384_ctx_t* ctx, const void* msg, uint16_t length_b){
+void twister384_lastBlock(twister384_ctx_t *ctx, const void *msg, uint16_t length_b){
        twister_large_lastBlock(ctx, msg, length_b);
 }
 
 /*********************************************************************/
 
-void twister384_ctx2hash(void* dest, twister384_ctx_t* ctx){
+void twister384_ctx2hash(void *dest, twister384_ctx_t *ctx){
        twister_large_ctx2hash(dest, ctx, 384);
 }
 
 /*********************************************************************/
 
-void twister384(void* dest, const void* msg, uint32_t msg_length_b){
+void twister384(void *dest, const void *msg, uint32_t msg_length_b){
        twister_large_ctx_t ctx;
        twister_large_init(&ctx, 384);
        while(msg_length_b >=512){
@@ -202,31 +202,31 @@ void twister384(void* dest, const void* msg, uint32_t msg_length_b){
 /*********************************************************************/
 
 
-void twister512_init(twister512_ctx_tctx){
+void twister512_init(twister512_ctx_t *ctx){
        twister_large_init(ctx, 512);
 }
 
 /*********************************************************************/
 
-void twister512_nextBlock(twister512_ctx_t* ctx, const void* msg){
+void twister512_nextBlock(twister512_ctx_t *ctx, const void *msg){
        twister_large_nextBlock(ctx, msg);
 }
 
 /*********************************************************************/
 
-void twister512_lastBlock(twister512_ctx_t* ctx, const void* msg, uint16_t length_b){
+void twister512_lastBlock(twister512_ctx_t *ctx, const void *msg, uint16_t length_b){
        twister_large_lastBlock(ctx, msg, length_b);
 }
 
 /*********************************************************************/
 
-void twister512_ctx2hash(void* dest, twister512_ctx_t* ctx){
+void twister512_ctx2hash(void *dest, twister512_ctx_t *ctx){
        twister_large_ctx2hash(dest, ctx, 512);
 }
 
 /*********************************************************************/
 
-void twister512(void* dest, const void* msg, uint32_t msg_length_b){
+void twister512(void *dest, const void *msg, uint32_t msg_length_b){
        twister_large_ctx_t ctx;
        twister_large_init(&ctx, 512);
        while(msg_length_b >=512){
index 45de18b7424420b8eea8d6c0ed0bf5edffd90965..582f3b007cb9566b7c77b78cde77e33eef3df33e 100644 (file)
@@ -19,26 +19,26 @@ typedef twister_large_ctx_t twister512_ctx_t;
 
 /*********************************************************************/
 
-void twister_large_nextBlock(twister_large_ctx_t* ctx, const void* msg);
-void twister_large_init(twister_large_ctx_tctx, uint16_t hashsize_b);
-void twister_large_lastBlock(twister_large_ctx_t* ctx, const void* msg, uint16_t length_b);
-void twister_large_ctx2hash(void* dest, twister_large_ctx_t* ctx, uint16_t hashsize_b);
+void twister_large_nextBlock(twister_large_ctx_t *ctx, const void *msg);
+void twister_large_init(twister_large_ctx_t *ctx, uint16_t hashsize_b);
+void twister_large_lastBlock(twister_large_ctx_t *ctx, const void *msg, uint16_t length_b);
+void twister_large_ctx2hash(void *dest, twister_large_ctx_t *ctx, uint16_t hashsize_b);
 
 /*********************************************************************/
 
-void twister384_init(twister384_ctx_tctx);
-void twister384_nextBlock(twister384_ctx_t* ctx, const void* msg);
-void twister384_lastBlock(twister384_ctx_t* ctx, const void* msg, uint16_t length_b);
-void twister384_ctx2hash(void* dest, twister384_ctx_t* ctx);
-void twister384(void* dest, const void* msg, uint32_t msg_length_b);
+void twister384_init(twister384_ctx_t *ctx);
+void twister384_nextBlock(twister384_ctx_t *ctx, const void *msg);
+void twister384_lastBlock(twister384_ctx_t *ctx, const void *msg, uint16_t length_b);
+void twister384_ctx2hash(void *dest, twister384_ctx_t *ctx);
+void twister384(void *dest, const void *msg, uint32_t msg_length_b);
 
 /*********************************************************************/
 
-void twister512_init(twister512_ctx_tctx);
-void twister512_nextBlock(twister512_ctx_t* ctx, const void* msg);
-void twister512_lastBlock(twister512_ctx_t* ctx, const void* msg, uint16_t length_b);
-void twister512_ctx2hash(void* dest, twister512_ctx_t* ctx);
-void twister512(void* dest, const void* msg, uint32_t msg_length_b);
+void twister512_init(twister512_ctx_t *ctx);
+void twister512_nextBlock(twister512_ctx_t *ctx, const void *msg);
+void twister512_lastBlock(twister512_ctx_t *ctx, const void *msg, uint16_t length_b);
+void twister512_ctx2hash(void *dest, twister512_ctx_t *ctx);
+void twister512(void *dest, const void *msg, uint32_t msg_length_b);
 
 
 #endif /* TWISTER_large_H_ */
index 6cfda293836a90d48f48881f68d04b830c26c079..30dab88146c1e632e180f7c706eb43d071b5bc73 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "avr-asm-macros.S"
 
-/* void twister_small_init(twister_state_tctx, uint16_t hashsize_b)*/
+/* void twister_small_init(twister_state_t *ctx, uint16_t hashsize_b)*/
 /*
  * param ctx:        r24:r25
  * param hashsize_b: r22:r23
@@ -73,7 +73,7 @@ twister_small_init:
        ret
 #if 1 
 /*********************************************************************/
-/* void twister_small_lastBlock(twister_state_t* ctx, void* msg, uint16_t length_b) */   
+/* void twister_small_lastBlock(twister_state_t *ctx, void *msg, uint16_t length_b) */   
 /*
  * param ctx:      r24:r25
  * param msg:      r22:r23
index 9eb4112a933edf453b3c3a1ac8ffe5df6f44194d..331e818fa09535601f7eab49ccee72c657efce14 100644 (file)
@@ -7,7 +7,7 @@
 
 /*********************************************************************/
 #if 0
-void twister_small_init(twister_state_tctx, uint16_t hashsize_b){
+void twister_small_init(twister_state_t *ctx, uint16_t hashsize_b){
        memset(ctx->s, 0, 64);
        ctx->counter=0xffffffffffffffffLL;
        ctx->s[0][7] = hashsize_b>>8;
@@ -17,7 +17,7 @@ void twister_small_init(twister_state_t* ctx, uint16_t hashsize_b){
 
 /*********************************************************************/
 
-void twister_small_nextBlock(twister_state_t* ctx, void* msg){
+void twister_small_nextBlock(twister_state_t *ctx, void *msg){
        uint8_t tmp[8][8];
        /* round 1 */
        memcpy(tmp, ctx->s, 64);
@@ -51,7 +51,7 @@ void twister_small_nextBlock(twister_state_t* ctx, void* msg){
 #endif
 /*********************************************************************/
 #if 0
-void twister_small_lastBlock(twister_state_t* ctx, void* msg, uint16_t length_b){
+void twister_small_lastBlock(twister_state_t *ctx, void *msg, uint16_t length_b){
        uint8_t tmp[64];        
        while(length_b>512){
                twister_small_nextBlock(ctx, msg);
@@ -68,12 +68,12 @@ void twister_small_lastBlock(twister_state_t* ctx, void* msg, uint16_t length_b)
 }
 
 
-void twister256_lastBlock(twister256_ctx_t* ctx, void* msg, uint16_t length_b){
+void twister256_lastBlock(twister256_ctx_t *ctx, void *msg, uint16_t length_b){
        twister_small_lastBlock(ctx, msg, length_b);
 }
 
 
-void twister224_lastBlock(twister224_ctx_t* ctx, void* msg, uint16_t length_b){
+void twister224_lastBlock(twister224_ctx_t *ctx, void *msg, uint16_t length_b){
        twister_small_lastBlock(ctx, msg, length_b);
 }
 
@@ -81,7 +81,7 @@ void twister224_lastBlock(twister224_ctx_t* ctx, void* msg, uint16_t length_b){
 #if 0
 /*********************************************************************/
 
-void twister_small_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_b){
+void twister_small_ctx2hash(void *dest, twister_state_t *ctx, uint16_t hashsize_b){
        twister_ctx2hash(dest, ctx, hashsize_b);
 }
 
@@ -90,13 +90,13 @@ void twister_small_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_
 
 #ifndef NO_TWISTER_256
 
-void twister256_init(twister256_ctx_tctx){
+void twister256_init(twister256_ctx_t *ctx){
        twister_small_init(ctx, 256);
 }
 
 /*********************************************************************/
 
-void twister256_nextBlock(twister256_ctx_t* ctx, void* msg){
+void twister256_nextBlock(twister256_ctx_t *ctx, void *msg){
        twister_small_nextBlock(ctx, msg);
 }
 
@@ -104,13 +104,13 @@ void twister256_nextBlock(twister256_ctx_t* ctx, void* msg){
 
 /*********************************************************************/
 
-void twister256_ctx2hash(void* dest, twister256_ctx_t* ctx){
+void twister256_ctx2hash(void *dest, twister256_ctx_t *ctx){
        twister_ctx2hash(dest, ctx, 256);
 }
 
 /*********************************************************************/
 
-void twister256(void* dest, void* msg, uint32_t msg_length_b){
+void twister256(void *dest, void *msg, uint32_t msg_length_b){
        twister_state_t ctx;
        twister_small_init(&ctx, 256);
        while(msg_length_b >=512){
@@ -131,13 +131,13 @@ void twister256(void* dest, void* msg, uint32_t msg_length_b){
 
 #ifndef NO_TWISTER_224
 
-void twister224_init(twister224_ctx_tctx){
+void twister224_init(twister224_ctx_t *ctx){
        twister_small_init(ctx, 224);
 }
 
 /*********************************************************************/
 
-void twister224_nextBlock(twister224_ctx_t* ctx, void* msg){
+void twister224_nextBlock(twister224_ctx_t *ctx, void *msg){
        twister_small_nextBlock(ctx, msg);
 }
 
@@ -145,13 +145,13 @@ void twister224_nextBlock(twister224_ctx_t* ctx, void* msg){
 
 /*********************************************************************/
 
-void twister224_ctx2hash(void* dest, twister224_ctx_t* ctx){
+void twister224_ctx2hash(void *dest, twister224_ctx_t *ctx){
        twister_ctx2hash(dest, ctx, 224);
 }
 
 /*********************************************************************/
 
-void twister224(void* dest, void* msg, uint32_t msg_length_b){
+void twister224(void *dest, void *msg, uint32_t msg_length_b){
        twister_state_t ctx;
        twister_small_init(&ctx, 224);
        while(msg_length_b >=512){
index 5fb05368ce9ff7d9255d1553ad38bd06006dff6b..996066c74c0db9ff252f5445d15cd669cdac1974 100644 (file)
@@ -7,7 +7,7 @@
 
 /*********************************************************************/
 
-void twister_small_init(twister_state_tctx, uint16_t hashsize_b){
+void twister_small_init(twister_state_t *ctx, uint16_t hashsize_b){
        memset(ctx->s, 0, 64);
        ctx->counter=0xffffffffffffffffLL;
        ctx->s[0][7] = hashsize_b>>8;
@@ -17,7 +17,7 @@ void twister_small_init(twister_state_t* ctx, uint16_t hashsize_b){
 
 /*********************************************************************/
 
-void twister_small_nextBlock(twister_state_t* ctx, const void* msg){
+void twister_small_nextBlock(twister_state_t *ctx, const void *msg){
        uint8_t tmp[8][8];
        /* round 1 */
        memcpy(tmp, ctx->s, 64);
@@ -51,7 +51,7 @@ void twister_small_nextBlock(twister_state_t* ctx, const void* msg){
 
 /*********************************************************************/
 
-void twister_small_lastBlock(twister_state_t* ctx, const void* msg, uint16_t length_b){
+void twister_small_lastBlock(twister_state_t *ctx, const void *msg, uint16_t length_b){
        uint8_t tmp[64];        
        while(length_b>=512){
                twister_small_nextBlock(ctx, msg);
@@ -70,7 +70,7 @@ void twister_small_lastBlock(twister_state_t* ctx, const void* msg, uint16_t len
 
 /*********************************************************************/
 
-void twister_small_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_b){
+void twister_small_ctx2hash(void *dest, twister_state_t *ctx, uint16_t hashsize_b){
        twister_ctx2hash(dest, ctx, hashsize_b);
 }
 
@@ -79,31 +79,31 @@ void twister_small_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_
 
 #ifndef NO_TWISTER_256
 
-void twister256_init(twister256_ctx_tctx){
+void twister256_init(twister256_ctx_t *ctx){
        twister_small_init(ctx, 256);
 }
 
 /*********************************************************************/
 
-void twister256_nextBlock(twister256_ctx_t* ctx, const void* msg){
+void twister256_nextBlock(twister256_ctx_t *ctx, const void *msg){
        twister_small_nextBlock(ctx, msg);
 }
 
 /*********************************************************************/
 
-void twister256_lastBlock(twister256_ctx_t* ctx, const void* msg, uint16_t length_b){
+void twister256_lastBlock(twister256_ctx_t *ctx, const void *msg, uint16_t length_b){
        twister_small_lastBlock(ctx, msg, length_b);
 }
 
 /*********************************************************************/
 
-void twister256_ctx2hash(void* dest, twister256_ctx_t* ctx){
+void twister256_ctx2hash(void *dest, twister256_ctx_t *ctx){
        twister_ctx2hash(dest, ctx, 256);
 }
 
 /*********************************************************************/
 
-void twister256(void* dest, const void* msg, uint32_t msg_length_b){
+void twister256(void *dest, const void *msg, uint32_t msg_length_b){
        twister_state_t ctx;
        twister_small_init(&ctx, 256);
        while(msg_length_b >=512){
@@ -124,31 +124,31 @@ void twister256(void* dest, const void* msg, uint32_t msg_length_b){
 
 #ifndef NO_TWISTER_224
 
-void twister224_init(twister224_ctx_tctx){
+void twister224_init(twister224_ctx_t *ctx){
        twister_small_init(ctx, 224);
 }
 
 /*********************************************************************/
 
-void twister224_nextBlock(twister224_ctx_t* ctx, const void* msg){
+void twister224_nextBlock(twister224_ctx_t *ctx, const void *msg){
        twister_small_nextBlock(ctx, msg);
 }
 
 /*********************************************************************/
 
-void twister224_lastBlock(twister224_ctx_t* ctx, const void* msg, uint16_t length_b){
+void twister224_lastBlock(twister224_ctx_t *ctx, const void *msg, uint16_t length_b){
        twister_small_lastBlock(ctx, msg, length_b);
 }
 
 /*********************************************************************/
 
-void twister224_ctx2hash(void* dest, twister224_ctx_t* ctx){
+void twister224_ctx2hash(void *dest, twister224_ctx_t *ctx){
        twister_ctx2hash(dest, ctx, 224);
 }
 
 /*********************************************************************/
 
-void twister224(void* dest, const void* msg, uint32_t msg_length_b){
+void twister224(void *dest, const void *msg, uint32_t msg_length_b){
        twister_state_t ctx;
        twister_small_init(&ctx, 224);
        while(msg_length_b >=512){
index ca5511950042b11feff207643479b96a374205e2..e0b10fb16fc0cd5d1d0e9787d6fd0d874020cda3 100644 (file)
@@ -12,22 +12,22 @@ typedef uint8_t twister224_hash_t[224/8];
 typedef twister_state_t twister256_ctx_t;
 typedef twister_state_t twister224_ctx_t;
 
-void twister_small_init(twister_state_tctx, uint16_t hashsize_b);
-void twister_small_lastBlock(twister_state_t* ctx, const void* msg, uint16_t length_b);
-void twister_small_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_b);
-void twister_small_nextBlock(twister_state_t* ctx, const void* msg);
-
-
-void twister256_init(twister256_ctx_tctx);
-void twister256_nextBlock(twister256_ctx_t* ctx, const void* msg);
-void twister256_lastBlock(twister256_ctx_t* ctx, const void* msg, uint16_t length_b);
-void twister256_ctx2hash(void* dest, twister_state_t* ctx);
-void twister256(void* dest, const void* msg, uint32_t msg_length_b);
-
-void twister224_init(twister224_ctx_tctx);
-void twister224_nextBlock(twister224_ctx_t* ctx, const void* msg);
-void twister224_lastBlock(twister224_ctx_t* ctx, const void* msg, uint16_t length_b);
-void twister224_ctx2hash(void* dest, twister224_ctx_t* ctx);
-void twister224(void* dest, const void* msg, uint32_t msg_length_b);
+void twister_small_init(twister_state_t *ctx, uint16_t hashsize_b);
+void twister_small_lastBlock(twister_state_t *ctx, const void *msg, uint16_t length_b);
+void twister_small_ctx2hash(void *dest, twister_state_t *ctx, uint16_t hashsize_b);
+void twister_small_nextBlock(twister_state_t *ctx, const void *msg);
+
+
+void twister256_init(twister256_ctx_t *ctx);
+void twister256_nextBlock(twister256_ctx_t *ctx, const void *msg);
+void twister256_lastBlock(twister256_ctx_t *ctx, const void *msg, uint16_t length_b);
+void twister256_ctx2hash(void *dest, twister_state_t *ctx);
+void twister256(void *dest, const void *msg, uint32_t msg_length_b);
+
+void twister224_init(twister224_ctx_t *ctx);
+void twister224_nextBlock(twister224_ctx_t *ctx, const void *msg);
+void twister224_lastBlock(twister224_ctx_t *ctx, const void *msg, uint16_t length_b);
+void twister224_ctx2hash(void *dest, twister224_ctx_t *ctx);
+void twister224(void *dest, const void *msg, uint32_t msg_length_b);
 
 #endif /* TWISTER_SMALL_H_ */
index b19c0d0f6257a91e0df023d37a8833b9238a3d3b..b279f6042210e9db65abe475ee1b98cfafdf66fd 100644 (file)
@@ -37,7 +37,7 @@
 # define MULT(a,b) gf256mul((a),(b), 0x4D)
 //#endif
 
-void twister_blank_round(twister_state_tctx){
+void twister_blank_round(twister_state_t *ctx){
        uint8_t i,j,k;
        uint8_t tmp[8][8];
        /* add twist counter */
@@ -76,7 +76,7 @@ void twister_blank_round(twister_state_t* ctx){
                }       
        }
 }
-void twister_mini_round(twister_state_t* ctx, const void* msg){
+void twister_mini_round(twister_state_t *ctx, const void *msg){
        /* inject message */
        uint8_t i;
        for(i=0; i<8; ++i){
@@ -86,7 +86,7 @@ void twister_mini_round(twister_state_t* ctx, const void* msg){
        twister_blank_round(ctx);
 }
 
-void twister_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_b){
+void twister_ctx2hash(void *dest, twister_state_t *ctx, uint16_t hashsize_b){
        uint8_t tmp[8][8];
        uint8_t j;
        uint16_t i=hashsize_b;
index ec6b2190fcf5a90d12969a693a93103d2ee48323..a44e9ba3a05e950f4e1c693a709bf0e20712057d 100644 (file)
@@ -37,8 +37,8 @@ typedef struct {
 
 typedef uint8_t twister_checksum_t[8][8];
 
-void twister_blank_round(twister_state_tctx);
-void twister_mini_round(twister_state_t* ctx, const void* msg);        
-void twister_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_b);
+void twister_blank_round(twister_state_t *ctx);
+void twister_mini_round(twister_state_t *ctx, const void *msg);        
+void twister_ctx2hash(void *dest, twister_state_t *ctx, uint16_t hashsize_b);
 
 #endif /* TWISTER_H_ */
index e97ed5540b2c465d7133d1bca0be3f0411518d42..2f797923eabfa561e3caff4cfbfdad6711f505ca 100644 (file)
@@ -27,7 +27,7 @@
  
 #include "avr-asm-macros.S"
 /*********************************************************************/
-/* void twister224(void* dest, void* msg, uint32_t msg_length_b) */
+/* void twister224(void *dest, void *msg, uint32_t msg_length_b) */
 /*
  * param dest:         r24:r25
  * param msg:          r22:r23
index ce1dc11c72e395dfbb3b50cd755b0d292eed5862..9e519798b0baed7ae8dceef722b86b7e4dc8fd9b 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "avr-asm-macros.S"
 /*********************************************************************/
-/* void twister256(void* dest, void* msg, uint32_t msg_length_b) */
+/* void twister256(void *dest, void *msg, uint32_t msg_length_b) */
 /*
  * param dest:         r24:r25
  * param msg:          r22:r23
index 6a15fc567e3359020d2e44485896127e9f7e6b44..21bf8c772242f20d49c5ddb54065a1e730f7ab25 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "avr-asm-macros.S" 
 /*********************************************************************/
-/* void twister384(void* dest, void* msg, uint32_t msg_length_b) */
+/* void twister384(void *dest, void *msg, uint32_t msg_length_b) */
 /*
  * param dest:         r24:r25
  * param msg:          r22:r23
index 0aece4d7d7e2787042311e36e138d4c926b77c07..5f65d6137a9d0cc8d0ea6a4b0f4cfe620e612cbd 100644 (file)
@@ -27,7 +27,7 @@
  
 #include "avr-asm-macros.S"
 /*********************************************************************/
-/* void twister384(void* dest, void* msg, uint32_t msg_length_b) */
+/* void twister384(void *dest, void *msg, uint32_t msg_length_b) */
 /*
  * param dest:         r24:r25
  * param msg:          r22:r23
index 2565b70cc51442540abffdc0bdf494dbe510d2ce..91cfbed405c3a88ccd407ab86dfec87ad4139664 100644 (file)
@@ -111,7 +111,7 @@ static const uint8_t sbox[256] PROGMEM = {
 
 #endif
 
-static void gamma_1(uint8_ta){
+static void gamma_1(uint8_t *a){
        uint8_t i;
        for(i=0; i<64; ++i){
                *a = whirlpool_sbox(*a);
@@ -119,7 +119,7 @@ static void gamma_1(uint8_t* a){
        }
 }
 
-static void pi(uint8_ta){
+static void pi(uint8_t *a){
        uint8_t b[8];
        uint8_t i,j;
        for(i=1; i<8; ++i){
@@ -144,7 +144,7 @@ static const uint8_t theta_matrix[8] PROGMEM = {
 
 #define POLYNOM 0x1D
 
-static void theta(uint8_ta){
+static void theta(uint8_t *a){
        uint8_t b[8], c, accu;
        uint8_t i,j,k;
        for(i=0; i<8; ++i){
@@ -160,7 +160,7 @@ static void theta(uint8_t* a){
        }
 }
 
-static void w_round(uint8_t* a, const uint8_t* k){
+static void w_round(uint8_t *a, const uint8_t *k){
        gamma_1(a);
 #if DEBUG
        cli_putstr_P(PSTR("\r\n pre-pi:"));
@@ -179,7 +179,7 @@ static void w_round(uint8_t* a, const uint8_t* k){
        memxor(a, k, 64);
 }
 
-static void w_enc(uint8_t *a, const uint8_tk){
+static void w_enc(uint8_t *a, const uint8_t *k){
 #if DEBUG
        cli_putstr_P(PSTR("\r\n== w_enc ==\r\n w'_00:"));
        cli_hexdump_block(a, 64, 4, 8);
@@ -215,12 +215,12 @@ static void w_enc(uint8_t *a, const uint8_t* k){
        }
 }
 
-void whirlpool_init(whirlpool_ctx_tctx){
+void whirlpool_init(whirlpool_ctx_t *ctx){
        memset(ctx->s, 0, 64);
        ctx->blocks = 0;
 }
 
-void whirlpool_nextBlock(whirlpool_ctx_t* ctx, const void* block){
+void whirlpool_nextBlock(whirlpool_ctx_t *ctx, const void *block){
        uint8_t state[64];
        ctx->blocks += 1;
        memcpy(state, block, 64);
@@ -229,7 +229,7 @@ void whirlpool_nextBlock(whirlpool_ctx_t* ctx, const void* block){
        memxor((ctx->s), block, 64);
 }
 
-void whirlpool_lastBlock(whirlpool_ctx_t* ctx, const void* block, uint16_t length_b){
+void whirlpool_lastBlock(whirlpool_ctx_t *ctx, const void *block, uint16_t length_b){
        while(length_b>=512){
                whirlpool_nextBlock(ctx, block);
                block = (uint8_t*)block + 64;
@@ -253,6 +253,6 @@ void whirlpool_lastBlock(whirlpool_ctx_t* ctx, const void* block, uint16_t lengt
        whirlpool_nextBlock(ctx, buffer);
 }
 
-void whirlpool_ctx2hash(void* dest, const whirlpool_ctx_t* ctx){
+void whirlpool_ctx2hash(void *dest, const whirlpool_ctx_t *ctx){
        memcpy(dest, (ctx->s), 64);
 }
index d65f6e61c39f114fd6c8d33aa86f1bf3edfbcf73..3c13d1e838224f82ed23674e9d76fe7d69af7e15 100644 (file)
@@ -28,9 +28,9 @@ typedef struct {
 } whirlpool_ctx_t;
 
 
-void whirlpool_init(whirlpool_ctx_tctx);
-void whirlpool_nextBlock(whirlpool_ctx_t* ctx,const void* block);
-void whirlpool_lastBlock(whirlpool_ctx_t* ctx, const void* block, uint16_t length_b);
-void whirlpool_ctx2hash(void* dest, const whirlpool_ctx_t* ctx);
+void whirlpool_init(whirlpool_ctx_t *ctx);
+void whirlpool_nextBlock(whirlpool_ctx_t *ctx,const void *block);
+void whirlpool_lastBlock(whirlpool_ctx_t *ctx, const void *block, uint16_t length_b);
+void whirlpool_ctx2hash(void *dest, const whirlpool_ctx_t *ctx);
 
 #endif /* WIRLPOOL_H_ */
index c517e9b08063f3f29a26e519ed21bbd24814f1f6..b6d6ccd4ce136b8ecb605f741117cebd7a08b795 100644 (file)
@@ -25,7 +25,7 @@
  
 #include <stdint.h> 
 
-void xtea_enc(void* dest, const void* v, const void* k) {
+void xtea_enc(void *dest, const void *v, const void *k) {
     uint8_t i;
     uint32_t v0=((uint32_t*)v)[0], v1=((uint32_t*)v)[1];
     uint32_t sum=0, delta=0x9E3779B9;
@@ -37,7 +37,7 @@ void xtea_enc(void* dest, const void* v, const void* k) {
     ((uint32_t*)dest)[0]=v0; ((uint32_t*)dest)[1]=v1;
 }
 
-void xtea_dec(void* dest, const void* v, const void* k) {
+void xtea_dec(void *dest, const void *v, const void *k) {
     uint8_t i;
     uint32_t v0=((uint32_t*)v)[0], v1=((uint32_t*)v)[1];
     uint32_t sum=0xC6EF3720, delta=0x9E3779B9;
index b753bf753a469165b72e0f7aad1d68bf7ececc00..64bf827fd1660c6e34db7d86604ec72e724f34e6 100644 (file)
@@ -42,8 +42,8 @@
  * v:   the block to operate on (64 bit)
  * k:   the key for en/decryption (128 bit)
  */
-void xtea_enc(void* dest, const void* v, const void* k);
-void xtea_dec(void* dest, const void* v, const void* k);
+void xtea_enc(void *dest, const void *v, const void *k);
+void xtea_dec(void *dest, const void *v, const void *k);
 
 
 #endif /*XTEA_H_*/