summaryrefslogtreecommitdiffstats
path: root/src/methods/generic_poly1305
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-11-30 05:34:49 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-11-30 05:35:18 +0100
commitaa1d894e102e23d162b8e2bccd4b3bf1700de2f2 (patch)
tree3027bc84e829650a798071ad9e13f4391260328b /src/methods/generic_poly1305
parent5f7258ade2dd8bad076d17d3a85fb04d9bf71bda (diff)
downloadfastd-aa1d894e102e23d162b8e2bccd4b3bf1700de2f2.tar
fastd-aa1d894e102e23d162b8e2bccd4b3bf1700de2f2.zip
Make the crypto implementations independent of fastd.h (and fix more minor bugs)
Diffstat (limited to 'src/methods/generic_poly1305')
-rw-r--r--src/methods/generic_poly1305/generic_poly1305.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/methods/generic_poly1305/generic_poly1305.c b/src/methods/generic_poly1305/generic_poly1305.c
index 1f40655..f547d5a 100644
--- a/src/methods/generic_poly1305/generic_poly1305.c
+++ b/src/methods/generic_poly1305/generic_poly1305.c
@@ -88,7 +88,7 @@ static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, c
fastd_method_common_init(ctx, &session->common, initiator);
session->method = method;
session->cipher = fastd_cipher_get(ctx, session->method->cipher_info);
- session->cipher_state = session->cipher->init(ctx, secret);
+ session->cipher_state = session->cipher->init(secret);
return session;
}
@@ -109,9 +109,9 @@ static void method_session_superseded(fastd_context_t *ctx, fastd_method_session
fastd_method_session_common_superseded(ctx, &session->common);
}
-static void method_session_free(fastd_context_t *ctx, fastd_method_session_state_t *session) {
+static void method_session_free(fastd_context_t *ctx UNUSED, fastd_method_session_state_t *session) {
if (session) {
- session->cipher->free(ctx, session->cipher_state);
+ session->cipher->free(session->cipher_state);
free(session);
}
}
@@ -138,7 +138,7 @@ static bool method_encrypt(fastd_context_t *ctx, fastd_peer_t *peer UNUSED, fast
fastd_block128_t *outblocks = out->data;
uint8_t tag[crypto_onetimeauth_poly1305_BYTES];
- bool ok = session->cipher->crypt(ctx, session->cipher_state, outblocks, inblocks, n_blocks*sizeof(fastd_block128_t), nonce);
+ bool ok = session->cipher->crypt(session->cipher_state, outblocks, inblocks, n_blocks*sizeof(fastd_block128_t), nonce);
if (!ok) {
/* restore original buffer */
@@ -199,7 +199,7 @@ static bool method_decrypt(fastd_context_t *ctx, fastd_peer_t *peer, fastd_metho
fastd_block128_t *inblocks = in.data;
fastd_block128_t *outblocks = out->data;
- bool ok = session->cipher->crypt(ctx, session->cipher_state, outblocks, inblocks, n_blocks*sizeof(fastd_block128_t), nonce);
+ bool ok = session->cipher->crypt(session->cipher_state, outblocks, inblocks, n_blocks*sizeof(fastd_block128_t), nonce);
if (ok) {
if (tail_len)