Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have successfully install the miracl to my linux OS,but I cannot use some functionlity definede in the "miracl.h" fine #125

Open
vegetablebirdjwx opened this issue Jul 11, 2023 · 0 comments

Comments

@vegetablebirdjwx
Copy link

this is my code to implement a founctionlity to caculate hash value of any input
#include <stdio.h>
#include "miracl.h"
void calculate_sha256_hash(const char* input, char* output) {
sha256 sh;
int i;
char digest[32];

shs256_init(&sh);
for (i = 0; input[i] != 0; i++) {
    shs256_process(&sh, input[i]);
}
shs256_hash(&sh, digest);

for (i = 0; i < 32; i++) {
    printf(output + (i * 2), "%02x", digest[i]);
}

}
in the miracl.h file these three functionlity have been defined as followed
extern void shs_init(sha *);
extern void shs_process(sha *,int);
extern void shs_hash(sha *,char *);

so what should I do to use these functionlity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant