JavaScript promise rejection: Loading CSS chunk index-domready failed. (error: https://sirherobrine23.com.br/assets/css/index-domready.9de057c0.css). Open browser console to see more details.
0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-07-08 14:25:54 +00:00
Files
libsql/libsql-ffi/bundled/SQLite3MultipleCiphers/src/ascon/permutations.h
2024-01-09 18:12:03 +01:00

79 lines
1.8 KiB
C

#ifndef PERMUTATIONS_H_
#define PERMUTATIONS_H_
#include <stdint.h>
#include "api.h"
#include "ascon.h"
#include "config.h"
#include "constants.h"
#include "printstate.h"
#include "round.h"
forceinline void ASCON_P12ROUNDS(ascon_state_t* s) {
ASCON_ROUND(s, ASCON_RC0);
ASCON_ROUND(s, ASCON_RC1);
ASCON_ROUND(s, ASCON_RC2);
ASCON_ROUND(s, ASCON_RC3);
ASCON_ROUND(s, ASCON_RC4);
ASCON_ROUND(s, ASCON_RC5);
ASCON_ROUND(s, ASCON_RC6);
ASCON_ROUND(s, ASCON_RC7);
ASCON_ROUND(s, ASCON_RC8);
ASCON_ROUND(s, ASCON_RC9);
ASCON_ROUND(s, ASCON_RCa);
ASCON_ROUND(s, ASCON_RCb);
}
forceinline void ASCON_P8ROUNDS(ascon_state_t* s) {
ASCON_ROUND(s, ASCON_RC4);
ASCON_ROUND(s, ASCON_RC5);
ASCON_ROUND(s, ASCON_RC6);
ASCON_ROUND(s, ASCON_RC7);
ASCON_ROUND(s, ASCON_RC8);
ASCON_ROUND(s, ASCON_RC9);
ASCON_ROUND(s, ASCON_RCa);
ASCON_ROUND(s, ASCON_RCb);
}
forceinline void ASCON_P6ROUNDS(ascon_state_t* s) {
ASCON_ROUND(s, ASCON_RC6);
ASCON_ROUND(s, ASCON_RC7);
ASCON_ROUND(s, ASCON_RC8);
ASCON_ROUND(s, ASCON_RC9);
ASCON_ROUND(s, ASCON_RCa);
ASCON_ROUND(s, ASCON_RCb);
}
#if ASCON_INLINE_PERM && ASCON_UNROLL_LOOPS
forceinline void ASCON_P(ascon_state_t* s, int nr) {
if (nr == 12) ASCON_P12ROUNDS(s);
if (nr == 8) ASCON_P8ROUNDS(s);
if (nr == 6) ASCON_P6ROUNDS(s);
}
#elif !ASCON_INLINE_PERM && ASCON_UNROLL_LOOPS
void ASCON_P12(ascon_state_t* s);
void ASCON_P8(ascon_state_t* s);
void ASCON_P6(ascon_state_t* s);
forceinline void ASCON_P(ascon_state_t* s, int nr) {
if (nr == 12) ASCON_P12(s);
if (nr == 8) ASCON_P8(s);
if (nr == 6) ASCON_P6(s);
}
#elif ASCON_INLINE_PERM && !ASCON_UNROLL_LOOPS
forceinline void ASCON_P(ascon_state_t* s, int nr) { ASCON_PROUNDS(s, nr); }
#else /* !ASCON_INLINE_PERM && !ASCON_UNROLL_LOOPS */
void ASCON_P(ascon_state_t* s, int nr);
#endif
#endif /* PERMUTATIONS_H_ */