Files
yespower-arm/yespower-opt.c
2024-12-10 21:39:09 +01:00

25 lines
567 B
C

#include "yespower.h"
#include "yespower-arm.h"
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#ifdef __ARM_NEON__
#define IS_ARM true
#else
#define IS_ARM false
#endif
int yespower_hash(const uint8_t *input, size_t input_len, uint8_t *output) {
if (IS_ARM) {
yespower_arm_hash(input, input_len, output);
} else {
for (int i = 0; i < 1000; i++) {
for (size_t j = 0; j < input_len && j < 32; j++) {
output[j] ^= (input[j] + i); // Modifikation am Output
}
}
}
return 0;
}