Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crypto_aead/asconaead128/opt8/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ forceinline void ascon_loadkey(ascon_key_t* key, const uint8_t* k) {
forceinline void ascon_initaead(ascon_state_t* s, const ascon_key_t* key,
const uint8_t* npub) {
#if CRYPTO_KEYBYTES == 16
if (ASCON_AEAD_RATE == 8) s->x[0] = ASCON_128_IV;
if (ASCON_AEAD_RATE == 16) s->x[0] = ASCON_128A_IV;
if (ASCON_AEAD_RATE == 8) s->x[0] = U64TOWORD(ASCON_128_IV);
if (ASCON_AEAD_RATE == 16) s->x[0] = U64TOWORD(ASCON_128A_IV);
memcpy(s->b[1], key->b[0], 16);
#else /* CRYPTO_KEYBYTES == 20 */
s->x[0] = key->x[0] | ASCON_80PQ_IV;
Expand Down
4 changes: 2 additions & 2 deletions crypto_aead/asconaead128/opt8_lowsize/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ forceinline void ascon_loadkey(ascon_key_t* key, const uint8_t* k) {
forceinline void ascon_initaead(ascon_state_t* s, const ascon_key_t* key,
const uint8_t* npub) {
#if CRYPTO_KEYBYTES == 16
if (ASCON_AEAD_RATE == 8) s->x[0] = ASCON_128_IV;
if (ASCON_AEAD_RATE == 16) s->x[0] = ASCON_128A_IV;
if (ASCON_AEAD_RATE == 8) s->x[0] = U64TOWORD(ASCON_128_IV);
if (ASCON_AEAD_RATE == 16) s->x[0] = U64TOWORD(ASCON_128A_IV);
memcpy(s->b[1], key->b[0], 16);
#else /* CRYPTO_KEYBYTES == 20 */
s->x[0] = key->x[0] | ASCON_80PQ_IV;
Expand Down
8 changes: 4 additions & 4 deletions crypto_hash/asconhash256/opt8/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#ifdef ASCON_HASH_BYTES

#if ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_HASH_IV##i
#define IV(i) U64TOWORD(ASCON_HASH_IV##i)
#elif ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_HASHA_IV##i
#define IV(i) U64TOWORD(ASCON_HASHA_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_XOF_IV##i
#define IV(i) U64TOWORD(ASCON_XOF_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_XOFA_IV##i
#define IV(i) U64TOWORD(ASCON_XOFA_IV##i)
#endif

forceinline void ascon_inithash(ascon_state_t* s) {
Expand Down
8 changes: 4 additions & 4 deletions crypto_hash/asconhash256/opt8_lowsize/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "printstate.h"

#if ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_HASH_IV##i
#define IV(i) U64TOWORD(ASCON_HASH_IV##i)
#elif ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_HASHA_IV##i
#define IV(i) U64TOWORD(ASCON_HASHA_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_XOF_IV##i
#define IV(i) U64TOWORD(ASCON_XOF_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_XOFA_IV##i
#define IV(i) U64TOWORD(ASCON_XOFA_IV##i)
#endif

forceinline void ascon_inithash(ascon_state_t* s) {
Expand Down
8 changes: 4 additions & 4 deletions crypto_hash/asconxof128/opt8/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#ifdef ASCON_HASH_BYTES

#if ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_HASH_IV##i
#define IV(i) U64TOWORD(ASCON_HASH_IV##i)
#elif ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_HASHA_IV##i
#define IV(i) U64TOWORD(ASCON_HASHA_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_XOF_IV##i
#define IV(i) U64TOWORD(ASCON_XOF_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_XOFA_IV##i
#define IV(i) U64TOWORD(ASCON_XOFA_IV##i)
#endif

forceinline void ascon_inithash(ascon_state_t* s) {
Expand Down
8 changes: 4 additions & 4 deletions crypto_hash/asconxof128/opt8_lowsize/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "printstate.h"

#if ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_HASH_IV##i
#define IV(i) U64TOWORD(ASCON_HASH_IV##i)
#elif ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_HASHA_IV##i
#define IV(i) U64TOWORD(ASCON_HASHA_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_XOF_IV##i
#define IV(i) U64TOWORD(ASCON_XOF_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_XOFA_IV##i
#define IV(i) U64TOWORD(ASCON_XOFA_IV##i)
#endif

forceinline void ascon_inithash(ascon_state_t* s) {
Expand Down
4 changes: 2 additions & 2 deletions src/opt8/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ forceinline void ascon_loadkey(ascon_key_t* key, const uint8_t* k) {
forceinline void ascon_initaead(ascon_state_t* s, const ascon_key_t* key,
const uint8_t* npub) {
#if CRYPTO_KEYBYTES == 16
if (ASCON_AEAD_RATE == 8) s->x[0] = ASCON_128_IV;
if (ASCON_AEAD_RATE == 16) s->x[0] = ASCON_128A_IV;
if (ASCON_AEAD_RATE == 8) s->x[0] = U64TOWORD(ASCON_128_IV);
if (ASCON_AEAD_RATE == 16) s->x[0] = U64TOWORD(ASCON_128A_IV);
memcpy(s->b[1], key->b[0], 16);
#else /* CRYPTO_KEYBYTES == 20 */
s->x[0] = key->x[0] | ASCON_80PQ_IV;
Expand Down
8 changes: 4 additions & 4 deletions src/opt8/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#ifdef ASCON_HASH_BYTES

#if ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_HASH_IV##i
#define IV(i) U64TOWORD(ASCON_HASH_IV##i)
#elif ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_HASHA_IV##i
#define IV(i) U64TOWORD(ASCON_HASHA_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_XOF_IV##i
#define IV(i) U64TOWORD(ASCON_XOF_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_XOFA_IV##i
#define IV(i) U64TOWORD(ASCON_XOFA_IV##i)
#endif

forceinline void ascon_inithash(ascon_state_t* s) {
Expand Down
4 changes: 2 additions & 2 deletions src/opt8_lowsize/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ forceinline void ascon_loadkey(ascon_key_t* key, const uint8_t* k) {
forceinline void ascon_initaead(ascon_state_t* s, const ascon_key_t* key,
const uint8_t* npub) {
#if CRYPTO_KEYBYTES == 16
if (ASCON_AEAD_RATE == 8) s->x[0] = ASCON_128_IV;
if (ASCON_AEAD_RATE == 16) s->x[0] = ASCON_128A_IV;
if (ASCON_AEAD_RATE == 8) s->x[0] = U64TOWORD(ASCON_128_IV);
if (ASCON_AEAD_RATE == 16) s->x[0] = U64TOWORD(ASCON_128A_IV);
memcpy(s->b[1], key->b[0], 16);
#else /* CRYPTO_KEYBYTES == 20 */
s->x[0] = key->x[0] | ASCON_80PQ_IV;
Expand Down
8 changes: 4 additions & 4 deletions src/opt8_lowsize/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "printstate.h"

#if ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_HASH_IV##i
#define IV(i) U64TOWORD(ASCON_HASH_IV##i)
#elif ASCON_HASH_BYTES == 32 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_HASHA_IV##i
#define IV(i) U64TOWORD(ASCON_HASHA_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 12
#define IV(i) ASCON_XOF_IV##i
#define IV(i) U64TOWORD(ASCON_XOF_IV##i)
#elif ASCON_HASH_BYTES == 0 && ASCON_HASH_ROUNDS == 8
#define IV(i) ASCON_XOFA_IV##i
#define IV(i) U64TOWORD(ASCON_XOFA_IV##i)
#endif

forceinline void ascon_inithash(ascon_state_t* s) {
Expand Down