Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | #ifndef HEADER_WORD_H | - |
14 | # define HEADER_WORD_H | - |
15 | | - |
16 | # include <string.h> | - |
17 | # include <assert.h> | - |
18 | # include <stdlib.h> | - |
19 | # include <openssl/e_os2.h> | - |
20 | # include "arch_intrinsics.h" | - |
21 | # include "curve448utils.h" | - |
22 | | - |
23 | # if (ARCH_WORD_BITS == 64) | - |
24 | typedef uint64_t word_t, mask_t; | - |
25 | typedef __uint128_t dword_t; | - |
26 | typedef int32_t hsword_t; | - |
27 | typedef int64_t sword_t; | - |
28 | typedef __int128_t dsword_t; | - |
29 | # elif (ARCH_WORD_BITS == 32) | - |
30 | typedef uint32_t word_t, mask_t; | - |
31 | typedef uint64_t dword_t; | - |
32 | typedef int16_t hsword_t; | - |
33 | typedef int32_t sword_t; | - |
34 | typedef int64_t dsword_t; | - |
35 | # else | - |
36 | # error "For now, we only support 32- and 64-bit architectures." | - |
37 | # endif | - |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | # if C448_WORD_BITS == 64 | - |
44 | # define SC_LIMB(x) (x) | - |
45 | # elif C448_WORD_BITS == 32 | - |
46 | # define SC_LIMB(x) ((uint32_t)(x)),((x) >> 32) | - |
47 | # else | - |
48 | # error "For now we only support 32- and 64-bit architectures." | - |
49 | # endif | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | static ossl_inline c448_bool_t mask_to_bool(mask_t m) | - |
62 | { | - |
63 | return (c448_sword_t)(sword_t)m;executed 1041 times by 2 tests: return (c448_sword_t)(sword_t)m; Executed by:- curve448_internal_test
- libcrypto.so.1.1
| 1041 |
64 | } | - |
65 | | - |
66 | static ossl_inline mask_t bool_to_mask(c448_bool_t m) | - |
67 | { | - |
68 | | - |
69 | mask_t ret = 0; | - |
70 | unsigned int i; | - |
71 | unsigned int limit = sizeof(c448_bool_t) / sizeof(mask_t); | - |
72 | | - |
73 | if (limit < 1)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
74 | limit = 1; never executed: limit = 1; | 0 |
75 | for (i = 0; i < limit; i++)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
76 | ret |= ~word_is_zero(m >> (i * 8 * sizeof(word_t))); never executed: ret |= ~constant_time_is_zero_32(m >> (i * 8 * sizeof(word_t))); | 0 |
77 | | - |
78 | return ret; never executed: return ret; | 0 |
79 | } | - |
80 | | - |
81 | #endif /* HEADER_WORD_H */ | - |
| | |