diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-15 19:16:29 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-06-15 19:16:29 +0200 |
commit | 2dbc1750eabb3781ec8181b5a73b54f6b8d64ef6 (patch) | |
tree | ad3480617fb0fb43289ae599f895d6a3034323bb /crypto.h | |
parent | 5bc9299f0d1b0baf220b75da86520606e87c4b3a (diff) |
curve: curve25519_encode/curve25519_decode: simplify crypto transforms
Simplify curve25519_encode() and curve25519_decode() transforms by making
the code more clear and by introducing macro accessors to nonces.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'crypto.h')
-rw-r--r-- | crypto.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -19,6 +19,10 @@ #define crypto_box_sec_key_size crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES #define NONCE_LENGTH (sizeof(struct taia)) +#define NONCE_RND_LENGTH (crypto_box_boxzerobytes - NONCE_LENGTH) +#define NONCE_ALL_LENGTH (crypto_box_boxzerobytes + NONCE_LENGTH) #define NONCE_OFFSET (crypto_box_noncebytes - NONCE_LENGTH) +#define NONCE_EDN_OFFSET(x) ((x) + NONCE_OFFSET) +#define NONCE_PKT_OFFSET(x) ((x) + NONCE_RND_LENGTH) #endif /* CRYPTO_H */ |