gomcaptcha/mcaptcha-pow-ffi/mcaptcha_pow_ffi.h

19 lines
567 B
C

// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#include <stdbool.h>
struct ProofOfWork {
unsigned long int nonce;
char *result;
};
bool is_valid_proof(unsigned long int nonce, char *result, char *phrase,
char *salt);
bool is_sufficient_difficulty(unsigned long int nonce, char *result, char *salt,
unsigned difficulty);
struct ProofOfWork prove_work(char *salt, char *phrase, unsigned difficulty);