Update demos

To build demos, run
`cmake .. -DENABLE_DEMOS=ON`
This commit is contained in:
Zhi Guan
2023-12-16 11:42:10 +08:00
parent 508206223b
commit 2c988b008b
84 changed files with 3130 additions and 864 deletions

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <gmssl/sha2.h>
int main(int argc, char **argv)
{
uint8_t dgst[SHA256_DIGEST_SIZE];
size_t i;
sha256_digest((uint8_t *)"abc", 3, dgst);
printf("sha256('abc') = ");
for (i = 0; i < sizeof(dgst); i++) {
printf("%02x", dgst[i]);
}
printf("\n");
return 0;
}