Skip to content

Commit

Permalink
Allow AES function for bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
shizzard committed Dec 6, 2024
1 parent 150f16c commit 81961b0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/aes_hash_bindgen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "aes_hash.hpp"

extern "C" {
void hashAes1Rx4_soft(const void *input, size_t inputSize, void *hash) {
hashAes1Rx4<true>(input, inputSize, hash);
}

void hashAes1Rx4_hard(const void *input, size_t inputSize, void *hash) {
hashAes1Rx4<false>(input, inputSize, hash);
}

void fillAes1Rx4_soft(void *state, size_t outputSize, void *buffer) {
fillAes1Rx4<true>(state, outputSize, buffer);
}

void fillAes1Rx4_hard(void *state, size_t outputSize, void *buffer) {
fillAes1Rx4<false>(state, outputSize, buffer);
}

void fillAes4Rx4_soft(void *state, size_t outputSize, void *buffer) {
fillAes4Rx4<true>(state, outputSize, buffer);
}

void fillAes4Rx4_hard(void *state, size_t outputSize, void *buffer) {
fillAes4Rx4<false>(state, outputSize, buffer);
}

void hashAndFillAes1Rx4_soft(void *scratchpad, size_t scratchpadSize, void *hash, void* fill_state) {
hashAndFillAes1Rx4<true>(scratchpad, scratchpadSize, hash, fill_state);
}

void hashAndFillAes1Rx4_hard(void *scratchpad, size_t scratchpadSize, void *hash, void* fill_state) {
hashAndFillAes1Rx4<false>(scratchpad, scratchpadSize, hash, fill_state);
}
}
25 changes: 25 additions & 0 deletions src/aes_hash_bindgen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef AES_HASH_BINDGEN_H
#define AES_HASH_BINDGEN_H
#endif

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

void hashAes1Rx4_soft(const void *input, size_t inputSize, void *hash);
void hashAes1Rx4_hard(const void *input, size_t inputSize, void *hash);

void fillAes1Rx4_soft(void *state, size_t outputSize, void *buffer);
void fillAes1Rx4_hard(void *state, size_t outputSize, void *buffer);

void fillAes4Rx4_soft(void *state, size_t outputSize, void *buffer);
void fillAes4Rx4_hard(void *state, size_t outputSize, void *buffer);

void hashAndFillAes1Rx4_soft(void *scratchpad, size_t scratchpadSize, void *hash, void* fill_state);
void hashAndFillAes1Rx4_hard(void *scratchpad, size_t scratchpadSize, void *hash, void* fill_state);

#ifdef __cplusplus
}
#endif

0 comments on commit 81961b0

Please sign in to comment.