VirtualBox

source: vbox/trunk/src/libs/libtpms-0.9.6/tests/freebl_sha1flattensize.c@ 102278

最後變更 在這個檔案從102278是 91612,由 vboxsync 提交於 3 年 前

src/libs: Export libtpms-0.9.0, bugref:10078

檔案大小: 1.1 KB
 
1#include <stdint.h>
2#include <stdio.h>
3
4#include <blapi.h>
5
6
7#if defined (__x86_64__) || \
8 defined (__amd64__) || \
9 defined (__ia64__) || \
10 defined (__powerpc64__) || \
11 defined (__s390x__) || \
12 (defined (__sparc__) && defined(__arch64__)) || \
13 defined(__aarch64__)
14
15#define EXPECTED_LIB_FLATTENSIZE 248
16
17#elif defined (__i386__) || \
18 defined (__powerpc__) || \
19 defined (__s390__) || \
20 defined (__sparc__) || \
21 defined (__arm__)
22
23#define EXPECTED_LIB_FLATTENSIZE 160
24
25#else
26
27#error Undefined architecture type
28
29#endif
30
31int main(void)
32{
33 SHA1Context *context;
34 uint32_t libFlattenSize;
35
36 context = SHA1_NewContext();
37 if (!context) {
38 printf("Could not create SHA1 context.\n");
39 return EXIT_FAILURE;
40 }
41 SHA1_Begin(context);
42
43 libFlattenSize = SHA1_FlattenSize(context);
44 if (libFlattenSize != EXPECTED_LIB_FLATTENSIZE) {
45 printf("SHA1 flatten size is %d, expected %d\n",
46 libFlattenSize,
47 EXPECTED_LIB_FLATTENSIZE);
48 return EXIT_FAILURE;
49 }
50 return EXIT_SUCCESS;
51}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette