/src/wolfssl/wolfcrypt/src/misc.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* misc.c |
2 | | * |
3 | | * Copyright (C) 2006-2024 wolfSSL Inc. |
4 | | * |
5 | | * This file is part of wolfSSL. |
6 | | * |
7 | | * wolfSSL is free software; you can redistribute it and/or modify |
8 | | * it under the terms of the GNU General Public License as published by |
9 | | * the Free Software Foundation; either version 2 of the License, or |
10 | | * (at your option) any later version. |
11 | | * |
12 | | * wolfSSL is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | * GNU General Public License for more details. |
16 | | * |
17 | | * You should have received a copy of the GNU General Public License |
18 | | * along with this program; if not, write to the Free Software |
19 | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
20 | | */ |
21 | | /* |
22 | | |
23 | | DESCRIPTION |
24 | | This module implements the arithmetic-shift right, left, byte swapping, XOR, |
25 | | masking and clearing memory logic. |
26 | | |
27 | | */ |
28 | | #ifdef HAVE_CONFIG_H |
29 | | #include <config.h> |
30 | | #endif |
31 | | |
32 | | #include <wolfssl/wolfcrypt/settings.h> |
33 | | |
34 | | #ifndef WOLF_CRYPT_MISC_C |
35 | | #define WOLF_CRYPT_MISC_C |
36 | | |
37 | | #include <wolfssl/wolfcrypt/misc.h> |
38 | | |
39 | | /* inlining these functions is a huge speed increase and a small size decrease, |
40 | | because the functions are smaller than function call setup/cleanup, e.g., |
41 | | md5 benchmark is twice as fast with inline. If you don't want it, then |
42 | | define NO_INLINE and compile this file into wolfssl, otherwise it's used as |
43 | | a source header |
44 | | */ |
45 | | |
46 | | /* Check for if compiling misc.c when not needed. */ |
47 | | #if !defined(WOLFSSL_MISC_INCLUDED) && !defined(NO_INLINE) |
48 | | #ifndef WOLFSSL_IGNORE_FILE_WARN |
49 | | #warning misc.c does not need to be compiled when using inline (NO_INLINE not defined) |
50 | | #endif |
51 | | |
52 | | #else |
53 | | |
54 | | |
55 | | #if defined(__ICCARM__) |
56 | | #include <intrinsics.h> |
57 | | #endif |
58 | | |
59 | | |
60 | | #ifdef INTEL_INTRINSICS |
61 | | |
62 | | #include <stdlib.h> /* get intrinsic definitions */ |
63 | | |
64 | | /* for non visual studio probably need no long version, 32 bit only |
65 | | * i.e., _rotl and _rotr */ |
66 | | #pragma intrinsic(_lrotl, _lrotr) |
67 | | |
68 | | WC_MISC_STATIC WC_INLINE word32 rotlFixed(word32 x, word32 y) |
69 | | { |
70 | | return y ? _lrotl(x, y) : x; |
71 | | } |
72 | | |
73 | | WC_MISC_STATIC WC_INLINE word32 rotrFixed(word32 x, word32 y) |
74 | | { |
75 | | return y ? _lrotr(x, y) : x; |
76 | | } |
77 | | |
78 | | #elif defined(__CCRX__) |
79 | | |
80 | | #include <builtin.h> /* get intrinsic definitions */ |
81 | | |
82 | | #if !defined(NO_INLINE) |
83 | | |
84 | | #define rotlFixed(x, y) _builtin_rotl(x, y) |
85 | | |
86 | | #define rotrFixed(x, y) _builtin_rotr(x, y) |
87 | | |
88 | | #else /* create real function */ |
89 | | |
90 | | WC_MISC_STATIC WC_INLINE word32 rotlFixed(word32 x, word32 y) |
91 | | { |
92 | | return _builtin_rotl(x, y); |
93 | | } |
94 | | |
95 | | WC_MISC_STATIC WC_INLINE word32 rotrFixed(word32 x, word32 y) |
96 | | { |
97 | | return _builtin_rotr(x, y); |
98 | | } |
99 | | |
100 | | #endif |
101 | | |
102 | | #else /* generic */ |
103 | | /* This routine performs a left circular arithmetic shift of <x> by <y> value. */ |
104 | | |
105 | | WC_MISC_STATIC WC_INLINE word32 rotlFixed(word32 x, word32 y) |
106 | 192M | { |
107 | 192M | return (x << y) | (x >> (sizeof(x) * 8 - y)); |
108 | 192M | } Line | Count | Source | 106 | 16.4k | { | 107 | 16.4k | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 16.4k | } |
Unexecuted instantiation: asn.c:rotlFixed Unexecuted instantiation: camellia.c:rotlFixed Line | Count | Source | 106 | 640 | { | 107 | 640 | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 640 | } |
Unexecuted instantiation: chacha20_poly1305.c:rotlFixed Unexecuted instantiation: cmac.c:rotlFixed Unexecuted instantiation: coding.c:rotlFixed Unexecuted instantiation: curve25519.c:rotlFixed Unexecuted instantiation: curve448.c:rotlFixed Unexecuted instantiation: des3.c:rotlFixed Unexecuted instantiation: dh.c:rotlFixed Unexecuted instantiation: ecc.c:rotlFixed Unexecuted instantiation: eccsi.c:rotlFixed Unexecuted instantiation: ed25519.c:rotlFixed Unexecuted instantiation: ed448.c:rotlFixed Unexecuted instantiation: fe_448.c:rotlFixed Unexecuted instantiation: fe_operations.c:rotlFixed Unexecuted instantiation: ge_448.c:rotlFixed Unexecuted instantiation: ge_operations.c:rotlFixed Unexecuted instantiation: hash.c:rotlFixed Unexecuted instantiation: hmac.c:rotlFixed Unexecuted instantiation: kdf.c:rotlFixed Unexecuted instantiation: md2.c:rotlFixed Line | Count | Source | 106 | 17.3k | { | 107 | 17.3k | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 17.3k | } |
Line | Count | Source | 106 | 6.49M | { | 107 | 6.49M | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 6.49M | } |
Unexecuted instantiation: poly1305.c:rotlFixed Line | Count | Source | 106 | 149k | { | 107 | 149k | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 149k | } |
Line | Count | Source | 106 | 11.4k | { | 107 | 11.4k | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 11.4k | } |
Line | Count | Source | 106 | 5.62M | { | 107 | 5.62M | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 5.62M | } |
Unexecuted instantiation: rsa.c:rotlFixed Line | Count | Source | 106 | 34.9M | { | 107 | 34.9M | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 34.9M | } |
Line | Count | Source | 106 | 1.84M | { | 107 | 1.84M | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 1.84M | } |
Unexecuted instantiation: sha3.c:rotlFixed Unexecuted instantiation: sha512.c:rotlFixed Unexecuted instantiation: siphash.c:rotlFixed Unexecuted instantiation: sm2.c:rotlFixed Line | Count | Source | 106 | 143M | { | 107 | 143M | return (x << y) | (x >> (sizeof(x) * 8 - y)); | 108 | 143M | } |
Unexecuted instantiation: sm4.c:rotlFixed Unexecuted instantiation: sp_int.c:rotlFixed Unexecuted instantiation: wc_encrypt.c:rotlFixed Unexecuted instantiation: wolfmath.c:rotlFixed Unexecuted instantiation: ssl.c:rotlFixed Unexecuted instantiation: tls.c:rotlFixed Unexecuted instantiation: tls13.c:rotlFixed Unexecuted instantiation: internal.c:rotlFixed |
109 | | |
110 | | /* This routine performs a right circular arithmetic shift of <x> by <y> value. */ |
111 | | WC_MISC_STATIC WC_INLINE word32 rotrFixed(word32 x, word32 y) |
112 | 66.5M | { |
113 | 66.5M | return (x >> y) | (x << (sizeof(x) * 8 - y)); |
114 | 66.5M | } Line | Count | Source | 112 | 16.4k | { | 113 | 16.4k | return (x >> y) | (x << (sizeof(x) * 8 - y)); | 114 | 16.4k | } |
Unexecuted instantiation: asn.c:rotrFixed Unexecuted instantiation: camellia.c:rotrFixed Unexecuted instantiation: chacha.c:rotrFixed Unexecuted instantiation: chacha20_poly1305.c:rotrFixed Unexecuted instantiation: cmac.c:rotrFixed Unexecuted instantiation: coding.c:rotrFixed Unexecuted instantiation: curve25519.c:rotrFixed Unexecuted instantiation: curve448.c:rotrFixed Unexecuted instantiation: des3.c:rotrFixed Unexecuted instantiation: dh.c:rotrFixed Unexecuted instantiation: ecc.c:rotrFixed Unexecuted instantiation: eccsi.c:rotrFixed Unexecuted instantiation: ed25519.c:rotrFixed Unexecuted instantiation: ed448.c:rotrFixed Unexecuted instantiation: fe_448.c:rotrFixed Unexecuted instantiation: fe_operations.c:rotrFixed Unexecuted instantiation: ge_448.c:rotrFixed Unexecuted instantiation: ge_operations.c:rotrFixed Unexecuted instantiation: hash.c:rotrFixed Unexecuted instantiation: hmac.c:rotrFixed Unexecuted instantiation: kdf.c:rotrFixed Unexecuted instantiation: md2.c:rotrFixed Unexecuted instantiation: md4.c:rotrFixed Unexecuted instantiation: md5.c:rotrFixed Unexecuted instantiation: poly1305.c:rotrFixed Unexecuted instantiation: pwdbased.c:rotrFixed Line | Count | Source | 112 | 11.4k | { | 113 | 11.4k | return (x >> y) | (x << (sizeof(x) * 8 - y)); | 114 | 11.4k | } |
Unexecuted instantiation: ripemd.c:rotrFixed Unexecuted instantiation: rsa.c:rotrFixed Line | Count | Source | 112 | 2.33M | { | 113 | 2.33M | return (x >> y) | (x << (sizeof(x) * 8 - y)); | 114 | 2.33M | } |
Line | Count | Source | 112 | 60.9M | { | 113 | 60.9M | return (x >> y) | (x << (sizeof(x) * 8 - y)); | 114 | 60.9M | } |
Unexecuted instantiation: sha3.c:rotrFixed Unexecuted instantiation: sha512.c:rotrFixed Unexecuted instantiation: siphash.c:rotrFixed Unexecuted instantiation: sm2.c:rotrFixed Line | Count | Source | 112 | 3.21M | { | 113 | 3.21M | return (x >> y) | (x << (sizeof(x) * 8 - y)); | 114 | 3.21M | } |
Unexecuted instantiation: sm4.c:rotrFixed Unexecuted instantiation: sp_int.c:rotrFixed Unexecuted instantiation: wc_encrypt.c:rotrFixed Unexecuted instantiation: wolfmath.c:rotrFixed Unexecuted instantiation: ssl.c:rotrFixed Unexecuted instantiation: tls.c:rotrFixed Unexecuted instantiation: tls13.c:rotrFixed Unexecuted instantiation: internal.c:rotrFixed |
115 | | |
116 | | #endif |
117 | | |
118 | | /* This routine performs a left circular arithmetic shift of <x> by <y> value */ |
119 | | WC_MISC_STATIC WC_INLINE word16 rotlFixed16(word16 x, word16 y) |
120 | 0 | { |
121 | 0 | return (x << y) | (x >> (sizeof(x) * 8 - y)); |
122 | 0 | } Unexecuted instantiation: aes.c:rotlFixed16 Unexecuted instantiation: asn.c:rotlFixed16 Unexecuted instantiation: camellia.c:rotlFixed16 Unexecuted instantiation: chacha.c:rotlFixed16 Unexecuted instantiation: chacha20_poly1305.c:rotlFixed16 Unexecuted instantiation: cmac.c:rotlFixed16 Unexecuted instantiation: coding.c:rotlFixed16 Unexecuted instantiation: curve25519.c:rotlFixed16 Unexecuted instantiation: curve448.c:rotlFixed16 Unexecuted instantiation: des3.c:rotlFixed16 Unexecuted instantiation: dh.c:rotlFixed16 Unexecuted instantiation: ecc.c:rotlFixed16 Unexecuted instantiation: eccsi.c:rotlFixed16 Unexecuted instantiation: ed25519.c:rotlFixed16 Unexecuted instantiation: ed448.c:rotlFixed16 Unexecuted instantiation: fe_448.c:rotlFixed16 Unexecuted instantiation: fe_operations.c:rotlFixed16 Unexecuted instantiation: ge_448.c:rotlFixed16 Unexecuted instantiation: ge_operations.c:rotlFixed16 Unexecuted instantiation: hash.c:rotlFixed16 Unexecuted instantiation: hmac.c:rotlFixed16 Unexecuted instantiation: kdf.c:rotlFixed16 Unexecuted instantiation: md2.c:rotlFixed16 Unexecuted instantiation: md4.c:rotlFixed16 Unexecuted instantiation: md5.c:rotlFixed16 Unexecuted instantiation: poly1305.c:rotlFixed16 Unexecuted instantiation: pwdbased.c:rotlFixed16 Unexecuted instantiation: random.c:rotlFixed16 Unexecuted instantiation: ripemd.c:rotlFixed16 Unexecuted instantiation: rsa.c:rotlFixed16 Unexecuted instantiation: sha.c:rotlFixed16 Unexecuted instantiation: sha256.c:rotlFixed16 Unexecuted instantiation: sha3.c:rotlFixed16 Unexecuted instantiation: sha512.c:rotlFixed16 Unexecuted instantiation: siphash.c:rotlFixed16 Unexecuted instantiation: sm2.c:rotlFixed16 Unexecuted instantiation: sm3.c:rotlFixed16 Unexecuted instantiation: sm4.c:rotlFixed16 Unexecuted instantiation: sp_int.c:rotlFixed16 Unexecuted instantiation: wc_encrypt.c:rotlFixed16 Unexecuted instantiation: wolfmath.c:rotlFixed16 Unexecuted instantiation: ssl.c:rotlFixed16 Unexecuted instantiation: tls.c:rotlFixed16 Unexecuted instantiation: tls13.c:rotlFixed16 Unexecuted instantiation: internal.c:rotlFixed16 |
123 | | |
124 | | |
125 | | /* This routine performs a right circular arithmetic shift of <x> by <y> value */ |
126 | | WC_MISC_STATIC WC_INLINE word16 rotrFixed16(word16 x, word16 y) |
127 | 0 | { |
128 | 0 | return (x >> y) | (x << (sizeof(x) * 8 - y)); |
129 | 0 | } Unexecuted instantiation: aes.c:rotrFixed16 Unexecuted instantiation: asn.c:rotrFixed16 Unexecuted instantiation: camellia.c:rotrFixed16 Unexecuted instantiation: chacha.c:rotrFixed16 Unexecuted instantiation: chacha20_poly1305.c:rotrFixed16 Unexecuted instantiation: cmac.c:rotrFixed16 Unexecuted instantiation: coding.c:rotrFixed16 Unexecuted instantiation: curve25519.c:rotrFixed16 Unexecuted instantiation: curve448.c:rotrFixed16 Unexecuted instantiation: des3.c:rotrFixed16 Unexecuted instantiation: dh.c:rotrFixed16 Unexecuted instantiation: ecc.c:rotrFixed16 Unexecuted instantiation: eccsi.c:rotrFixed16 Unexecuted instantiation: ed25519.c:rotrFixed16 Unexecuted instantiation: ed448.c:rotrFixed16 Unexecuted instantiation: fe_448.c:rotrFixed16 Unexecuted instantiation: fe_operations.c:rotrFixed16 Unexecuted instantiation: ge_448.c:rotrFixed16 Unexecuted instantiation: ge_operations.c:rotrFixed16 Unexecuted instantiation: hash.c:rotrFixed16 Unexecuted instantiation: hmac.c:rotrFixed16 Unexecuted instantiation: kdf.c:rotrFixed16 Unexecuted instantiation: md2.c:rotrFixed16 Unexecuted instantiation: md4.c:rotrFixed16 Unexecuted instantiation: md5.c:rotrFixed16 Unexecuted instantiation: poly1305.c:rotrFixed16 Unexecuted instantiation: pwdbased.c:rotrFixed16 Unexecuted instantiation: random.c:rotrFixed16 Unexecuted instantiation: ripemd.c:rotrFixed16 Unexecuted instantiation: rsa.c:rotrFixed16 Unexecuted instantiation: sha.c:rotrFixed16 Unexecuted instantiation: sha256.c:rotrFixed16 Unexecuted instantiation: sha3.c:rotrFixed16 Unexecuted instantiation: sha512.c:rotrFixed16 Unexecuted instantiation: siphash.c:rotrFixed16 Unexecuted instantiation: sm2.c:rotrFixed16 Unexecuted instantiation: sm3.c:rotrFixed16 Unexecuted instantiation: sm4.c:rotrFixed16 Unexecuted instantiation: sp_int.c:rotrFixed16 Unexecuted instantiation: wc_encrypt.c:rotrFixed16 Unexecuted instantiation: wolfmath.c:rotrFixed16 Unexecuted instantiation: ssl.c:rotrFixed16 Unexecuted instantiation: tls.c:rotrFixed16 Unexecuted instantiation: tls13.c:rotrFixed16 Unexecuted instantiation: internal.c:rotrFixed16 |
130 | | |
131 | | /* This routine performs a byte swap of 32-bit word value. */ |
132 | | #if defined(__CCRX__) && !defined(NO_INLINE) /* shortest version for CC-RX */ |
133 | | #define ByteReverseWord32(value) _builtin_revl(value) |
134 | | #else |
135 | | WC_MISC_STATIC WC_INLINE word32 ByteReverseWord32(word32 value) |
136 | 7.42M | { |
137 | | #ifdef PPC_INTRINSICS |
138 | | /* PPC: load reverse indexed instruction */ |
139 | | return (word32)__lwbrx(&value,0); |
140 | | #elif defined(__ICCARM__) |
141 | | return (word32)__REV(value); |
142 | | #elif defined(KEIL_INTRINSICS) |
143 | | return (word32)__rev(value); |
144 | | #elif defined(__CCRX__) |
145 | | return (word32)_builtin_revl(value); |
146 | | #elif defined(WOLF_ALLOW_BUILTIN) && \ |
147 | | defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) |
148 | | return (word32)__builtin_bswap32(value); |
149 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ |
150 | | defined(__aarch64__) |
151 | | __asm__ volatile ( |
152 | | "REV32 %0, %0 \n" |
153 | | : "+r" (value) |
154 | | : |
155 | | ); |
156 | | return value; |
157 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ |
158 | | (defined(__thumb__) || defined(__arm__)) |
159 | | __asm__ volatile ( |
160 | | "REV %0, %0 \n" |
161 | | : "+r" (value) |
162 | | : |
163 | | ); |
164 | | return value; |
165 | | #elif defined(FAST_ROTATE) |
166 | | /* 5 instructions with rotate instruction, 9 without */ |
167 | 7.42M | return (rotrFixed(value, 8U) & 0xff00ff00) | |
168 | 7.42M | (rotlFixed(value, 8U) & 0x00ff00ff); |
169 | | #else |
170 | | /* 6 instructions with rotate instruction, 8 without */ |
171 | | value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); |
172 | | return rotlFixed(value, 16U); |
173 | | #endif |
174 | 7.42M | } Line | Count | Source | 136 | 16.4k | { | 137 | | #ifdef PPC_INTRINSICS | 138 | | /* PPC: load reverse indexed instruction */ | 139 | | return (word32)__lwbrx(&value,0); | 140 | | #elif defined(__ICCARM__) | 141 | | return (word32)__REV(value); | 142 | | #elif defined(KEIL_INTRINSICS) | 143 | | return (word32)__rev(value); | 144 | | #elif defined(__CCRX__) | 145 | | return (word32)_builtin_revl(value); | 146 | | #elif defined(WOLF_ALLOW_BUILTIN) && \ | 147 | | defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) | 148 | | return (word32)__builtin_bswap32(value); | 149 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 150 | | defined(__aarch64__) | 151 | | __asm__ volatile ( | 152 | | "REV32 %0, %0 \n" | 153 | | : "+r" (value) | 154 | | : | 155 | | ); | 156 | | return value; | 157 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 158 | | (defined(__thumb__) || defined(__arm__)) | 159 | | __asm__ volatile ( | 160 | | "REV %0, %0 \n" | 161 | | : "+r" (value) | 162 | | : | 163 | | ); | 164 | | return value; | 165 | | #elif defined(FAST_ROTATE) | 166 | | /* 5 instructions with rotate instruction, 9 without */ | 167 | 16.4k | return (rotrFixed(value, 8U) & 0xff00ff00) | | 168 | 16.4k | (rotlFixed(value, 8U) & 0x00ff00ff); | 169 | | #else | 170 | | /* 6 instructions with rotate instruction, 8 without */ | 171 | | value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); | 172 | | return rotlFixed(value, 16U); | 173 | | #endif | 174 | 16.4k | } |
Unexecuted instantiation: asn.c:ByteReverseWord32 Unexecuted instantiation: camellia.c:ByteReverseWord32 Unexecuted instantiation: chacha.c:ByteReverseWord32 Unexecuted instantiation: chacha20_poly1305.c:ByteReverseWord32 Unexecuted instantiation: cmac.c:ByteReverseWord32 Unexecuted instantiation: coding.c:ByteReverseWord32 Unexecuted instantiation: curve25519.c:ByteReverseWord32 Unexecuted instantiation: curve448.c:ByteReverseWord32 Unexecuted instantiation: des3.c:ByteReverseWord32 Unexecuted instantiation: dh.c:ByteReverseWord32 Unexecuted instantiation: ecc.c:ByteReverseWord32 Unexecuted instantiation: eccsi.c:ByteReverseWord32 Unexecuted instantiation: ed25519.c:ByteReverseWord32 Unexecuted instantiation: ed448.c:ByteReverseWord32 Unexecuted instantiation: fe_448.c:ByteReverseWord32 Unexecuted instantiation: fe_operations.c:ByteReverseWord32 Unexecuted instantiation: ge_448.c:ByteReverseWord32 Unexecuted instantiation: ge_operations.c:ByteReverseWord32 Unexecuted instantiation: hash.c:ByteReverseWord32 Unexecuted instantiation: hmac.c:ByteReverseWord32 Unexecuted instantiation: kdf.c:ByteReverseWord32 Unexecuted instantiation: md2.c:ByteReverseWord32 Unexecuted instantiation: md4.c:ByteReverseWord32 Unexecuted instantiation: md5.c:ByteReverseWord32 Unexecuted instantiation: poly1305.c:ByteReverseWord32 Unexecuted instantiation: pwdbased.c:ByteReverseWord32 random.c:ByteReverseWord32 Line | Count | Source | 136 | 11.4k | { | 137 | | #ifdef PPC_INTRINSICS | 138 | | /* PPC: load reverse indexed instruction */ | 139 | | return (word32)__lwbrx(&value,0); | 140 | | #elif defined(__ICCARM__) | 141 | | return (word32)__REV(value); | 142 | | #elif defined(KEIL_INTRINSICS) | 143 | | return (word32)__rev(value); | 144 | | #elif defined(__CCRX__) | 145 | | return (word32)_builtin_revl(value); | 146 | | #elif defined(WOLF_ALLOW_BUILTIN) && \ | 147 | | defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) | 148 | | return (word32)__builtin_bswap32(value); | 149 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 150 | | defined(__aarch64__) | 151 | | __asm__ volatile ( | 152 | | "REV32 %0, %0 \n" | 153 | | : "+r" (value) | 154 | | : | 155 | | ); | 156 | | return value; | 157 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 158 | | (defined(__thumb__) || defined(__arm__)) | 159 | | __asm__ volatile ( | 160 | | "REV %0, %0 \n" | 161 | | : "+r" (value) | 162 | | : | 163 | | ); | 164 | | return value; | 165 | | #elif defined(FAST_ROTATE) | 166 | | /* 5 instructions with rotate instruction, 9 without */ | 167 | 11.4k | return (rotrFixed(value, 8U) & 0xff00ff00) | | 168 | 11.4k | (rotlFixed(value, 8U) & 0x00ff00ff); | 169 | | #else | 170 | | /* 6 instructions with rotate instruction, 8 without */ | 171 | | value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); | 172 | | return rotlFixed(value, 16U); | 173 | | #endif | 174 | 11.4k | } |
Unexecuted instantiation: ripemd.c:ByteReverseWord32 Unexecuted instantiation: rsa.c:ByteReverseWord32 Line | Count | Source | 136 | 2.33M | { | 137 | | #ifdef PPC_INTRINSICS | 138 | | /* PPC: load reverse indexed instruction */ | 139 | | return (word32)__lwbrx(&value,0); | 140 | | #elif defined(__ICCARM__) | 141 | | return (word32)__REV(value); | 142 | | #elif defined(KEIL_INTRINSICS) | 143 | | return (word32)__rev(value); | 144 | | #elif defined(__CCRX__) | 145 | | return (word32)_builtin_revl(value); | 146 | | #elif defined(WOLF_ALLOW_BUILTIN) && \ | 147 | | defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) | 148 | | return (word32)__builtin_bswap32(value); | 149 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 150 | | defined(__aarch64__) | 151 | | __asm__ volatile ( | 152 | | "REV32 %0, %0 \n" | 153 | | : "+r" (value) | 154 | | : | 155 | | ); | 156 | | return value; | 157 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 158 | | (defined(__thumb__) || defined(__arm__)) | 159 | | __asm__ volatile ( | 160 | | "REV %0, %0 \n" | 161 | | : "+r" (value) | 162 | | : | 163 | | ); | 164 | | return value; | 165 | | #elif defined(FAST_ROTATE) | 166 | | /* 5 instructions with rotate instruction, 9 without */ | 167 | 2.33M | return (rotrFixed(value, 8U) & 0xff00ff00) | | 168 | 2.33M | (rotlFixed(value, 8U) & 0x00ff00ff); | 169 | | #else | 170 | | /* 6 instructions with rotate instruction, 8 without */ | 171 | | value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); | 172 | | return rotlFixed(value, 16U); | 173 | | #endif | 174 | 2.33M | } |
sha256.c:ByteReverseWord32 Line | Count | Source | 136 | 1.84M | { | 137 | | #ifdef PPC_INTRINSICS | 138 | | /* PPC: load reverse indexed instruction */ | 139 | | return (word32)__lwbrx(&value,0); | 140 | | #elif defined(__ICCARM__) | 141 | | return (word32)__REV(value); | 142 | | #elif defined(KEIL_INTRINSICS) | 143 | | return (word32)__rev(value); | 144 | | #elif defined(__CCRX__) | 145 | | return (word32)_builtin_revl(value); | 146 | | #elif defined(WOLF_ALLOW_BUILTIN) && \ | 147 | | defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) | 148 | | return (word32)__builtin_bswap32(value); | 149 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 150 | | defined(__aarch64__) | 151 | | __asm__ volatile ( | 152 | | "REV32 %0, %0 \n" | 153 | | : "+r" (value) | 154 | | : | 155 | | ); | 156 | | return value; | 157 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 158 | | (defined(__thumb__) || defined(__arm__)) | 159 | | __asm__ volatile ( | 160 | | "REV %0, %0 \n" | 161 | | : "+r" (value) | 162 | | : | 163 | | ); | 164 | | return value; | 165 | | #elif defined(FAST_ROTATE) | 166 | | /* 5 instructions with rotate instruction, 9 without */ | 167 | 1.84M | return (rotrFixed(value, 8U) & 0xff00ff00) | | 168 | 1.84M | (rotlFixed(value, 8U) & 0x00ff00ff); | 169 | | #else | 170 | | /* 6 instructions with rotate instruction, 8 without */ | 171 | | value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); | 172 | | return rotlFixed(value, 16U); | 173 | | #endif | 174 | 1.84M | } |
Unexecuted instantiation: sha3.c:ByteReverseWord32 Unexecuted instantiation: sha512.c:ByteReverseWord32 Unexecuted instantiation: siphash.c:ByteReverseWord32 Unexecuted instantiation: sm2.c:ByteReverseWord32 Line | Count | Source | 136 | 3.21M | { | 137 | | #ifdef PPC_INTRINSICS | 138 | | /* PPC: load reverse indexed instruction */ | 139 | | return (word32)__lwbrx(&value,0); | 140 | | #elif defined(__ICCARM__) | 141 | | return (word32)__REV(value); | 142 | | #elif defined(KEIL_INTRINSICS) | 143 | | return (word32)__rev(value); | 144 | | #elif defined(__CCRX__) | 145 | | return (word32)_builtin_revl(value); | 146 | | #elif defined(WOLF_ALLOW_BUILTIN) && \ | 147 | | defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) | 148 | | return (word32)__builtin_bswap32(value); | 149 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 150 | | defined(__aarch64__) | 151 | | __asm__ volatile ( | 152 | | "REV32 %0, %0 \n" | 153 | | : "+r" (value) | 154 | | : | 155 | | ); | 156 | | return value; | 157 | | #elif defined(WOLFSSL_BYTESWAP32_ASM) && defined(__GNUC__) && \ | 158 | | (defined(__thumb__) || defined(__arm__)) | 159 | | __asm__ volatile ( | 160 | | "REV %0, %0 \n" | 161 | | : "+r" (value) | 162 | | : | 163 | | ); | 164 | | return value; | 165 | | #elif defined(FAST_ROTATE) | 166 | | /* 5 instructions with rotate instruction, 9 without */ | 167 | 3.21M | return (rotrFixed(value, 8U) & 0xff00ff00) | | 168 | 3.21M | (rotlFixed(value, 8U) & 0x00ff00ff); | 169 | | #else | 170 | | /* 6 instructions with rotate instruction, 8 without */ | 171 | | value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); | 172 | | return rotlFixed(value, 16U); | 173 | | #endif | 174 | 3.21M | } |
Unexecuted instantiation: sm4.c:ByteReverseWord32 Unexecuted instantiation: sp_int.c:ByteReverseWord32 Unexecuted instantiation: wc_encrypt.c:ByteReverseWord32 Unexecuted instantiation: wolfmath.c:ByteReverseWord32 Unexecuted instantiation: ssl.c:ByteReverseWord32 Unexecuted instantiation: tls.c:ByteReverseWord32 Unexecuted instantiation: tls13.c:ByteReverseWord32 Unexecuted instantiation: internal.c:ByteReverseWord32 |
175 | | #endif /* __CCRX__ */ |
176 | | /* This routine performs a byte swap of words array of a given count. */ |
177 | | WC_MISC_STATIC WC_INLINE void ByteReverseWords(word32* out, const word32* in, |
178 | | word32 byteCount) |
179 | 284k | { |
180 | 284k | word32 i; |
181 | | |
182 | 284k | #ifdef WOLFSSL_USE_ALIGN |
183 | 284k | if ((((size_t)in & 0x3) == 0) && |
184 | 284k | (((size_t)out & 0x3) == 0)) |
185 | 284k | #endif |
186 | 284k | { |
187 | 284k | word32 count = byteCount/(word32)sizeof(word32); |
188 | 4.47M | for (i = 0; i < count; i++) |
189 | 4.19M | out[i] = ByteReverseWord32(in[i]); |
190 | 284k | } |
191 | 0 | #ifdef WOLFSSL_USE_ALIGN |
192 | 0 | else { |
193 | 0 | byte *in_bytes = (byte *)in; |
194 | 0 | byte *out_bytes = (byte *)out; |
195 | 0 | word32 scratch; |
196 | |
|
197 | 0 | byteCount &= ~0x3U; |
198 | |
|
199 | 0 | for (i = 0; i < byteCount; i += sizeof(word32)) { |
200 | 0 | XMEMCPY(&scratch, in_bytes + i, sizeof(scratch)); |
201 | 0 | scratch = ByteReverseWord32(scratch); |
202 | 0 | XMEMCPY(out_bytes + i, &scratch, sizeof(scratch)); |
203 | 0 | } |
204 | 0 | } |
205 | 284k | #endif |
206 | 284k | } Line | Count | Source | 179 | 80 | { | 180 | 80 | word32 i; | 181 | | | 182 | 80 | #ifdef WOLFSSL_USE_ALIGN | 183 | 80 | if ((((size_t)in & 0x3) == 0) && | 184 | 80 | (((size_t)out & 0x3) == 0)) | 185 | 80 | #endif | 186 | 80 | { | 187 | 80 | word32 count = byteCount/(word32)sizeof(word32); | 188 | 488 | for (i = 0; i < count; i++) | 189 | 408 | out[i] = ByteReverseWord32(in[i]); | 190 | 80 | } | 191 | 0 | #ifdef WOLFSSL_USE_ALIGN | 192 | 0 | else { | 193 | 0 | byte *in_bytes = (byte *)in; | 194 | 0 | byte *out_bytes = (byte *)out; | 195 | 0 | word32 scratch; | 196 | |
| 197 | 0 | byteCount &= ~0x3U; | 198 | |
| 199 | 0 | for (i = 0; i < byteCount; i += sizeof(word32)) { | 200 | 0 | XMEMCPY(&scratch, in_bytes + i, sizeof(scratch)); | 201 | 0 | scratch = ByteReverseWord32(scratch); | 202 | 0 | XMEMCPY(out_bytes + i, &scratch, sizeof(scratch)); | 203 | 0 | } | 204 | 0 | } | 205 | 80 | #endif | 206 | 80 | } |
Unexecuted instantiation: asn.c:ByteReverseWords Unexecuted instantiation: camellia.c:ByteReverseWords Unexecuted instantiation: chacha.c:ByteReverseWords Unexecuted instantiation: chacha20_poly1305.c:ByteReverseWords Unexecuted instantiation: cmac.c:ByteReverseWords Unexecuted instantiation: coding.c:ByteReverseWords Unexecuted instantiation: curve25519.c:ByteReverseWords Unexecuted instantiation: curve448.c:ByteReverseWords Unexecuted instantiation: des3.c:ByteReverseWords Unexecuted instantiation: dh.c:ByteReverseWords Unexecuted instantiation: ecc.c:ByteReverseWords Unexecuted instantiation: eccsi.c:ByteReverseWords Unexecuted instantiation: ed25519.c:ByteReverseWords Unexecuted instantiation: ed448.c:ByteReverseWords Unexecuted instantiation: fe_448.c:ByteReverseWords Unexecuted instantiation: fe_operations.c:ByteReverseWords Unexecuted instantiation: ge_448.c:ByteReverseWords Unexecuted instantiation: ge_operations.c:ByteReverseWords Unexecuted instantiation: hash.c:ByteReverseWords Unexecuted instantiation: hmac.c:ByteReverseWords Unexecuted instantiation: kdf.c:ByteReverseWords Unexecuted instantiation: md2.c:ByteReverseWords Unexecuted instantiation: md4.c:ByteReverseWords Unexecuted instantiation: md5.c:ByteReverseWords Unexecuted instantiation: poly1305.c:ByteReverseWords Unexecuted instantiation: pwdbased.c:ByteReverseWords Unexecuted instantiation: random.c:ByteReverseWords Unexecuted instantiation: ripemd.c:ByteReverseWords Unexecuted instantiation: rsa.c:ByteReverseWords Line | Count | Source | 179 | 147k | { | 180 | 147k | word32 i; | 181 | | | 182 | 147k | #ifdef WOLFSSL_USE_ALIGN | 183 | 147k | if ((((size_t)in & 0x3) == 0) && | 184 | 147k | (((size_t)out & 0x3) == 0)) | 185 | 147k | #endif | 186 | 147k | { | 187 | 147k | word32 count = byteCount/(word32)sizeof(word32); | 188 | 2.48M | for (i = 0; i < count; i++) | 189 | 2.33M | out[i] = ByteReverseWord32(in[i]); | 190 | 147k | } | 191 | 0 | #ifdef WOLFSSL_USE_ALIGN | 192 | 0 | else { | 193 | 0 | byte *in_bytes = (byte *)in; | 194 | 0 | byte *out_bytes = (byte *)out; | 195 | 0 | word32 scratch; | 196 | |
| 197 | 0 | byteCount &= ~0x3U; | 198 | |
| 199 | 0 | for (i = 0; i < byteCount; i += sizeof(word32)) { | 200 | 0 | XMEMCPY(&scratch, in_bytes + i, sizeof(scratch)); | 201 | 0 | scratch = ByteReverseWord32(scratch); | 202 | 0 | XMEMCPY(out_bytes + i, &scratch, sizeof(scratch)); | 203 | 0 | } | 204 | 0 | } | 205 | 147k | #endif | 206 | 147k | } |
sha256.c:ByteReverseWords Line | Count | Source | 179 | 135k | { | 180 | 135k | word32 i; | 181 | | | 182 | 135k | #ifdef WOLFSSL_USE_ALIGN | 183 | 135k | if ((((size_t)in & 0x3) == 0) && | 184 | 135k | (((size_t)out & 0x3) == 0)) | 185 | 135k | #endif | 186 | 135k | { | 187 | 135k | word32 count = byteCount/(word32)sizeof(word32); | 188 | 1.97M | for (i = 0; i < count; i++) | 189 | 1.84M | out[i] = ByteReverseWord32(in[i]); | 190 | 135k | } | 191 | 0 | #ifdef WOLFSSL_USE_ALIGN | 192 | 0 | else { | 193 | 0 | byte *in_bytes = (byte *)in; | 194 | 0 | byte *out_bytes = (byte *)out; | 195 | 0 | word32 scratch; | 196 | |
| 197 | 0 | byteCount &= ~0x3U; | 198 | |
| 199 | 0 | for (i = 0; i < byteCount; i += sizeof(word32)) { | 200 | 0 | XMEMCPY(&scratch, in_bytes + i, sizeof(scratch)); | 201 | 0 | scratch = ByteReverseWord32(scratch); | 202 | 0 | XMEMCPY(out_bytes + i, &scratch, sizeof(scratch)); | 203 | 0 | } | 204 | 0 | } | 205 | 135k | #endif | 206 | 135k | } |
Unexecuted instantiation: sha3.c:ByteReverseWords Unexecuted instantiation: sha512.c:ByteReverseWords Unexecuted instantiation: siphash.c:ByteReverseWords Unexecuted instantiation: sm2.c:ByteReverseWords Line | Count | Source | 179 | 1.75k | { | 180 | 1.75k | word32 i; | 181 | | | 182 | 1.75k | #ifdef WOLFSSL_USE_ALIGN | 183 | 1.75k | if ((((size_t)in & 0x3) == 0) && | 184 | 1.75k | (((size_t)out & 0x3) == 0)) | 185 | 1.75k | #endif | 186 | 1.75k | { | 187 | 1.75k | word32 count = byteCount/(word32)sizeof(word32); | 188 | 13.3k | for (i = 0; i < count; i++) | 189 | 11.5k | out[i] = ByteReverseWord32(in[i]); | 190 | 1.75k | } | 191 | 0 | #ifdef WOLFSSL_USE_ALIGN | 192 | 0 | else { | 193 | 0 | byte *in_bytes = (byte *)in; | 194 | 0 | byte *out_bytes = (byte *)out; | 195 | 0 | word32 scratch; | 196 | |
| 197 | 0 | byteCount &= ~0x3U; | 198 | |
| 199 | 0 | for (i = 0; i < byteCount; i += sizeof(word32)) { | 200 | 0 | XMEMCPY(&scratch, in_bytes + i, sizeof(scratch)); | 201 | 0 | scratch = ByteReverseWord32(scratch); | 202 | 0 | XMEMCPY(out_bytes + i, &scratch, sizeof(scratch)); | 203 | 0 | } | 204 | 0 | } | 205 | 1.75k | #endif | 206 | 1.75k | } |
Unexecuted instantiation: sm4.c:ByteReverseWords Unexecuted instantiation: sp_int.c:ByteReverseWords Unexecuted instantiation: wc_encrypt.c:ByteReverseWords Unexecuted instantiation: wolfmath.c:ByteReverseWords Unexecuted instantiation: ssl.c:ByteReverseWords Unexecuted instantiation: tls.c:ByteReverseWords Unexecuted instantiation: tls13.c:ByteReverseWords Unexecuted instantiation: internal.c:ByteReverseWords |
207 | | |
208 | | WC_MISC_STATIC WC_INLINE word32 readUnalignedWord32(const byte *in) |
209 | 0 | { |
210 | 0 | if (((wc_ptr_t)in & (wc_ptr_t)(sizeof(word32) - 1U)) == (wc_ptr_t)0) |
211 | 0 | return *(word32 *)in; |
212 | 0 | else { |
213 | 0 | word32 out = 0; /* else CONFIG_FORTIFY_SOURCE -Wmaybe-uninitialized */ |
214 | 0 | XMEMCPY(&out, in, sizeof(out)); |
215 | 0 | return out; |
216 | 0 | } |
217 | 0 | } Unexecuted instantiation: aes.c:readUnalignedWord32 Unexecuted instantiation: asn.c:readUnalignedWord32 Unexecuted instantiation: camellia.c:readUnalignedWord32 Unexecuted instantiation: chacha.c:readUnalignedWord32 Unexecuted instantiation: chacha20_poly1305.c:readUnalignedWord32 Unexecuted instantiation: cmac.c:readUnalignedWord32 Unexecuted instantiation: coding.c:readUnalignedWord32 Unexecuted instantiation: curve25519.c:readUnalignedWord32 Unexecuted instantiation: curve448.c:readUnalignedWord32 Unexecuted instantiation: des3.c:readUnalignedWord32 Unexecuted instantiation: dh.c:readUnalignedWord32 Unexecuted instantiation: ecc.c:readUnalignedWord32 Unexecuted instantiation: eccsi.c:readUnalignedWord32 Unexecuted instantiation: ed25519.c:readUnalignedWord32 Unexecuted instantiation: ed448.c:readUnalignedWord32 Unexecuted instantiation: fe_448.c:readUnalignedWord32 Unexecuted instantiation: fe_operations.c:readUnalignedWord32 Unexecuted instantiation: ge_448.c:readUnalignedWord32 Unexecuted instantiation: ge_operations.c:readUnalignedWord32 Unexecuted instantiation: hash.c:readUnalignedWord32 Unexecuted instantiation: hmac.c:readUnalignedWord32 Unexecuted instantiation: kdf.c:readUnalignedWord32 Unexecuted instantiation: md2.c:readUnalignedWord32 Unexecuted instantiation: md4.c:readUnalignedWord32 Unexecuted instantiation: md5.c:readUnalignedWord32 Unexecuted instantiation: poly1305.c:readUnalignedWord32 Unexecuted instantiation: pwdbased.c:readUnalignedWord32 Unexecuted instantiation: random.c:readUnalignedWord32 Unexecuted instantiation: ripemd.c:readUnalignedWord32 Unexecuted instantiation: rsa.c:readUnalignedWord32 Unexecuted instantiation: sha.c:readUnalignedWord32 Unexecuted instantiation: sha256.c:readUnalignedWord32 Unexecuted instantiation: sha3.c:readUnalignedWord32 Unexecuted instantiation: sha512.c:readUnalignedWord32 Unexecuted instantiation: siphash.c:readUnalignedWord32 Unexecuted instantiation: sm2.c:readUnalignedWord32 Unexecuted instantiation: sm3.c:readUnalignedWord32 Unexecuted instantiation: sm4.c:readUnalignedWord32 Unexecuted instantiation: sp_int.c:readUnalignedWord32 Unexecuted instantiation: wc_encrypt.c:readUnalignedWord32 Unexecuted instantiation: wolfmath.c:readUnalignedWord32 Unexecuted instantiation: ssl.c:readUnalignedWord32 Unexecuted instantiation: tls.c:readUnalignedWord32 Unexecuted instantiation: tls13.c:readUnalignedWord32 Unexecuted instantiation: internal.c:readUnalignedWord32 |
218 | | |
219 | | WC_MISC_STATIC WC_INLINE word32 writeUnalignedWord32(void *out, word32 in) |
220 | 0 | { |
221 | 0 | if (((wc_ptr_t)out & (wc_ptr_t)(sizeof(word32) - 1U)) == (wc_ptr_t)0) |
222 | 0 | *(word32 *)out = in; |
223 | 0 | else { |
224 | 0 | XMEMCPY(out, &in, sizeof(in)); |
225 | 0 | } |
226 | 0 | return in; |
227 | 0 | } Unexecuted instantiation: aes.c:writeUnalignedWord32 Unexecuted instantiation: asn.c:writeUnalignedWord32 Unexecuted instantiation: camellia.c:writeUnalignedWord32 Unexecuted instantiation: chacha.c:writeUnalignedWord32 Unexecuted instantiation: chacha20_poly1305.c:writeUnalignedWord32 Unexecuted instantiation: cmac.c:writeUnalignedWord32 Unexecuted instantiation: coding.c:writeUnalignedWord32 Unexecuted instantiation: curve25519.c:writeUnalignedWord32 Unexecuted instantiation: curve448.c:writeUnalignedWord32 Unexecuted instantiation: des3.c:writeUnalignedWord32 Unexecuted instantiation: dh.c:writeUnalignedWord32 Unexecuted instantiation: ecc.c:writeUnalignedWord32 Unexecuted instantiation: eccsi.c:writeUnalignedWord32 Unexecuted instantiation: ed25519.c:writeUnalignedWord32 Unexecuted instantiation: ed448.c:writeUnalignedWord32 Unexecuted instantiation: fe_448.c:writeUnalignedWord32 Unexecuted instantiation: fe_operations.c:writeUnalignedWord32 Unexecuted instantiation: ge_448.c:writeUnalignedWord32 Unexecuted instantiation: ge_operations.c:writeUnalignedWord32 Unexecuted instantiation: hash.c:writeUnalignedWord32 Unexecuted instantiation: hmac.c:writeUnalignedWord32 Unexecuted instantiation: kdf.c:writeUnalignedWord32 Unexecuted instantiation: md2.c:writeUnalignedWord32 Unexecuted instantiation: md4.c:writeUnalignedWord32 Unexecuted instantiation: md5.c:writeUnalignedWord32 Unexecuted instantiation: poly1305.c:writeUnalignedWord32 Unexecuted instantiation: pwdbased.c:writeUnalignedWord32 Unexecuted instantiation: random.c:writeUnalignedWord32 Unexecuted instantiation: ripemd.c:writeUnalignedWord32 Unexecuted instantiation: rsa.c:writeUnalignedWord32 Unexecuted instantiation: sha.c:writeUnalignedWord32 Unexecuted instantiation: sha256.c:writeUnalignedWord32 Unexecuted instantiation: sha3.c:writeUnalignedWord32 Unexecuted instantiation: sha512.c:writeUnalignedWord32 Unexecuted instantiation: siphash.c:writeUnalignedWord32 Unexecuted instantiation: sm2.c:writeUnalignedWord32 Unexecuted instantiation: sm3.c:writeUnalignedWord32 Unexecuted instantiation: sm4.c:writeUnalignedWord32 Unexecuted instantiation: sp_int.c:writeUnalignedWord32 Unexecuted instantiation: wc_encrypt.c:writeUnalignedWord32 Unexecuted instantiation: wolfmath.c:writeUnalignedWord32 Unexecuted instantiation: ssl.c:writeUnalignedWord32 Unexecuted instantiation: tls.c:writeUnalignedWord32 Unexecuted instantiation: tls13.c:writeUnalignedWord32 Unexecuted instantiation: internal.c:writeUnalignedWord32 |
228 | | |
229 | | WC_MISC_STATIC WC_INLINE void readUnalignedWords32(word32 *out, const byte *in, |
230 | | size_t count) |
231 | 0 | { |
232 | 0 | if (((wc_ptr_t)in & (wc_ptr_t)(sizeof(word32) - 1U)) == (wc_ptr_t)0) { |
233 | 0 | const word32 *in_word32 = (const word32 *)in; |
234 | 0 | while (count-- > 0) |
235 | 0 | *out++ = *in_word32++; |
236 | 0 | } |
237 | 0 | else { |
238 | 0 | XMEMCPY(out, in, count * sizeof(*out)); |
239 | 0 | } |
240 | 0 | } Unexecuted instantiation: aes.c:readUnalignedWords32 Unexecuted instantiation: asn.c:readUnalignedWords32 Unexecuted instantiation: camellia.c:readUnalignedWords32 Unexecuted instantiation: chacha.c:readUnalignedWords32 Unexecuted instantiation: chacha20_poly1305.c:readUnalignedWords32 Unexecuted instantiation: cmac.c:readUnalignedWords32 Unexecuted instantiation: coding.c:readUnalignedWords32 Unexecuted instantiation: curve25519.c:readUnalignedWords32 Unexecuted instantiation: curve448.c:readUnalignedWords32 Unexecuted instantiation: des3.c:readUnalignedWords32 Unexecuted instantiation: dh.c:readUnalignedWords32 Unexecuted instantiation: ecc.c:readUnalignedWords32 Unexecuted instantiation: eccsi.c:readUnalignedWords32 Unexecuted instantiation: ed25519.c:readUnalignedWords32 Unexecuted instantiation: ed448.c:readUnalignedWords32 Unexecuted instantiation: fe_448.c:readUnalignedWords32 Unexecuted instantiation: fe_operations.c:readUnalignedWords32 Unexecuted instantiation: ge_448.c:readUnalignedWords32 Unexecuted instantiation: ge_operations.c:readUnalignedWords32 Unexecuted instantiation: hash.c:readUnalignedWords32 Unexecuted instantiation: hmac.c:readUnalignedWords32 Unexecuted instantiation: kdf.c:readUnalignedWords32 Unexecuted instantiation: md2.c:readUnalignedWords32 Unexecuted instantiation: md4.c:readUnalignedWords32 Unexecuted instantiation: md5.c:readUnalignedWords32 Unexecuted instantiation: poly1305.c:readUnalignedWords32 Unexecuted instantiation: pwdbased.c:readUnalignedWords32 Unexecuted instantiation: random.c:readUnalignedWords32 Unexecuted instantiation: ripemd.c:readUnalignedWords32 Unexecuted instantiation: rsa.c:readUnalignedWords32 Unexecuted instantiation: sha.c:readUnalignedWords32 Unexecuted instantiation: sha256.c:readUnalignedWords32 Unexecuted instantiation: sha3.c:readUnalignedWords32 Unexecuted instantiation: sha512.c:readUnalignedWords32 Unexecuted instantiation: siphash.c:readUnalignedWords32 Unexecuted instantiation: sm2.c:readUnalignedWords32 Unexecuted instantiation: sm3.c:readUnalignedWords32 Unexecuted instantiation: sm4.c:readUnalignedWords32 Unexecuted instantiation: sp_int.c:readUnalignedWords32 Unexecuted instantiation: wc_encrypt.c:readUnalignedWords32 Unexecuted instantiation: wolfmath.c:readUnalignedWords32 Unexecuted instantiation: ssl.c:readUnalignedWords32 Unexecuted instantiation: tls.c:readUnalignedWords32 Unexecuted instantiation: tls13.c:readUnalignedWords32 Unexecuted instantiation: internal.c:readUnalignedWords32 |
241 | | |
242 | | WC_MISC_STATIC WC_INLINE void writeUnalignedWords32(byte *out, const word32 *in, |
243 | | size_t count) |
244 | 0 | { |
245 | 0 | if (((wc_ptr_t)out & (wc_ptr_t)(sizeof(word32) - 1U)) == (wc_ptr_t)0) { |
246 | 0 | word32 *out_word32 = (word32 *)out; |
247 | 0 | while (count-- > 0) |
248 | 0 | *out_word32++ = *in++; |
249 | 0 | } |
250 | 0 | else { |
251 | 0 | XMEMCPY(out, in, count * sizeof(*in)); |
252 | 0 | } |
253 | 0 | } Unexecuted instantiation: aes.c:writeUnalignedWords32 Unexecuted instantiation: asn.c:writeUnalignedWords32 Unexecuted instantiation: camellia.c:writeUnalignedWords32 Unexecuted instantiation: chacha.c:writeUnalignedWords32 Unexecuted instantiation: chacha20_poly1305.c:writeUnalignedWords32 Unexecuted instantiation: cmac.c:writeUnalignedWords32 Unexecuted instantiation: coding.c:writeUnalignedWords32 Unexecuted instantiation: curve25519.c:writeUnalignedWords32 Unexecuted instantiation: curve448.c:writeUnalignedWords32 Unexecuted instantiation: des3.c:writeUnalignedWords32 Unexecuted instantiation: dh.c:writeUnalignedWords32 Unexecuted instantiation: ecc.c:writeUnalignedWords32 Unexecuted instantiation: eccsi.c:writeUnalignedWords32 Unexecuted instantiation: ed25519.c:writeUnalignedWords32 Unexecuted instantiation: ed448.c:writeUnalignedWords32 Unexecuted instantiation: fe_448.c:writeUnalignedWords32 Unexecuted instantiation: fe_operations.c:writeUnalignedWords32 Unexecuted instantiation: ge_448.c:writeUnalignedWords32 Unexecuted instantiation: ge_operations.c:writeUnalignedWords32 Unexecuted instantiation: hash.c:writeUnalignedWords32 Unexecuted instantiation: hmac.c:writeUnalignedWords32 Unexecuted instantiation: kdf.c:writeUnalignedWords32 Unexecuted instantiation: md2.c:writeUnalignedWords32 Unexecuted instantiation: md4.c:writeUnalignedWords32 Unexecuted instantiation: md5.c:writeUnalignedWords32 Unexecuted instantiation: poly1305.c:writeUnalignedWords32 Unexecuted instantiation: pwdbased.c:writeUnalignedWords32 Unexecuted instantiation: random.c:writeUnalignedWords32 Unexecuted instantiation: ripemd.c:writeUnalignedWords32 Unexecuted instantiation: rsa.c:writeUnalignedWords32 Unexecuted instantiation: sha.c:writeUnalignedWords32 Unexecuted instantiation: sha256.c:writeUnalignedWords32 Unexecuted instantiation: sha3.c:writeUnalignedWords32 Unexecuted instantiation: sha512.c:writeUnalignedWords32 Unexecuted instantiation: siphash.c:writeUnalignedWords32 Unexecuted instantiation: sm2.c:writeUnalignedWords32 Unexecuted instantiation: sm3.c:writeUnalignedWords32 Unexecuted instantiation: sm4.c:writeUnalignedWords32 Unexecuted instantiation: sp_int.c:writeUnalignedWords32 Unexecuted instantiation: wc_encrypt.c:writeUnalignedWords32 Unexecuted instantiation: wolfmath.c:writeUnalignedWords32 Unexecuted instantiation: ssl.c:writeUnalignedWords32 Unexecuted instantiation: tls.c:writeUnalignedWords32 Unexecuted instantiation: tls13.c:writeUnalignedWords32 Unexecuted instantiation: internal.c:writeUnalignedWords32 |
254 | | |
255 | | #if defined(WORD64_AVAILABLE) && !defined(WOLFSSL_NO_WORD64_OPS) |
256 | | |
257 | | WC_MISC_STATIC WC_INLINE word64 readUnalignedWord64(const byte *in) |
258 | 2.21k | { |
259 | 2.21k | if (((wc_ptr_t)in & (wc_ptr_t)(sizeof(word64) - 1U)) == (wc_ptr_t)0) |
260 | 2.21k | return *(word64 *)in; |
261 | 0 | else { |
262 | 0 | word64 out = 0; /* else CONFIG_FORTIFY_SOURCE -Wmaybe-uninitialized */ |
263 | 0 | XMEMCPY(&out, in, sizeof(out)); |
264 | 0 | return out; |
265 | 0 | } |
266 | 2.21k | } Unexecuted instantiation: aes.c:readUnalignedWord64 Unexecuted instantiation: asn.c:readUnalignedWord64 Unexecuted instantiation: camellia.c:readUnalignedWord64 Unexecuted instantiation: chacha.c:readUnalignedWord64 Unexecuted instantiation: chacha20_poly1305.c:readUnalignedWord64 Unexecuted instantiation: cmac.c:readUnalignedWord64 Unexecuted instantiation: coding.c:readUnalignedWord64 Unexecuted instantiation: curve25519.c:readUnalignedWord64 Unexecuted instantiation: curve448.c:readUnalignedWord64 Unexecuted instantiation: des3.c:readUnalignedWord64 Unexecuted instantiation: dh.c:readUnalignedWord64 Unexecuted instantiation: ecc.c:readUnalignedWord64 Unexecuted instantiation: eccsi.c:readUnalignedWord64 Unexecuted instantiation: ed25519.c:readUnalignedWord64 Unexecuted instantiation: ed448.c:readUnalignedWord64 Unexecuted instantiation: fe_448.c:readUnalignedWord64 Unexecuted instantiation: fe_operations.c:readUnalignedWord64 Unexecuted instantiation: ge_448.c:readUnalignedWord64 Unexecuted instantiation: ge_operations.c:readUnalignedWord64 Unexecuted instantiation: hash.c:readUnalignedWord64 Unexecuted instantiation: hmac.c:readUnalignedWord64 Unexecuted instantiation: kdf.c:readUnalignedWord64 Unexecuted instantiation: md2.c:readUnalignedWord64 Unexecuted instantiation: md4.c:readUnalignedWord64 Unexecuted instantiation: md5.c:readUnalignedWord64 Unexecuted instantiation: poly1305.c:readUnalignedWord64 Unexecuted instantiation: pwdbased.c:readUnalignedWord64 Unexecuted instantiation: random.c:readUnalignedWord64 Unexecuted instantiation: ripemd.c:readUnalignedWord64 Unexecuted instantiation: rsa.c:readUnalignedWord64 Unexecuted instantiation: sha.c:readUnalignedWord64 Unexecuted instantiation: sha256.c:readUnalignedWord64 Unexecuted instantiation: sha3.c:readUnalignedWord64 Unexecuted instantiation: sha512.c:readUnalignedWord64 siphash.c:readUnalignedWord64 Line | Count | Source | 258 | 2.21k | { | 259 | 2.21k | if (((wc_ptr_t)in & (wc_ptr_t)(sizeof(word64) - 1U)) == (wc_ptr_t)0) | 260 | 2.21k | return *(word64 *)in; | 261 | 0 | else { | 262 | 0 | word64 out = 0; /* else CONFIG_FORTIFY_SOURCE -Wmaybe-uninitialized */ | 263 | 0 | XMEMCPY(&out, in, sizeof(out)); | 264 | 0 | return out; | 265 | 0 | } | 266 | 2.21k | } |
Unexecuted instantiation: sm2.c:readUnalignedWord64 Unexecuted instantiation: sm3.c:readUnalignedWord64 Unexecuted instantiation: sm4.c:readUnalignedWord64 Unexecuted instantiation: sp_int.c:readUnalignedWord64 Unexecuted instantiation: wc_encrypt.c:readUnalignedWord64 Unexecuted instantiation: wolfmath.c:readUnalignedWord64 Unexecuted instantiation: ssl.c:readUnalignedWord64 Unexecuted instantiation: tls.c:readUnalignedWord64 Unexecuted instantiation: tls13.c:readUnalignedWord64 Unexecuted instantiation: internal.c:readUnalignedWord64 |
267 | | |
268 | | WC_MISC_STATIC WC_INLINE word64 writeUnalignedWord64(void *out, word64 in) |
269 | 4 | { |
270 | 4 | if (((wc_ptr_t)out & (wc_ptr_t)(sizeof(word64) - 1U)) == (wc_ptr_t)0) |
271 | 4 | *(word64 *)out = in; |
272 | 0 | else { |
273 | 0 | XMEMCPY(out, &in, sizeof(in)); |
274 | 0 | } |
275 | 4 | return in; |
276 | 4 | } Unexecuted instantiation: aes.c:writeUnalignedWord64 Unexecuted instantiation: asn.c:writeUnalignedWord64 Unexecuted instantiation: camellia.c:writeUnalignedWord64 Unexecuted instantiation: chacha.c:writeUnalignedWord64 Unexecuted instantiation: chacha20_poly1305.c:writeUnalignedWord64 Unexecuted instantiation: cmac.c:writeUnalignedWord64 Unexecuted instantiation: coding.c:writeUnalignedWord64 Unexecuted instantiation: curve25519.c:writeUnalignedWord64 Unexecuted instantiation: curve448.c:writeUnalignedWord64 Unexecuted instantiation: des3.c:writeUnalignedWord64 Unexecuted instantiation: dh.c:writeUnalignedWord64 Unexecuted instantiation: ecc.c:writeUnalignedWord64 Unexecuted instantiation: eccsi.c:writeUnalignedWord64 Unexecuted instantiation: ed25519.c:writeUnalignedWord64 Unexecuted instantiation: ed448.c:writeUnalignedWord64 Unexecuted instantiation: fe_448.c:writeUnalignedWord64 Unexecuted instantiation: fe_operations.c:writeUnalignedWord64 Unexecuted instantiation: ge_448.c:writeUnalignedWord64 Unexecuted instantiation: ge_operations.c:writeUnalignedWord64 Unexecuted instantiation: hash.c:writeUnalignedWord64 Unexecuted instantiation: hmac.c:writeUnalignedWord64 Unexecuted instantiation: kdf.c:writeUnalignedWord64 Unexecuted instantiation: md2.c:writeUnalignedWord64 Unexecuted instantiation: md4.c:writeUnalignedWord64 Unexecuted instantiation: md5.c:writeUnalignedWord64 Unexecuted instantiation: poly1305.c:writeUnalignedWord64 Unexecuted instantiation: pwdbased.c:writeUnalignedWord64 Unexecuted instantiation: random.c:writeUnalignedWord64 Unexecuted instantiation: ripemd.c:writeUnalignedWord64 Unexecuted instantiation: rsa.c:writeUnalignedWord64 Unexecuted instantiation: sha.c:writeUnalignedWord64 Unexecuted instantiation: sha256.c:writeUnalignedWord64 Unexecuted instantiation: sha3.c:writeUnalignedWord64 Unexecuted instantiation: sha512.c:writeUnalignedWord64 siphash.c:writeUnalignedWord64 Line | Count | Source | 269 | 4 | { | 270 | 4 | if (((wc_ptr_t)out & (wc_ptr_t)(sizeof(word64) - 1U)) == (wc_ptr_t)0) | 271 | 4 | *(word64 *)out = in; | 272 | 0 | else { | 273 | 0 | XMEMCPY(out, &in, sizeof(in)); | 274 | 0 | } | 275 | 4 | return in; | 276 | 4 | } |
Unexecuted instantiation: sm2.c:writeUnalignedWord64 Unexecuted instantiation: sm3.c:writeUnalignedWord64 Unexecuted instantiation: sm4.c:writeUnalignedWord64 Unexecuted instantiation: sp_int.c:writeUnalignedWord64 Unexecuted instantiation: wc_encrypt.c:writeUnalignedWord64 Unexecuted instantiation: wolfmath.c:writeUnalignedWord64 Unexecuted instantiation: ssl.c:writeUnalignedWord64 Unexecuted instantiation: tls.c:writeUnalignedWord64 Unexecuted instantiation: tls13.c:writeUnalignedWord64 Unexecuted instantiation: internal.c:writeUnalignedWord64 |
277 | | |
278 | | WC_MISC_STATIC WC_INLINE void readUnalignedWords64(word64 *out, const byte *in, |
279 | | size_t count) |
280 | 0 | { |
281 | 0 | if (((wc_ptr_t)in & (wc_ptr_t)(sizeof(word64) - 1U)) == (wc_ptr_t)0) { |
282 | 0 | const word64 *in_word64 = (const word64 *)in; |
283 | 0 | while (count-- > 0) |
284 | 0 | *out++ = *in_word64++; |
285 | 0 | } |
286 | 0 | else { |
287 | 0 | XMEMCPY(out, in, count * sizeof(*out)); |
288 | 0 | } |
289 | 0 | } Unexecuted instantiation: aes.c:readUnalignedWords64 Unexecuted instantiation: asn.c:readUnalignedWords64 Unexecuted instantiation: camellia.c:readUnalignedWords64 Unexecuted instantiation: chacha.c:readUnalignedWords64 Unexecuted instantiation: chacha20_poly1305.c:readUnalignedWords64 Unexecuted instantiation: cmac.c:readUnalignedWords64 Unexecuted instantiation: coding.c:readUnalignedWords64 Unexecuted instantiation: curve25519.c:readUnalignedWords64 Unexecuted instantiation: curve448.c:readUnalignedWords64 Unexecuted instantiation: des3.c:readUnalignedWords64 Unexecuted instantiation: dh.c:readUnalignedWords64 Unexecuted instantiation: ecc.c:readUnalignedWords64 Unexecuted instantiation: eccsi.c:readUnalignedWords64 Unexecuted instantiation: ed25519.c:readUnalignedWords64 Unexecuted instantiation: ed448.c:readUnalignedWords64 Unexecuted instantiation: fe_448.c:readUnalignedWords64 Unexecuted instantiation: fe_operations.c:readUnalignedWords64 Unexecuted instantiation: ge_448.c:readUnalignedWords64 Unexecuted instantiation: ge_operations.c:readUnalignedWords64 Unexecuted instantiation: hash.c:readUnalignedWords64 Unexecuted instantiation: hmac.c:readUnalignedWords64 Unexecuted instantiation: kdf.c:readUnalignedWords64 Unexecuted instantiation: md2.c:readUnalignedWords64 Unexecuted instantiation: md4.c:readUnalignedWords64 Unexecuted instantiation: md5.c:readUnalignedWords64 Unexecuted instantiation: poly1305.c:readUnalignedWords64 Unexecuted instantiation: pwdbased.c:readUnalignedWords64 Unexecuted instantiation: random.c:readUnalignedWords64 Unexecuted instantiation: ripemd.c:readUnalignedWords64 Unexecuted instantiation: rsa.c:readUnalignedWords64 Unexecuted instantiation: sha.c:readUnalignedWords64 Unexecuted instantiation: sha256.c:readUnalignedWords64 Unexecuted instantiation: sha3.c:readUnalignedWords64 Unexecuted instantiation: sha512.c:readUnalignedWords64 Unexecuted instantiation: siphash.c:readUnalignedWords64 Unexecuted instantiation: sm2.c:readUnalignedWords64 Unexecuted instantiation: sm3.c:readUnalignedWords64 Unexecuted instantiation: sm4.c:readUnalignedWords64 Unexecuted instantiation: sp_int.c:readUnalignedWords64 Unexecuted instantiation: wc_encrypt.c:readUnalignedWords64 Unexecuted instantiation: wolfmath.c:readUnalignedWords64 Unexecuted instantiation: ssl.c:readUnalignedWords64 Unexecuted instantiation: tls.c:readUnalignedWords64 Unexecuted instantiation: tls13.c:readUnalignedWords64 Unexecuted instantiation: internal.c:readUnalignedWords64 |
290 | | |
291 | | WC_MISC_STATIC WC_INLINE void writeUnalignedWords64(byte *out, const word64 *in, |
292 | | size_t count) |
293 | 0 | { |
294 | 0 | if (((wc_ptr_t)out & (wc_ptr_t)(sizeof(word64) - 1U)) == (wc_ptr_t)0) { |
295 | 0 | word64 *out_word64 = (word64 *)out; |
296 | 0 | while (count-- > 0) |
297 | 0 | *out_word64++ = *in++; |
298 | 0 | } |
299 | 0 | else { |
300 | 0 | XMEMCPY(out, in, count * sizeof(*in)); |
301 | 0 | } |
302 | 0 | } Unexecuted instantiation: aes.c:writeUnalignedWords64 Unexecuted instantiation: asn.c:writeUnalignedWords64 Unexecuted instantiation: camellia.c:writeUnalignedWords64 Unexecuted instantiation: chacha.c:writeUnalignedWords64 Unexecuted instantiation: chacha20_poly1305.c:writeUnalignedWords64 Unexecuted instantiation: cmac.c:writeUnalignedWords64 Unexecuted instantiation: coding.c:writeUnalignedWords64 Unexecuted instantiation: curve25519.c:writeUnalignedWords64 Unexecuted instantiation: curve448.c:writeUnalignedWords64 Unexecuted instantiation: des3.c:writeUnalignedWords64 Unexecuted instantiation: dh.c:writeUnalignedWords64 Unexecuted instantiation: ecc.c:writeUnalignedWords64 Unexecuted instantiation: eccsi.c:writeUnalignedWords64 Unexecuted instantiation: ed25519.c:writeUnalignedWords64 Unexecuted instantiation: ed448.c:writeUnalignedWords64 Unexecuted instantiation: fe_448.c:writeUnalignedWords64 Unexecuted instantiation: fe_operations.c:writeUnalignedWords64 Unexecuted instantiation: ge_448.c:writeUnalignedWords64 Unexecuted instantiation: ge_operations.c:writeUnalignedWords64 Unexecuted instantiation: hash.c:writeUnalignedWords64 Unexecuted instantiation: hmac.c:writeUnalignedWords64 Unexecuted instantiation: kdf.c:writeUnalignedWords64 Unexecuted instantiation: md2.c:writeUnalignedWords64 Unexecuted instantiation: md4.c:writeUnalignedWords64 Unexecuted instantiation: md5.c:writeUnalignedWords64 Unexecuted instantiation: poly1305.c:writeUnalignedWords64 Unexecuted instantiation: pwdbased.c:writeUnalignedWords64 Unexecuted instantiation: random.c:writeUnalignedWords64 Unexecuted instantiation: ripemd.c:writeUnalignedWords64 Unexecuted instantiation: rsa.c:writeUnalignedWords64 Unexecuted instantiation: sha.c:writeUnalignedWords64 Unexecuted instantiation: sha256.c:writeUnalignedWords64 Unexecuted instantiation: sha3.c:writeUnalignedWords64 Unexecuted instantiation: sha512.c:writeUnalignedWords64 Unexecuted instantiation: siphash.c:writeUnalignedWords64 Unexecuted instantiation: sm2.c:writeUnalignedWords64 Unexecuted instantiation: sm3.c:writeUnalignedWords64 Unexecuted instantiation: sm4.c:writeUnalignedWords64 Unexecuted instantiation: sp_int.c:writeUnalignedWords64 Unexecuted instantiation: wc_encrypt.c:writeUnalignedWords64 Unexecuted instantiation: wolfmath.c:writeUnalignedWords64 Unexecuted instantiation: ssl.c:writeUnalignedWords64 Unexecuted instantiation: tls.c:writeUnalignedWords64 Unexecuted instantiation: tls13.c:writeUnalignedWords64 Unexecuted instantiation: internal.c:writeUnalignedWords64 |
303 | | |
304 | | WC_MISC_STATIC WC_INLINE word64 rotlFixed64(word64 x, word64 y) |
305 | 314k | { |
306 | 314k | return (x << y) | (x >> (sizeof(y) * 8 - y)); |
307 | 314k | } Unexecuted instantiation: aes.c:rotlFixed64 Unexecuted instantiation: asn.c:rotlFixed64 Unexecuted instantiation: camellia.c:rotlFixed64 Unexecuted instantiation: chacha.c:rotlFixed64 Unexecuted instantiation: chacha20_poly1305.c:rotlFixed64 Unexecuted instantiation: cmac.c:rotlFixed64 Unexecuted instantiation: coding.c:rotlFixed64 Unexecuted instantiation: curve25519.c:rotlFixed64 Unexecuted instantiation: curve448.c:rotlFixed64 Unexecuted instantiation: des3.c:rotlFixed64 Unexecuted instantiation: dh.c:rotlFixed64 Unexecuted instantiation: ecc.c:rotlFixed64 Unexecuted instantiation: eccsi.c:rotlFixed64 Unexecuted instantiation: ed25519.c:rotlFixed64 Unexecuted instantiation: ed448.c:rotlFixed64 Unexecuted instantiation: fe_448.c:rotlFixed64 Unexecuted instantiation: fe_operations.c:rotlFixed64 Unexecuted instantiation: ge_448.c:rotlFixed64 Unexecuted instantiation: ge_operations.c:rotlFixed64 Unexecuted instantiation: hash.c:rotlFixed64 Unexecuted instantiation: hmac.c:rotlFixed64 Unexecuted instantiation: kdf.c:rotlFixed64 Unexecuted instantiation: md2.c:rotlFixed64 Unexecuted instantiation: md4.c:rotlFixed64 Unexecuted instantiation: md5.c:rotlFixed64 Unexecuted instantiation: poly1305.c:rotlFixed64 Unexecuted instantiation: pwdbased.c:rotlFixed64 Unexecuted instantiation: random.c:rotlFixed64 Unexecuted instantiation: ripemd.c:rotlFixed64 Unexecuted instantiation: rsa.c:rotlFixed64 Unexecuted instantiation: sha.c:rotlFixed64 Unexecuted instantiation: sha256.c:rotlFixed64 Unexecuted instantiation: sha3.c:rotlFixed64 Line | Count | Source | 305 | 301k | { | 306 | 301k | return (x << y) | (x >> (sizeof(y) * 8 - y)); | 307 | 301k | } |
Line | Count | Source | 305 | 13.3k | { | 306 | 13.3k | return (x << y) | (x >> (sizeof(y) * 8 - y)); | 307 | 13.3k | } |
Unexecuted instantiation: sm2.c:rotlFixed64 Unexecuted instantiation: sm3.c:rotlFixed64 Unexecuted instantiation: sm4.c:rotlFixed64 Unexecuted instantiation: sp_int.c:rotlFixed64 Unexecuted instantiation: wc_encrypt.c:rotlFixed64 Unexecuted instantiation: wolfmath.c:rotlFixed64 Unexecuted instantiation: ssl.c:rotlFixed64 Unexecuted instantiation: tls.c:rotlFixed64 Unexecuted instantiation: tls13.c:rotlFixed64 Unexecuted instantiation: internal.c:rotlFixed64 |
308 | | |
309 | | |
310 | | WC_MISC_STATIC WC_INLINE word64 rotrFixed64(word64 x, word64 y) |
311 | 13.7M | { |
312 | 13.7M | return (x >> y) | (x << (sizeof(y) * 8 - y)); |
313 | 13.7M | } Unexecuted instantiation: aes.c:rotrFixed64 Unexecuted instantiation: asn.c:rotrFixed64 Unexecuted instantiation: camellia.c:rotrFixed64 Unexecuted instantiation: chacha.c:rotrFixed64 Unexecuted instantiation: chacha20_poly1305.c:rotrFixed64 Unexecuted instantiation: cmac.c:rotrFixed64 Unexecuted instantiation: coding.c:rotrFixed64 Unexecuted instantiation: curve25519.c:rotrFixed64 Unexecuted instantiation: curve448.c:rotrFixed64 Unexecuted instantiation: des3.c:rotrFixed64 Unexecuted instantiation: dh.c:rotrFixed64 Unexecuted instantiation: ecc.c:rotrFixed64 Unexecuted instantiation: eccsi.c:rotrFixed64 Unexecuted instantiation: ed25519.c:rotrFixed64 Unexecuted instantiation: ed448.c:rotrFixed64 Unexecuted instantiation: fe_448.c:rotrFixed64 Unexecuted instantiation: fe_operations.c:rotrFixed64 Unexecuted instantiation: ge_448.c:rotrFixed64 Unexecuted instantiation: ge_operations.c:rotrFixed64 Unexecuted instantiation: hash.c:rotrFixed64 Unexecuted instantiation: hmac.c:rotrFixed64 Unexecuted instantiation: kdf.c:rotrFixed64 Unexecuted instantiation: md2.c:rotrFixed64 Unexecuted instantiation: md4.c:rotrFixed64 Unexecuted instantiation: md5.c:rotrFixed64 Unexecuted instantiation: poly1305.c:rotrFixed64 Unexecuted instantiation: pwdbased.c:rotrFixed64 Unexecuted instantiation: random.c:rotrFixed64 Unexecuted instantiation: ripemd.c:rotrFixed64 Unexecuted instantiation: rsa.c:rotrFixed64 Unexecuted instantiation: sha.c:rotrFixed64 Unexecuted instantiation: sha256.c:rotrFixed64 Unexecuted instantiation: sha3.c:rotrFixed64 Line | Count | Source | 311 | 13.7M | { | 312 | 13.7M | return (x >> y) | (x << (sizeof(y) * 8 - y)); | 313 | 13.7M | } |
Unexecuted instantiation: siphash.c:rotrFixed64 Unexecuted instantiation: sm2.c:rotrFixed64 Unexecuted instantiation: sm3.c:rotrFixed64 Unexecuted instantiation: sm4.c:rotrFixed64 Unexecuted instantiation: sp_int.c:rotrFixed64 Unexecuted instantiation: wc_encrypt.c:rotrFixed64 Unexecuted instantiation: wolfmath.c:rotrFixed64 Unexecuted instantiation: ssl.c:rotrFixed64 Unexecuted instantiation: tls.c:rotrFixed64 Unexecuted instantiation: tls13.c:rotrFixed64 Unexecuted instantiation: internal.c:rotrFixed64 |
314 | | |
315 | | |
316 | | WC_MISC_STATIC WC_INLINE word64 ByteReverseWord64(word64 value) |
317 | 301k | { |
318 | | #if defined(WOLF_ALLOW_BUILTIN) && defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) |
319 | | return (word64)__builtin_bswap64(value); |
320 | | #elif defined(WOLFCRYPT_SLOW_WORD64) |
321 | | return (word64)((word64)ByteReverseWord32((word32) value)) << 32 | |
322 | | (word64)ByteReverseWord32((word32)(value >> 32)); |
323 | | #else |
324 | 301k | value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | |
325 | 301k | ((value & W64LIT(0x00FF00FF00FF00FF)) << 8); |
326 | 301k | value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | |
327 | 301k | ((value & W64LIT(0x0000FFFF0000FFFF)) << 16); |
328 | 301k | return rotlFixed64(value, 32U); |
329 | 301k | #endif |
330 | 301k | } Unexecuted instantiation: aes.c:ByteReverseWord64 Unexecuted instantiation: asn.c:ByteReverseWord64 Unexecuted instantiation: camellia.c:ByteReverseWord64 Unexecuted instantiation: chacha.c:ByteReverseWord64 Unexecuted instantiation: chacha20_poly1305.c:ByteReverseWord64 Unexecuted instantiation: cmac.c:ByteReverseWord64 Unexecuted instantiation: coding.c:ByteReverseWord64 Unexecuted instantiation: curve25519.c:ByteReverseWord64 Unexecuted instantiation: curve448.c:ByteReverseWord64 Unexecuted instantiation: des3.c:ByteReverseWord64 Unexecuted instantiation: dh.c:ByteReverseWord64 Unexecuted instantiation: ecc.c:ByteReverseWord64 Unexecuted instantiation: eccsi.c:ByteReverseWord64 Unexecuted instantiation: ed25519.c:ByteReverseWord64 Unexecuted instantiation: ed448.c:ByteReverseWord64 Unexecuted instantiation: fe_448.c:ByteReverseWord64 Unexecuted instantiation: fe_operations.c:ByteReverseWord64 Unexecuted instantiation: ge_448.c:ByteReverseWord64 Unexecuted instantiation: ge_operations.c:ByteReverseWord64 Unexecuted instantiation: hash.c:ByteReverseWord64 Unexecuted instantiation: hmac.c:ByteReverseWord64 Unexecuted instantiation: kdf.c:ByteReverseWord64 Unexecuted instantiation: md2.c:ByteReverseWord64 Unexecuted instantiation: md4.c:ByteReverseWord64 Unexecuted instantiation: md5.c:ByteReverseWord64 Unexecuted instantiation: poly1305.c:ByteReverseWord64 Unexecuted instantiation: pwdbased.c:ByteReverseWord64 Unexecuted instantiation: random.c:ByteReverseWord64 Unexecuted instantiation: ripemd.c:ByteReverseWord64 Unexecuted instantiation: rsa.c:ByteReverseWord64 Unexecuted instantiation: sha.c:ByteReverseWord64 Unexecuted instantiation: sha256.c:ByteReverseWord64 Unexecuted instantiation: sha3.c:ByteReverseWord64 sha512.c:ByteReverseWord64 Line | Count | Source | 317 | 301k | { | 318 | | #if defined(WOLF_ALLOW_BUILTIN) && defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 3) | 319 | | return (word64)__builtin_bswap64(value); | 320 | | #elif defined(WOLFCRYPT_SLOW_WORD64) | 321 | | return (word64)((word64)ByteReverseWord32((word32) value)) << 32 | | 322 | | (word64)ByteReverseWord32((word32)(value >> 32)); | 323 | | #else | 324 | 301k | value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | | 325 | 301k | ((value & W64LIT(0x00FF00FF00FF00FF)) << 8); | 326 | 301k | value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | | 327 | 301k | ((value & W64LIT(0x0000FFFF0000FFFF)) << 16); | 328 | 301k | return rotlFixed64(value, 32U); | 329 | 301k | #endif | 330 | 301k | } |
Unexecuted instantiation: siphash.c:ByteReverseWord64 Unexecuted instantiation: sm2.c:ByteReverseWord64 Unexecuted instantiation: sm3.c:ByteReverseWord64 Unexecuted instantiation: sm4.c:ByteReverseWord64 Unexecuted instantiation: sp_int.c:ByteReverseWord64 Unexecuted instantiation: wc_encrypt.c:ByteReverseWord64 Unexecuted instantiation: wolfmath.c:ByteReverseWord64 Unexecuted instantiation: ssl.c:ByteReverseWord64 Unexecuted instantiation: tls.c:ByteReverseWord64 Unexecuted instantiation: tls13.c:ByteReverseWord64 Unexecuted instantiation: internal.c:ByteReverseWord64 |
331 | | |
332 | | |
333 | | WC_MISC_STATIC WC_INLINE void ByteReverseWords64(word64* out, const word64* in, |
334 | | word32 byteCount) |
335 | 18.9k | { |
336 | 18.9k | word32 count = byteCount/(word32)sizeof(word64), i; |
337 | | |
338 | 320k | for (i = 0; i < count; i++) |
339 | 301k | out[i] = ByteReverseWord64(in[i]); |
340 | | |
341 | 18.9k | } Unexecuted instantiation: aes.c:ByteReverseWords64 Unexecuted instantiation: asn.c:ByteReverseWords64 Unexecuted instantiation: camellia.c:ByteReverseWords64 Unexecuted instantiation: chacha.c:ByteReverseWords64 Unexecuted instantiation: chacha20_poly1305.c:ByteReverseWords64 Unexecuted instantiation: cmac.c:ByteReverseWords64 Unexecuted instantiation: coding.c:ByteReverseWords64 Unexecuted instantiation: curve25519.c:ByteReverseWords64 Unexecuted instantiation: curve448.c:ByteReverseWords64 Unexecuted instantiation: des3.c:ByteReverseWords64 Unexecuted instantiation: dh.c:ByteReverseWords64 Unexecuted instantiation: ecc.c:ByteReverseWords64 Unexecuted instantiation: eccsi.c:ByteReverseWords64 Unexecuted instantiation: ed25519.c:ByteReverseWords64 Unexecuted instantiation: ed448.c:ByteReverseWords64 Unexecuted instantiation: fe_448.c:ByteReverseWords64 Unexecuted instantiation: fe_operations.c:ByteReverseWords64 Unexecuted instantiation: ge_448.c:ByteReverseWords64 Unexecuted instantiation: ge_operations.c:ByteReverseWords64 Unexecuted instantiation: hash.c:ByteReverseWords64 Unexecuted instantiation: hmac.c:ByteReverseWords64 Unexecuted instantiation: kdf.c:ByteReverseWords64 Unexecuted instantiation: md2.c:ByteReverseWords64 Unexecuted instantiation: md4.c:ByteReverseWords64 Unexecuted instantiation: md5.c:ByteReverseWords64 Unexecuted instantiation: poly1305.c:ByteReverseWords64 Unexecuted instantiation: pwdbased.c:ByteReverseWords64 Unexecuted instantiation: random.c:ByteReverseWords64 Unexecuted instantiation: ripemd.c:ByteReverseWords64 Unexecuted instantiation: rsa.c:ByteReverseWords64 Unexecuted instantiation: sha.c:ByteReverseWords64 Unexecuted instantiation: sha256.c:ByteReverseWords64 Unexecuted instantiation: sha3.c:ByteReverseWords64 sha512.c:ByteReverseWords64 Line | Count | Source | 335 | 18.9k | { | 336 | 18.9k | word32 count = byteCount/(word32)sizeof(word64), i; | 337 | | | 338 | 320k | for (i = 0; i < count; i++) | 339 | 301k | out[i] = ByteReverseWord64(in[i]); | 340 | | | 341 | 18.9k | } |
Unexecuted instantiation: siphash.c:ByteReverseWords64 Unexecuted instantiation: sm2.c:ByteReverseWords64 Unexecuted instantiation: sm3.c:ByteReverseWords64 Unexecuted instantiation: sm4.c:ByteReverseWords64 Unexecuted instantiation: sp_int.c:ByteReverseWords64 Unexecuted instantiation: wc_encrypt.c:ByteReverseWords64 Unexecuted instantiation: wolfmath.c:ByteReverseWords64 Unexecuted instantiation: ssl.c:ByteReverseWords64 Unexecuted instantiation: tls.c:ByteReverseWords64 Unexecuted instantiation: tls13.c:ByteReverseWords64 Unexecuted instantiation: internal.c:ByteReverseWords64 |
342 | | |
343 | | #endif /* WORD64_AVAILABLE && !WOLFSSL_NO_WORD64_OPS */ |
344 | | |
345 | | #ifndef WOLFSSL_NO_XOR_OPS |
346 | | /* This routine performs a bitwise XOR operation of <*r> and <*a> for <n> number |
347 | | of wolfssl_words, placing the result in <*r>. */ |
348 | | WC_MISC_STATIC WC_INLINE void XorWordsOut(wolfssl_word** r, |
349 | | const wolfssl_word** a, const wolfssl_word** b, word32 n) |
350 | 22 | { |
351 | 22 | word32 i; |
352 | | |
353 | 36 | for (i = 0; i < n; i++) |
354 | 14 | *((*r)++) = *((*a)++) ^ *((*b)++); |
355 | 22 | } Line | Count | Source | 350 | 20 | { | 351 | 20 | word32 i; | 352 | | | 353 | 30 | for (i = 0; i < n; i++) | 354 | 10 | *((*r)++) = *((*a)++) ^ *((*b)++); | 355 | 20 | } |
Unexecuted instantiation: asn.c:XorWordsOut Unexecuted instantiation: camellia.c:XorWordsOut Line | Count | Source | 350 | 2 | { | 351 | 2 | word32 i; | 352 | | | 353 | 6 | for (i = 0; i < n; i++) | 354 | 4 | *((*r)++) = *((*a)++) ^ *((*b)++); | 355 | 2 | } |
Unexecuted instantiation: chacha20_poly1305.c:XorWordsOut Unexecuted instantiation: cmac.c:XorWordsOut Unexecuted instantiation: coding.c:XorWordsOut Unexecuted instantiation: curve25519.c:XorWordsOut Unexecuted instantiation: curve448.c:XorWordsOut Unexecuted instantiation: des3.c:XorWordsOut Unexecuted instantiation: dh.c:XorWordsOut Unexecuted instantiation: ecc.c:XorWordsOut Unexecuted instantiation: eccsi.c:XorWordsOut Unexecuted instantiation: ed25519.c:XorWordsOut Unexecuted instantiation: ed448.c:XorWordsOut Unexecuted instantiation: fe_448.c:XorWordsOut Unexecuted instantiation: fe_operations.c:XorWordsOut Unexecuted instantiation: ge_448.c:XorWordsOut Unexecuted instantiation: ge_operations.c:XorWordsOut Unexecuted instantiation: hash.c:XorWordsOut Unexecuted instantiation: hmac.c:XorWordsOut Unexecuted instantiation: kdf.c:XorWordsOut Unexecuted instantiation: md2.c:XorWordsOut Unexecuted instantiation: md4.c:XorWordsOut Unexecuted instantiation: md5.c:XorWordsOut Unexecuted instantiation: poly1305.c:XorWordsOut Unexecuted instantiation: pwdbased.c:XorWordsOut Unexecuted instantiation: random.c:XorWordsOut Unexecuted instantiation: ripemd.c:XorWordsOut Unexecuted instantiation: rsa.c:XorWordsOut Unexecuted instantiation: sha.c:XorWordsOut Unexecuted instantiation: sha256.c:XorWordsOut Unexecuted instantiation: sha3.c:XorWordsOut Unexecuted instantiation: sha512.c:XorWordsOut Unexecuted instantiation: siphash.c:XorWordsOut Unexecuted instantiation: sm2.c:XorWordsOut Unexecuted instantiation: sm3.c:XorWordsOut Unexecuted instantiation: sm4.c:XorWordsOut Unexecuted instantiation: sp_int.c:XorWordsOut Unexecuted instantiation: wc_encrypt.c:XorWordsOut Unexecuted instantiation: wolfmath.c:XorWordsOut Unexecuted instantiation: ssl.c:XorWordsOut Unexecuted instantiation: tls.c:XorWordsOut Unexecuted instantiation: tls13.c:XorWordsOut Unexecuted instantiation: internal.c:XorWordsOut |
356 | | |
357 | | /* This routine performs a bitwise XOR operation of <*buf> and <*mask> of n |
358 | | counts, placing the result in <*buf>. */ |
359 | | |
360 | | WC_MISC_STATIC WC_INLINE void xorbufout(void* out, const void* buf, |
361 | | const void* mask, word32 count) |
362 | 22 | { |
363 | 22 | word32 i; |
364 | 22 | byte* o; |
365 | 22 | const byte* b; |
366 | 22 | const byte* m; |
367 | | |
368 | 22 | o = (byte*)out; |
369 | 22 | b = (const byte*)buf; |
370 | 22 | m = (const byte*)mask; |
371 | | |
372 | | |
373 | 22 | if (((wc_ptr_t)o) % WOLFSSL_WORD_SIZE == |
374 | 22 | ((wc_ptr_t)b) % WOLFSSL_WORD_SIZE && |
375 | 22 | ((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == |
376 | 22 | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { |
377 | | /* type-punning helpers */ |
378 | 22 | union { |
379 | 22 | byte* bp; |
380 | 22 | wolfssl_word* wp; |
381 | 22 | } tpo; |
382 | 22 | union { |
383 | 22 | const byte* bp; |
384 | 22 | const wolfssl_word* wp; |
385 | 22 | } tpb, tpm; |
386 | | /* Alignment checks out. Possible to XOR words. */ |
387 | | /* Move alignment so that it lines up with a |
388 | | * WOLFSSL_WORD_SIZE boundary */ |
389 | 23 | while (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE != 0 && count > 0) { |
390 | 1 | *(o++) = (byte)(*(b++) ^ *(m++)); |
391 | 1 | count--; |
392 | 1 | } |
393 | 22 | tpo.bp = o; |
394 | 22 | tpb.bp = b; |
395 | 22 | tpm.bp = m; |
396 | 22 | XorWordsOut( &tpo.wp, &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); |
397 | 22 | o = tpo.bp; |
398 | 22 | b = tpb.bp; |
399 | 22 | m = tpm.bp; |
400 | 22 | count %= WOLFSSL_WORD_SIZE; |
401 | 22 | } |
402 | | |
403 | 79 | for (i = 0; i < count; i++) |
404 | 57 | o[i] = (byte)(b[i] ^ m[i]); |
405 | 22 | } Line | Count | Source | 362 | 20 | { | 363 | 20 | word32 i; | 364 | 20 | byte* o; | 365 | 20 | const byte* b; | 366 | 20 | const byte* m; | 367 | | | 368 | 20 | o = (byte*)out; | 369 | 20 | b = (const byte*)buf; | 370 | 20 | m = (const byte*)mask; | 371 | | | 372 | | | 373 | 20 | if (((wc_ptr_t)o) % WOLFSSL_WORD_SIZE == | 374 | 20 | ((wc_ptr_t)b) % WOLFSSL_WORD_SIZE && | 375 | 20 | ((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == | 376 | 20 | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { | 377 | | /* type-punning helpers */ | 378 | 20 | union { | 379 | 20 | byte* bp; | 380 | 20 | wolfssl_word* wp; | 381 | 20 | } tpo; | 382 | 20 | union { | 383 | 20 | const byte* bp; | 384 | 20 | const wolfssl_word* wp; | 385 | 20 | } tpb, tpm; | 386 | | /* Alignment checks out. Possible to XOR words. */ | 387 | | /* Move alignment so that it lines up with a | 388 | | * WOLFSSL_WORD_SIZE boundary */ | 389 | 21 | while (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE != 0 && count > 0) { | 390 | 1 | *(o++) = (byte)(*(b++) ^ *(m++)); | 391 | 1 | count--; | 392 | 1 | } | 393 | 20 | tpo.bp = o; | 394 | 20 | tpb.bp = b; | 395 | 20 | tpm.bp = m; | 396 | 20 | XorWordsOut( &tpo.wp, &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); | 397 | 20 | o = tpo.bp; | 398 | 20 | b = tpb.bp; | 399 | 20 | m = tpm.bp; | 400 | 20 | count %= WOLFSSL_WORD_SIZE; | 401 | 20 | } | 402 | | | 403 | 72 | for (i = 0; i < count; i++) | 404 | 52 | o[i] = (byte)(b[i] ^ m[i]); | 405 | 20 | } |
Unexecuted instantiation: asn.c:xorbufout Unexecuted instantiation: camellia.c:xorbufout Line | Count | Source | 362 | 2 | { | 363 | 2 | word32 i; | 364 | 2 | byte* o; | 365 | 2 | const byte* b; | 366 | 2 | const byte* m; | 367 | | | 368 | 2 | o = (byte*)out; | 369 | 2 | b = (const byte*)buf; | 370 | 2 | m = (const byte*)mask; | 371 | | | 372 | | | 373 | 2 | if (((wc_ptr_t)o) % WOLFSSL_WORD_SIZE == | 374 | 2 | ((wc_ptr_t)b) % WOLFSSL_WORD_SIZE && | 375 | 2 | ((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == | 376 | 2 | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { | 377 | | /* type-punning helpers */ | 378 | 2 | union { | 379 | 2 | byte* bp; | 380 | 2 | wolfssl_word* wp; | 381 | 2 | } tpo; | 382 | 2 | union { | 383 | 2 | const byte* bp; | 384 | 2 | const wolfssl_word* wp; | 385 | 2 | } tpb, tpm; | 386 | | /* Alignment checks out. Possible to XOR words. */ | 387 | | /* Move alignment so that it lines up with a | 388 | | * WOLFSSL_WORD_SIZE boundary */ | 389 | 2 | while (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE != 0 && count > 0) { | 390 | 0 | *(o++) = (byte)(*(b++) ^ *(m++)); | 391 | 0 | count--; | 392 | 0 | } | 393 | 2 | tpo.bp = o; | 394 | 2 | tpb.bp = b; | 395 | 2 | tpm.bp = m; | 396 | 2 | XorWordsOut( &tpo.wp, &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); | 397 | 2 | o = tpo.bp; | 398 | 2 | b = tpb.bp; | 399 | 2 | m = tpm.bp; | 400 | 2 | count %= WOLFSSL_WORD_SIZE; | 401 | 2 | } | 402 | | | 403 | 7 | for (i = 0; i < count; i++) | 404 | 5 | o[i] = (byte)(b[i] ^ m[i]); | 405 | 2 | } |
Unexecuted instantiation: chacha20_poly1305.c:xorbufout Unexecuted instantiation: cmac.c:xorbufout Unexecuted instantiation: coding.c:xorbufout Unexecuted instantiation: curve25519.c:xorbufout Unexecuted instantiation: curve448.c:xorbufout Unexecuted instantiation: des3.c:xorbufout Unexecuted instantiation: dh.c:xorbufout Unexecuted instantiation: ecc.c:xorbufout Unexecuted instantiation: eccsi.c:xorbufout Unexecuted instantiation: ed25519.c:xorbufout Unexecuted instantiation: ed448.c:xorbufout Unexecuted instantiation: fe_448.c:xorbufout Unexecuted instantiation: fe_operations.c:xorbufout Unexecuted instantiation: ge_448.c:xorbufout Unexecuted instantiation: ge_operations.c:xorbufout Unexecuted instantiation: hash.c:xorbufout Unexecuted instantiation: hmac.c:xorbufout Unexecuted instantiation: kdf.c:xorbufout Unexecuted instantiation: md2.c:xorbufout Unexecuted instantiation: md4.c:xorbufout Unexecuted instantiation: md5.c:xorbufout Unexecuted instantiation: poly1305.c:xorbufout Unexecuted instantiation: pwdbased.c:xorbufout Unexecuted instantiation: random.c:xorbufout Unexecuted instantiation: ripemd.c:xorbufout Unexecuted instantiation: rsa.c:xorbufout Unexecuted instantiation: sha.c:xorbufout Unexecuted instantiation: sha256.c:xorbufout Unexecuted instantiation: sha3.c:xorbufout Unexecuted instantiation: sha512.c:xorbufout Unexecuted instantiation: siphash.c:xorbufout Unexecuted instantiation: sm2.c:xorbufout Unexecuted instantiation: sm3.c:xorbufout Unexecuted instantiation: sm4.c:xorbufout Unexecuted instantiation: sp_int.c:xorbufout Unexecuted instantiation: wc_encrypt.c:xorbufout Unexecuted instantiation: wolfmath.c:xorbufout Unexecuted instantiation: ssl.c:xorbufout Unexecuted instantiation: tls.c:xorbufout Unexecuted instantiation: tls13.c:xorbufout Unexecuted instantiation: internal.c:xorbufout |
406 | | |
407 | | /* This routine performs a bitwise XOR operation of <*r> and <*a> for <n> number |
408 | | of wolfssl_words, placing the result in <*r>. */ |
409 | | WC_MISC_STATIC WC_INLINE void XorWords(wolfssl_word** r, const wolfssl_word** a, |
410 | | word32 n) |
411 | 7.46k | { |
412 | 7.46k | word32 i; |
413 | | |
414 | 26.7k | for (i = 0; i < n; i++) |
415 | 19.2k | *((*r)++) ^= *((*a)++); |
416 | 7.46k | } Line | Count | Source | 411 | 6.89k | { | 412 | 6.89k | word32 i; | 413 | | | 414 | 24.4k | for (i = 0; i < n; i++) | 415 | 17.5k | *((*r)++) ^= *((*a)++); | 416 | 6.89k | } |
Unexecuted instantiation: asn.c:XorWords Unexecuted instantiation: camellia.c:XorWords Unexecuted instantiation: chacha.c:XorWords Unexecuted instantiation: chacha20_poly1305.c:XorWords Line | Count | Source | 411 | 54 | { | 412 | 54 | word32 i; | 413 | | | 414 | 162 | for (i = 0; i < n; i++) | 415 | 108 | *((*r)++) ^= *((*a)++); | 416 | 54 | } |
Unexecuted instantiation: coding.c:XorWords Unexecuted instantiation: curve25519.c:XorWords Unexecuted instantiation: curve448.c:XorWords Unexecuted instantiation: des3.c:XorWords Unexecuted instantiation: dh.c:XorWords Unexecuted instantiation: ecc.c:XorWords Unexecuted instantiation: eccsi.c:XorWords Unexecuted instantiation: ed25519.c:XorWords Unexecuted instantiation: ed448.c:XorWords Unexecuted instantiation: fe_448.c:XorWords Unexecuted instantiation: fe_operations.c:XorWords Unexecuted instantiation: ge_448.c:XorWords Unexecuted instantiation: ge_operations.c:XorWords Unexecuted instantiation: hash.c:XorWords Unexecuted instantiation: hmac.c:XorWords Unexecuted instantiation: kdf.c:XorWords Unexecuted instantiation: md2.c:XorWords Unexecuted instantiation: md4.c:XorWords Unexecuted instantiation: md5.c:XorWords Unexecuted instantiation: poly1305.c:XorWords Line | Count | Source | 411 | 517 | { | 412 | 517 | word32 i; | 413 | | | 414 | 2.17k | for (i = 0; i < n; i++) | 415 | 1.65k | *((*r)++) ^= *((*a)++); | 416 | 517 | } |
Unexecuted instantiation: random.c:XorWords Unexecuted instantiation: ripemd.c:XorWords Unexecuted instantiation: rsa.c:XorWords Unexecuted instantiation: sha.c:XorWords Unexecuted instantiation: sha256.c:XorWords Unexecuted instantiation: sha3.c:XorWords Unexecuted instantiation: sha512.c:XorWords Unexecuted instantiation: siphash.c:XorWords Unexecuted instantiation: sm2.c:XorWords Unexecuted instantiation: sm3.c:XorWords Unexecuted instantiation: sm4.c:XorWords Unexecuted instantiation: sp_int.c:XorWords Unexecuted instantiation: wc_encrypt.c:XorWords Unexecuted instantiation: wolfmath.c:XorWords Unexecuted instantiation: ssl.c:XorWords Unexecuted instantiation: tls.c:XorWords Unexecuted instantiation: tls13.c:XorWords Unexecuted instantiation: internal.c:XorWords |
417 | | |
418 | | /* This routine performs a bitwise XOR operation of <*buf> and <*mask> of n |
419 | | counts, placing the result in <*buf>. */ |
420 | | |
421 | | WC_MISC_STATIC WC_INLINE void xorbuf(void* buf, const void* mask, word32 count) |
422 | 7.58k | { |
423 | 7.58k | word32 i; |
424 | 7.58k | byte* b; |
425 | 7.58k | const byte* m; |
426 | | |
427 | 7.58k | b = (byte*)buf; |
428 | 7.58k | m = (const byte*)mask; |
429 | | |
430 | 7.58k | if (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == |
431 | 7.58k | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { |
432 | | /* type-punning helpers */ |
433 | 7.46k | union { |
434 | 7.46k | byte* bp; |
435 | 7.46k | wolfssl_word* wp; |
436 | 7.46k | } tpb; |
437 | 7.46k | union { |
438 | 7.46k | const byte* bp; |
439 | 7.46k | const wolfssl_word* wp; |
440 | 7.46k | } tpm; |
441 | | /* Alignment checks out. Possible to XOR words. */ |
442 | | /* Move alignment so that it lines up with a |
443 | | * WOLFSSL_WORD_SIZE boundary */ |
444 | 7.46k | while (((wc_ptr_t)buf) % WOLFSSL_WORD_SIZE != 0 && count > 0) { |
445 | 0 | *(b++) ^= *(m++); |
446 | 0 | count--; |
447 | 0 | } |
448 | 7.46k | tpb.bp = b; |
449 | 7.46k | tpm.bp = m; |
450 | 7.46k | XorWords( &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); |
451 | 7.46k | b = tpb.bp; |
452 | 7.46k | m = tpm.bp; |
453 | 7.46k | count %= WOLFSSL_WORD_SIZE; |
454 | 7.46k | } |
455 | | |
456 | 10.5k | for (i = 0; i < count; i++) |
457 | 2.93k | b[i] ^= m[i]; |
458 | 7.58k | } Line | Count | Source | 422 | 6.89k | { | 423 | 6.89k | word32 i; | 424 | 6.89k | byte* b; | 425 | 6.89k | const byte* m; | 426 | | | 427 | 6.89k | b = (byte*)buf; | 428 | 6.89k | m = (const byte*)mask; | 429 | | | 430 | 6.89k | if (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == | 431 | 6.89k | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { | 432 | | /* type-punning helpers */ | 433 | 6.89k | union { | 434 | 6.89k | byte* bp; | 435 | 6.89k | wolfssl_word* wp; | 436 | 6.89k | } tpb; | 437 | 6.89k | union { | 438 | 6.89k | const byte* bp; | 439 | 6.89k | const wolfssl_word* wp; | 440 | 6.89k | } tpm; | 441 | | /* Alignment checks out. Possible to XOR words. */ | 442 | | /* Move alignment so that it lines up with a | 443 | | * WOLFSSL_WORD_SIZE boundary */ | 444 | 6.89k | while (((wc_ptr_t)buf) % WOLFSSL_WORD_SIZE != 0 && count > 0) { | 445 | 0 | *(b++) ^= *(m++); | 446 | 0 | count--; | 447 | 0 | } | 448 | 6.89k | tpb.bp = b; | 449 | 6.89k | tpm.bp = m; | 450 | 6.89k | XorWords( &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); | 451 | 6.89k | b = tpb.bp; | 452 | 6.89k | m = tpm.bp; | 453 | 6.89k | count %= WOLFSSL_WORD_SIZE; | 454 | 6.89k | } | 455 | | | 456 | 6.90k | for (i = 0; i < count; i++) | 457 | 12 | b[i] ^= m[i]; | 458 | 6.89k | } |
Unexecuted instantiation: asn.c:xorbuf Unexecuted instantiation: camellia.c:xorbuf Unexecuted instantiation: chacha.c:xorbuf Unexecuted instantiation: chacha20_poly1305.c:xorbuf Line | Count | Source | 422 | 54 | { | 423 | 54 | word32 i; | 424 | 54 | byte* b; | 425 | 54 | const byte* m; | 426 | | | 427 | 54 | b = (byte*)buf; | 428 | 54 | m = (const byte*)mask; | 429 | | | 430 | 54 | if (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == | 431 | 54 | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { | 432 | | /* type-punning helpers */ | 433 | 54 | union { | 434 | 54 | byte* bp; | 435 | 54 | wolfssl_word* wp; | 436 | 54 | } tpb; | 437 | 54 | union { | 438 | 54 | const byte* bp; | 439 | 54 | const wolfssl_word* wp; | 440 | 54 | } tpm; | 441 | | /* Alignment checks out. Possible to XOR words. */ | 442 | | /* Move alignment so that it lines up with a | 443 | | * WOLFSSL_WORD_SIZE boundary */ | 444 | 54 | while (((wc_ptr_t)buf) % WOLFSSL_WORD_SIZE != 0 && count > 0) { | 445 | 0 | *(b++) ^= *(m++); | 446 | 0 | count--; | 447 | 0 | } | 448 | 54 | tpb.bp = b; | 449 | 54 | tpm.bp = m; | 450 | 54 | XorWords( &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); | 451 | 54 | b = tpb.bp; | 452 | 54 | m = tpm.bp; | 453 | 54 | count %= WOLFSSL_WORD_SIZE; | 454 | 54 | } | 455 | | | 456 | 54 | for (i = 0; i < count; i++) | 457 | 0 | b[i] ^= m[i]; | 458 | 54 | } |
Unexecuted instantiation: coding.c:xorbuf Unexecuted instantiation: curve25519.c:xorbuf Unexecuted instantiation: curve448.c:xorbuf Unexecuted instantiation: des3.c:xorbuf Unexecuted instantiation: dh.c:xorbuf Unexecuted instantiation: ecc.c:xorbuf Unexecuted instantiation: eccsi.c:xorbuf Unexecuted instantiation: ed25519.c:xorbuf Unexecuted instantiation: ed448.c:xorbuf Unexecuted instantiation: fe_448.c:xorbuf Unexecuted instantiation: fe_operations.c:xorbuf Unexecuted instantiation: ge_448.c:xorbuf Unexecuted instantiation: ge_operations.c:xorbuf Unexecuted instantiation: hash.c:xorbuf Unexecuted instantiation: hmac.c:xorbuf Unexecuted instantiation: kdf.c:xorbuf Unexecuted instantiation: md2.c:xorbuf Unexecuted instantiation: md4.c:xorbuf Unexecuted instantiation: md5.c:xorbuf Unexecuted instantiation: poly1305.c:xorbuf Line | Count | Source | 422 | 631 | { | 423 | 631 | word32 i; | 424 | 631 | byte* b; | 425 | 631 | const byte* m; | 426 | | | 427 | 631 | b = (byte*)buf; | 428 | 631 | m = (const byte*)mask; | 429 | | | 430 | 631 | if (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE == | 431 | 631 | ((wc_ptr_t)m) % WOLFSSL_WORD_SIZE) { | 432 | | /* type-punning helpers */ | 433 | 517 | union { | 434 | 517 | byte* bp; | 435 | 517 | wolfssl_word* wp; | 436 | 517 | } tpb; | 437 | 517 | union { | 438 | 517 | const byte* bp; | 439 | 517 | const wolfssl_word* wp; | 440 | 517 | } tpm; | 441 | | /* Alignment checks out. Possible to XOR words. */ | 442 | | /* Move alignment so that it lines up with a | 443 | | * WOLFSSL_WORD_SIZE boundary */ | 444 | 517 | while (((wc_ptr_t)buf) % WOLFSSL_WORD_SIZE != 0 && count > 0) { | 445 | 0 | *(b++) ^= *(m++); | 446 | 0 | count--; | 447 | 0 | } | 448 | 517 | tpb.bp = b; | 449 | 517 | tpm.bp = m; | 450 | 517 | XorWords( &tpb.wp, &tpm.wp, count / WOLFSSL_WORD_SIZE); | 451 | 517 | b = tpb.bp; | 452 | 517 | m = tpm.bp; | 453 | 517 | count %= WOLFSSL_WORD_SIZE; | 454 | 517 | } | 455 | | | 456 | 3.55k | for (i = 0; i < count; i++) | 457 | 2.92k | b[i] ^= m[i]; | 458 | 631 | } |
Unexecuted instantiation: random.c:xorbuf Unexecuted instantiation: ripemd.c:xorbuf Unexecuted instantiation: rsa.c:xorbuf Unexecuted instantiation: sha.c:xorbuf Unexecuted instantiation: sha256.c:xorbuf Unexecuted instantiation: sha3.c:xorbuf Unexecuted instantiation: sha512.c:xorbuf Unexecuted instantiation: siphash.c:xorbuf Unexecuted instantiation: sm2.c:xorbuf Unexecuted instantiation: sm3.c:xorbuf Unexecuted instantiation: sm4.c:xorbuf Unexecuted instantiation: sp_int.c:xorbuf Unexecuted instantiation: wc_encrypt.c:xorbuf Unexecuted instantiation: wolfmath.c:xorbuf Unexecuted instantiation: ssl.c:xorbuf Unexecuted instantiation: tls.c:xorbuf Unexecuted instantiation: tls13.c:xorbuf Unexecuted instantiation: internal.c:xorbuf |
459 | | #endif |
460 | | |
461 | | #ifndef WOLFSSL_NO_FORCE_ZERO |
462 | | /* This routine fills the first len bytes of the memory area pointed by mem |
463 | | with zeros. It ensures compiler optimizations doesn't skip it */ |
464 | | WC_MISC_STATIC WC_INLINE void ForceZero(void* mem, word32 len) |
465 | 200k | { |
466 | 200k | volatile byte* z = (volatile byte*)mem; |
467 | | |
468 | 200k | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ |
469 | 200k | && defined(WORD64_AVAILABLE) |
470 | 200k | volatile word64* w; |
471 | 200k | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS |
472 | 200k | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & |
473 | 200k | (sizeof(word64)-1); |
474 | | |
475 | 200k | if (len < l) l = len; |
476 | 200k | len -= l; |
477 | 200k | while (l--) *z++ = 0; |
478 | 200k | #endif |
479 | 200k | for (w = (volatile word64*)z; |
480 | 5.15M | len >= sizeof(*w); |
481 | 4.95M | len -= (word32)sizeof(*w)) |
482 | 4.95M | { |
483 | 4.95M | *w++ = 0; |
484 | 4.95M | } |
485 | 200k | z = (volatile byte*)w; |
486 | 200k | #endif |
487 | | |
488 | 280k | while (len--) *z++ = 0; |
489 | 200k | } Line | Count | Source | 465 | 155 | { | 466 | 155 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 155 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 155 | && defined(WORD64_AVAILABLE) | 470 | 155 | volatile word64* w; | 471 | 155 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 155 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 155 | (sizeof(word64)-1); | 474 | | | 475 | 155 | if (len < l) l = len; | 476 | 155 | len -= l; | 477 | 507 | while (l--) *z++ = 0; | 478 | 155 | #endif | 479 | 155 | for (w = (volatile word64*)z; | 480 | 6.13k | len >= sizeof(*w); | 481 | 5.98k | len -= (word32)sizeof(*w)) | 482 | 5.98k | { | 483 | 5.98k | *w++ = 0; | 484 | 5.98k | } | 485 | 155 | z = (volatile byte*)w; | 486 | 155 | #endif | 487 | | | 488 | 339 | while (len--) *z++ = 0; | 489 | 155 | } |
Unexecuted instantiation: asn.c:ForceZero Unexecuted instantiation: camellia.c:ForceZero Unexecuted instantiation: chacha.c:ForceZero chacha20_poly1305.c:ForceZero Line | Count | Source | 465 | 1 | { | 466 | 1 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 1 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 1 | && defined(WORD64_AVAILABLE) | 470 | 1 | volatile word64* w; | 471 | 1 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 1 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 1 | (sizeof(word64)-1); | 474 | | | 475 | 1 | if (len < l) l = len; | 476 | 1 | len -= l; | 477 | 1 | while (l--) *z++ = 0; | 478 | 1 | #endif | 479 | 1 | for (w = (volatile word64*)z; | 480 | 24 | len >= sizeof(*w); | 481 | 23 | len -= (word32)sizeof(*w)) | 482 | 23 | { | 483 | 23 | *w++ = 0; | 484 | 23 | } | 485 | 1 | z = (volatile byte*)w; | 486 | 1 | #endif | 487 | | | 488 | 1 | while (len--) *z++ = 0; | 489 | 1 | } |
Line | Count | Source | 465 | 2 | { | 466 | 2 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 2 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 2 | && defined(WORD64_AVAILABLE) | 470 | 2 | volatile word64* w; | 471 | 2 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 2 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 2 | (sizeof(word64)-1); | 474 | | | 475 | 2 | if (len < l) l = len; | 476 | 2 | len -= l; | 477 | 2 | while (l--) *z++ = 0; | 478 | 2 | #endif | 479 | 2 | for (w = (volatile word64*)z; | 480 | 140 | len >= sizeof(*w); | 481 | 138 | len -= (word32)sizeof(*w)) | 482 | 138 | { | 483 | 138 | *w++ = 0; | 484 | 138 | } | 485 | 2 | z = (volatile byte*)w; | 486 | 2 | #endif | 487 | | | 488 | 2 | while (len--) *z++ = 0; | 489 | 2 | } |
Unexecuted instantiation: coding.c:ForceZero Line | Count | Source | 465 | 2 | { | 466 | 2 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 2 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 2 | && defined(WORD64_AVAILABLE) | 470 | 2 | volatile word64* w; | 471 | 2 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 2 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 2 | (sizeof(word64)-1); | 474 | | | 475 | 2 | if (len < l) l = len; | 476 | 2 | len -= l; | 477 | 2 | while (l--) *z++ = 0; | 478 | 2 | #endif | 479 | 2 | for (w = (volatile word64*)z; | 480 | 34 | len >= sizeof(*w); | 481 | 32 | len -= (word32)sizeof(*w)) | 482 | 32 | { | 483 | 32 | *w++ = 0; | 484 | 32 | } | 485 | 2 | z = (volatile byte*)w; | 486 | 2 | #endif | 487 | | | 488 | 2 | while (len--) *z++ = 0; | 489 | 2 | } |
Line | Count | Source | 465 | 3 | { | 466 | 3 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 3 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 3 | && defined(WORD64_AVAILABLE) | 470 | 3 | volatile word64* w; | 471 | 3 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 3 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 3 | (sizeof(word64)-1); | 474 | | | 475 | 3 | if (len < l) l = len; | 476 | 3 | len -= l; | 477 | 3 | while (l--) *z++ = 0; | 478 | 3 | #endif | 479 | 3 | for (w = (volatile word64*)z; | 480 | 24 | len >= sizeof(*w); | 481 | 21 | len -= (word32)sizeof(*w)) | 482 | 21 | { | 483 | 21 | *w++ = 0; | 484 | 21 | } | 485 | 3 | z = (volatile byte*)w; | 486 | 3 | #endif | 487 | | | 488 | 3 | while (len--) *z++ = 0; | 489 | 3 | } |
Unexecuted instantiation: des3.c:ForceZero Unexecuted instantiation: dh.c:ForceZero Line | Count | Source | 465 | 340 | { | 466 | 340 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 340 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 340 | && defined(WORD64_AVAILABLE) | 470 | 340 | volatile word64* w; | 471 | 340 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 340 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 340 | (sizeof(word64)-1); | 474 | | | 475 | 340 | if (len < l) l = len; | 476 | 340 | len -= l; | 477 | 340 | while (l--) *z++ = 0; | 478 | 340 | #endif | 479 | 340 | for (w = (volatile word64*)z; | 480 | 163k | len >= sizeof(*w); | 481 | 163k | len -= (word32)sizeof(*w)) | 482 | 163k | { | 483 | 163k | *w++ = 0; | 484 | 163k | } | 485 | 340 | z = (volatile byte*)w; | 486 | 340 | #endif | 487 | | | 488 | 400 | while (len--) *z++ = 0; | 489 | 340 | } |
Unexecuted instantiation: eccsi.c:ForceZero Line | Count | Source | 465 | 35 | { | 466 | 35 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 35 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 35 | && defined(WORD64_AVAILABLE) | 470 | 35 | volatile word64* w; | 471 | 35 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 35 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 35 | (sizeof(word64)-1); | 474 | | | 475 | 35 | if (len < l) l = len; | 476 | 35 | len -= l; | 477 | 35 | while (l--) *z++ = 0; | 478 | 35 | #endif | 479 | 35 | for (w = (volatile word64*)z; | 480 | 1.67k | len >= sizeof(*w); | 481 | 1.63k | len -= (word32)sizeof(*w)) | 482 | 1.63k | { | 483 | 1.63k | *w++ = 0; | 484 | 1.63k | } | 485 | 35 | z = (volatile byte*)w; | 486 | 35 | #endif | 487 | | | 488 | 35 | while (len--) *z++ = 0; | 489 | 35 | } |
Line | Count | Source | 465 | 21 | { | 466 | 21 | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 21 | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 21 | && defined(WORD64_AVAILABLE) | 470 | 21 | volatile word64* w; | 471 | 21 | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 21 | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 21 | (sizeof(word64)-1); | 474 | | | 475 | 21 | if (len < l) l = len; | 476 | 21 | len -= l; | 477 | 28 | while (l--) *z++ = 0; | 478 | 21 | #endif | 479 | 21 | for (w = (volatile word64*)z; | 480 | 1.60k | len >= sizeof(*w); | 481 | 1.58k | len -= (word32)sizeof(*w)) | 482 | 1.58k | { | 483 | 1.58k | *w++ = 0; | 484 | 1.58k | } | 485 | 21 | z = (volatile byte*)w; | 486 | 21 | #endif | 487 | | | 488 | 23 | while (len--) *z++ = 0; | 489 | 21 | } |
Unexecuted instantiation: fe_448.c:ForceZero Unexecuted instantiation: fe_operations.c:ForceZero Unexecuted instantiation: ge_448.c:ForceZero Unexecuted instantiation: ge_operations.c:ForceZero Unexecuted instantiation: hash.c:ForceZero Line | Count | Source | 465 | 2.48k | { | 466 | 2.48k | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 2.48k | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 2.48k | && defined(WORD64_AVAILABLE) | 470 | 2.48k | volatile word64* w; | 471 | 2.48k | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 2.48k | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 2.48k | (sizeof(word64)-1); | 474 | | | 475 | 2.48k | if (len < l) l = len; | 476 | 2.48k | len -= l; | 477 | 2.48k | while (l--) *z++ = 0; | 478 | 2.48k | #endif | 479 | 2.48k | for (w = (volatile word64*)z; | 480 | 280k | len >= sizeof(*w); | 481 | 277k | len -= (word32)sizeof(*w)) | 482 | 277k | { | 483 | 277k | *w++ = 0; | 484 | 277k | } | 485 | 2.48k | z = (volatile byte*)w; | 486 | 2.48k | #endif | 487 | | | 488 | 2.48k | while (len--) *z++ = 0; | 489 | 2.48k | } |
Unexecuted instantiation: kdf.c:ForceZero Unexecuted instantiation: md2.c:ForceZero Unexecuted instantiation: md4.c:ForceZero Unexecuted instantiation: md5.c:ForceZero Unexecuted instantiation: poly1305.c:ForceZero Unexecuted instantiation: pwdbased.c:ForceZero Line | Count | Source | 465 | 22.8k | { | 466 | 22.8k | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 22.8k | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 22.8k | && defined(WORD64_AVAILABLE) | 470 | 22.8k | volatile word64* w; | 471 | 22.8k | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 22.8k | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 22.8k | (sizeof(word64)-1); | 474 | | | 475 | 22.8k | if (len < l) l = len; | 476 | 22.8k | len -= l; | 477 | 22.8k | while (l--) *z++ = 0; | 478 | 22.8k | #endif | 479 | 22.8k | for (w = (volatile word64*)z; | 480 | 137k | len >= sizeof(*w); | 481 | 114k | len -= (word32)sizeof(*w)) | 482 | 114k | { | 483 | 114k | *w++ = 0; | 484 | 114k | } | 485 | 22.8k | z = (volatile byte*)w; | 486 | 22.8k | #endif | 487 | | | 488 | 102k | while (len--) *z++ = 0; | 489 | 22.8k | } |
Unexecuted instantiation: ripemd.c:ForceZero Unexecuted instantiation: rsa.c:ForceZero Unexecuted instantiation: sha.c:ForceZero Line | Count | Source | 465 | 134k | { | 466 | 134k | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 134k | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 134k | && defined(WORD64_AVAILABLE) | 470 | 134k | volatile word64* w; | 471 | 134k | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 134k | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 134k | (sizeof(word64)-1); | 474 | | | 475 | 134k | if (len < l) l = len; | 476 | 134k | len -= l; | 477 | 134k | while (l--) *z++ = 0; | 478 | 134k | #endif | 479 | 134k | for (w = (volatile word64*)z; | 480 | 3.99M | len >= sizeof(*w); | 481 | 3.86M | len -= (word32)sizeof(*w)) | 482 | 3.86M | { | 483 | 3.86M | *w++ = 0; | 484 | 3.86M | } | 485 | 134k | z = (volatile byte*)w; | 486 | 134k | #endif | 487 | | | 488 | 134k | while (len--) *z++ = 0; | 489 | 134k | } |
Unexecuted instantiation: sha3.c:ForceZero Line | Count | Source | 465 | 37.6k | { | 466 | 37.6k | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 37.6k | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 37.6k | && defined(WORD64_AVAILABLE) | 470 | 37.6k | volatile word64* w; | 471 | 37.6k | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 37.6k | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 37.6k | (sizeof(word64)-1); | 474 | | | 475 | 37.6k | if (len < l) l = len; | 476 | 37.6k | len -= l; | 477 | 37.6k | while (l--) *z++ = 0; | 478 | 37.6k | #endif | 479 | 37.6k | for (w = (volatile word64*)z; | 480 | 491k | len >= sizeof(*w); | 481 | 453k | len -= (word32)sizeof(*w)) | 482 | 453k | { | 483 | 453k | *w++ = 0; | 484 | 453k | } | 485 | 37.6k | z = (volatile byte*)w; | 486 | 37.6k | #endif | 487 | | | 488 | 37.6k | while (len--) *z++ = 0; | 489 | 37.6k | } |
Unexecuted instantiation: siphash.c:ForceZero Unexecuted instantiation: sm2.c:ForceZero Unexecuted instantiation: sm3.c:ForceZero Unexecuted instantiation: sm4.c:ForceZero Line | Count | Source | 465 | 2.23k | { | 466 | 2.23k | volatile byte* z = (volatile byte*)mem; | 467 | | | 468 | 2.23k | #if (defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)) \ | 469 | 2.23k | && defined(WORD64_AVAILABLE) | 470 | 2.23k | volatile word64* w; | 471 | 2.23k | #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS | 472 | 2.23k | word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & | 473 | 2.23k | (sizeof(word64)-1); | 474 | | | 475 | 2.23k | if (len < l) l = len; | 476 | 2.23k | len -= l; | 477 | 2.23k | while (l--) *z++ = 0; | 478 | 2.23k | #endif | 479 | 2.23k | for (w = (volatile word64*)z; | 480 | 77.5k | len >= sizeof(*w); | 481 | 75.3k | len -= (word32)sizeof(*w)) | 482 | 75.3k | { | 483 | 75.3k | *w++ = 0; | 484 | 75.3k | } | 485 | 2.23k | z = (volatile byte*)w; | 486 | 2.23k | #endif | 487 | | | 488 | 2.23k | while (len--) *z++ = 0; | 489 | 2.23k | } |
Unexecuted instantiation: wc_encrypt.c:ForceZero Unexecuted instantiation: wolfmath.c:ForceZero Unexecuted instantiation: ssl.c:ForceZero Unexecuted instantiation: tls.c:ForceZero Unexecuted instantiation: tls13.c:ForceZero Unexecuted instantiation: internal.c:ForceZero |
490 | | #endif |
491 | | |
492 | | |
493 | | #ifndef WOLFSSL_NO_CONST_CMP |
494 | | /* check all length bytes for equality, return 0 on success */ |
495 | | WC_MISC_STATIC WC_INLINE int ConstantCompare(const byte* a, const byte* b, |
496 | | int length) |
497 | 281 | { |
498 | 281 | int i; |
499 | 281 | int compareSum = 0; |
500 | | |
501 | 6.61k | for (i = 0; i < length; i++) { |
502 | 6.33k | compareSum |= a[i] ^ b[i]; |
503 | 6.33k | } |
504 | | |
505 | 281 | return compareSum; |
506 | 281 | } Line | Count | Source | 497 | 9 | { | 498 | 9 | int i; | 499 | 9 | int compareSum = 0; | 500 | | | 501 | 76 | for (i = 0; i < length; i++) { | 502 | 67 | compareSum |= a[i] ^ b[i]; | 503 | 67 | } | 504 | | | 505 | 9 | return compareSum; | 506 | 9 | } |
Unexecuted instantiation: asn.c:ConstantCompare Unexecuted instantiation: camellia.c:ConstantCompare Unexecuted instantiation: chacha.c:ConstantCompare chacha20_poly1305.c:ConstantCompare Line | Count | Source | 497 | 1 | { | 498 | 1 | int i; | 499 | 1 | int compareSum = 0; | 500 | | | 501 | 17 | for (i = 0; i < length; i++) { | 502 | 16 | compareSum |= a[i] ^ b[i]; | 503 | 16 | } | 504 | | | 505 | 1 | return compareSum; | 506 | 1 | } |
Unexecuted instantiation: cmac.c:ConstantCompare Unexecuted instantiation: coding.c:ConstantCompare Unexecuted instantiation: curve25519.c:ConstantCompare Unexecuted instantiation: curve448.c:ConstantCompare Unexecuted instantiation: des3.c:ConstantCompare Unexecuted instantiation: dh.c:ConstantCompare Unexecuted instantiation: ecc.c:ConstantCompare Unexecuted instantiation: eccsi.c:ConstantCompare ed25519.c:ConstantCompare Line | Count | Source | 497 | 3 | { | 498 | 3 | int i; | 499 | 3 | int compareSum = 0; | 500 | | | 501 | 99 | for (i = 0; i < length; i++) { | 502 | 96 | compareSum |= a[i] ^ b[i]; | 503 | 96 | } | 504 | | | 505 | 3 | return compareSum; | 506 | 3 | } |
Line | Count | Source | 497 | 1 | { | 498 | 1 | int i; | 499 | 1 | int compareSum = 0; | 500 | | | 501 | 58 | for (i = 0; i < length; i++) { | 502 | 57 | compareSum |= a[i] ^ b[i]; | 503 | 57 | } | 504 | | | 505 | 1 | return compareSum; | 506 | 1 | } |
Unexecuted instantiation: fe_448.c:ConstantCompare fe_operations.c:ConstantCompare Line | Count | Source | 497 | 29 | { | 498 | 29 | int i; | 499 | 29 | int compareSum = 0; | 500 | | | 501 | 957 | for (i = 0; i < length; i++) { | 502 | 928 | compareSum |= a[i] ^ b[i]; | 503 | 928 | } | 504 | | | 505 | 29 | return compareSum; | 506 | 29 | } |
Unexecuted instantiation: ge_448.c:ConstantCompare Unexecuted instantiation: ge_operations.c:ConstantCompare Unexecuted instantiation: hash.c:ConstantCompare Unexecuted instantiation: hmac.c:ConstantCompare Unexecuted instantiation: kdf.c:ConstantCompare Unexecuted instantiation: md2.c:ConstantCompare Unexecuted instantiation: md4.c:ConstantCompare Unexecuted instantiation: md5.c:ConstantCompare Unexecuted instantiation: poly1305.c:ConstantCompare Unexecuted instantiation: pwdbased.c:ConstantCompare Line | Count | Source | 497 | 238 | { | 498 | 238 | int i; | 499 | 238 | int compareSum = 0; | 500 | | | 501 | 5.40k | for (i = 0; i < length; i++) { | 502 | 5.16k | compareSum |= a[i] ^ b[i]; | 503 | 5.16k | } | 504 | | | 505 | 238 | return compareSum; | 506 | 238 | } |
Unexecuted instantiation: ripemd.c:ConstantCompare Unexecuted instantiation: rsa.c:ConstantCompare Unexecuted instantiation: sha.c:ConstantCompare Unexecuted instantiation: sha256.c:ConstantCompare Unexecuted instantiation: sha3.c:ConstantCompare Unexecuted instantiation: sha512.c:ConstantCompare Unexecuted instantiation: siphash.c:ConstantCompare Unexecuted instantiation: sm2.c:ConstantCompare Unexecuted instantiation: sm3.c:ConstantCompare Unexecuted instantiation: sm4.c:ConstantCompare Unexecuted instantiation: sp_int.c:ConstantCompare Unexecuted instantiation: wc_encrypt.c:ConstantCompare Unexecuted instantiation: wolfmath.c:ConstantCompare Unexecuted instantiation: ssl.c:ConstantCompare Unexecuted instantiation: tls.c:ConstantCompare Unexecuted instantiation: tls13.c:ConstantCompare Unexecuted instantiation: internal.c:ConstantCompare |
507 | | #endif |
508 | | |
509 | | |
510 | | #ifndef WOLFSSL_HAVE_MIN |
511 | | #define WOLFSSL_HAVE_MIN |
512 | | #if defined(HAVE_FIPS) && !defined(min) /* so ifdef check passes */ |
513 | | #define min min |
514 | | #endif |
515 | | /* returns the smaller of a and b */ |
516 | | WC_MISC_STATIC WC_INLINE word32 min(word32 a, word32 b) |
517 | 61.3k | { |
518 | 61.3k | return a > b ? b : a; |
519 | 61.3k | } Line | Count | Source | 517 | 9 | { | 518 | 9 | return a > b ? b : a; | 519 | 9 | } |
Unexecuted instantiation: asn.c:min Unexecuted instantiation: camellia.c:min Unexecuted instantiation: chacha.c:min Unexecuted instantiation: chacha20_poly1305.c:min Line | Count | Source | 517 | 59 | { | 518 | 59 | return a > b ? b : a; | 519 | 59 | } |
Unexecuted instantiation: coding.c:min Unexecuted instantiation: curve25519.c:min Unexecuted instantiation: curve448.c:min Unexecuted instantiation: des3.c:min Line | Count | Source | 517 | 1 | { | 518 | 1 | return a > b ? b : a; | 519 | 1 | } |
Line | Count | Source | 517 | 103 | { | 518 | 103 | return a > b ? b : a; | 519 | 103 | } |
Unexecuted instantiation: eccsi.c:min Unexecuted instantiation: ed25519.c:min Unexecuted instantiation: ed448.c:min Unexecuted instantiation: fe_448.c:min Unexecuted instantiation: fe_operations.c:min Unexecuted instantiation: ge_448.c:min Unexecuted instantiation: ge_operations.c:min Unexecuted instantiation: hash.c:min Line | Count | Source | 517 | 2.15k | { | 518 | 2.15k | return a > b ? b : a; | 519 | 2.15k | } |
Unexecuted instantiation: kdf.c:min Unexecuted instantiation: md2.c:min Line | Count | Source | 517 | 405 | { | 518 | 405 | return a > b ? b : a; | 519 | 405 | } |
Line | Count | Source | 517 | 4.80k | { | 518 | 4.80k | return a > b ? b : a; | 519 | 4.80k | } |
Unexecuted instantiation: poly1305.c:min Line | Count | Source | 517 | 1.90k | { | 518 | 1.90k | return a > b ? b : a; | 519 | 1.90k | } |
Line | Count | Source | 517 | 221 | { | 518 | 221 | return a > b ? b : a; | 519 | 221 | } |
Line | Count | Source | 517 | 17.7k | { | 518 | 17.7k | return a > b ? b : a; | 519 | 17.7k | } |
Unexecuted instantiation: rsa.c:min Line | Count | Source | 517 | 7.96k | { | 518 | 7.96k | return a > b ? b : a; | 519 | 7.96k | } |
Line | Count | Source | 517 | 23.8k | { | 518 | 23.8k | return a > b ? b : a; | 519 | 23.8k | } |
Unexecuted instantiation: sha3.c:min Line | Count | Source | 517 | 343 | { | 518 | 343 | return a > b ? b : a; | 519 | 343 | } |
Unexecuted instantiation: siphash.c:min Unexecuted instantiation: sm2.c:min Line | Count | Source | 517 | 1.79k | { | 518 | 1.79k | return a > b ? b : a; | 519 | 1.79k | } |
Unexecuted instantiation: sm4.c:min Unexecuted instantiation: sp_int.c:min Unexecuted instantiation: wc_encrypt.c:min Unexecuted instantiation: wolfmath.c:min Unexecuted instantiation: ssl.c:min Unexecuted instantiation: tls.c:min Unexecuted instantiation: tls13.c:min Unexecuted instantiation: internal.c:min |
520 | | #endif /* !WOLFSSL_HAVE_MIN */ |
521 | | |
522 | | #ifndef WOLFSSL_HAVE_MAX |
523 | | #define WOLFSSL_HAVE_MAX |
524 | | #if defined(HAVE_FIPS) && !defined(max) /* so ifdef check passes */ |
525 | | #define max max |
526 | | #endif |
527 | | WC_MISC_STATIC WC_INLINE word32 max(word32 a, word32 b) |
528 | 0 | { |
529 | 0 | return a > b ? a : b; |
530 | 0 | } Unexecuted instantiation: aes.c:max Unexecuted instantiation: asn.c:max Unexecuted instantiation: camellia.c:max Unexecuted instantiation: chacha.c:max Unexecuted instantiation: chacha20_poly1305.c:max Unexecuted instantiation: cmac.c:max Unexecuted instantiation: coding.c:max Unexecuted instantiation: curve25519.c:max Unexecuted instantiation: curve448.c:max Unexecuted instantiation: des3.c:max Unexecuted instantiation: dh.c:max Unexecuted instantiation: ecc.c:max Unexecuted instantiation: eccsi.c:max Unexecuted instantiation: ed25519.c:max Unexecuted instantiation: ed448.c:max Unexecuted instantiation: fe_448.c:max Unexecuted instantiation: fe_operations.c:max Unexecuted instantiation: ge_448.c:max Unexecuted instantiation: ge_operations.c:max Unexecuted instantiation: hash.c:max Unexecuted instantiation: hmac.c:max Unexecuted instantiation: kdf.c:max Unexecuted instantiation: md2.c:max Unexecuted instantiation: md4.c:max Unexecuted instantiation: md5.c:max Unexecuted instantiation: poly1305.c:max Unexecuted instantiation: pwdbased.c:max Unexecuted instantiation: random.c:max Unexecuted instantiation: ripemd.c:max Unexecuted instantiation: rsa.c:max Unexecuted instantiation: sha.c:max Unexecuted instantiation: sha256.c:max Unexecuted instantiation: sha3.c:max Unexecuted instantiation: sha512.c:max Unexecuted instantiation: siphash.c:max Unexecuted instantiation: sm2.c:max Unexecuted instantiation: sm3.c:max Unexecuted instantiation: sm4.c:max Unexecuted instantiation: sp_int.c:max Unexecuted instantiation: wc_encrypt.c:max Unexecuted instantiation: wolfmath.c:max Unexecuted instantiation: ssl.c:max Unexecuted instantiation: tls.c:max Unexecuted instantiation: tls13.c:max Unexecuted instantiation: internal.c:max |
531 | | #endif /* !WOLFSSL_HAVE_MAX */ |
532 | | |
533 | | #ifndef WOLFSSL_NO_INT_ENCODE |
534 | | /* converts a 32 bit integer to 24 bit */ |
535 | | WC_MISC_STATIC WC_INLINE void c32to24(word32 in, word24 out) |
536 | 0 | { |
537 | 0 | out[0] = (byte)((in >> 16) & 0xff); |
538 | 0 | out[1] = (byte)((in >> 8) & 0xff); |
539 | 0 | out[2] = (byte)(in & 0xff); |
540 | 0 | } Unexecuted instantiation: aes.c:c32to24 Unexecuted instantiation: asn.c:c32to24 Unexecuted instantiation: camellia.c:c32to24 Unexecuted instantiation: chacha.c:c32to24 Unexecuted instantiation: chacha20_poly1305.c:c32to24 Unexecuted instantiation: cmac.c:c32to24 Unexecuted instantiation: coding.c:c32to24 Unexecuted instantiation: curve25519.c:c32to24 Unexecuted instantiation: curve448.c:c32to24 Unexecuted instantiation: des3.c:c32to24 Unexecuted instantiation: dh.c:c32to24 Unexecuted instantiation: ecc.c:c32to24 Unexecuted instantiation: eccsi.c:c32to24 Unexecuted instantiation: ed25519.c:c32to24 Unexecuted instantiation: ed448.c:c32to24 Unexecuted instantiation: fe_448.c:c32to24 Unexecuted instantiation: fe_operations.c:c32to24 Unexecuted instantiation: ge_448.c:c32to24 Unexecuted instantiation: ge_operations.c:c32to24 Unexecuted instantiation: hash.c:c32to24 Unexecuted instantiation: hmac.c:c32to24 Unexecuted instantiation: kdf.c:c32to24 Unexecuted instantiation: md2.c:c32to24 Unexecuted instantiation: md4.c:c32to24 Unexecuted instantiation: md5.c:c32to24 Unexecuted instantiation: poly1305.c:c32to24 Unexecuted instantiation: pwdbased.c:c32to24 Unexecuted instantiation: random.c:c32to24 Unexecuted instantiation: ripemd.c:c32to24 Unexecuted instantiation: rsa.c:c32to24 Unexecuted instantiation: sha.c:c32to24 Unexecuted instantiation: sha256.c:c32to24 Unexecuted instantiation: sha3.c:c32to24 Unexecuted instantiation: sha512.c:c32to24 Unexecuted instantiation: siphash.c:c32to24 Unexecuted instantiation: sm2.c:c32to24 Unexecuted instantiation: sm3.c:c32to24 Unexecuted instantiation: sm4.c:c32to24 Unexecuted instantiation: sp_int.c:c32to24 Unexecuted instantiation: wc_encrypt.c:c32to24 Unexecuted instantiation: wolfmath.c:c32to24 Unexecuted instantiation: ssl.c:c32to24 Unexecuted instantiation: tls.c:c32to24 Unexecuted instantiation: tls13.c:c32to24 Unexecuted instantiation: internal.c:c32to24 |
541 | | |
542 | | /* convert 16 bit integer to opaque */ |
543 | | WC_MISC_STATIC WC_INLINE void c16toa(word16 wc_u16, byte* c) |
544 | 0 | { |
545 | 0 | c[0] = (byte)((wc_u16 >> 8) & 0xff); |
546 | 0 | c[1] = (byte)(wc_u16 & 0xff); |
547 | 0 | } Unexecuted instantiation: aes.c:c16toa Unexecuted instantiation: asn.c:c16toa Unexecuted instantiation: camellia.c:c16toa Unexecuted instantiation: chacha.c:c16toa Unexecuted instantiation: chacha20_poly1305.c:c16toa Unexecuted instantiation: cmac.c:c16toa Unexecuted instantiation: coding.c:c16toa Unexecuted instantiation: curve25519.c:c16toa Unexecuted instantiation: curve448.c:c16toa Unexecuted instantiation: des3.c:c16toa Unexecuted instantiation: dh.c:c16toa Unexecuted instantiation: ecc.c:c16toa Unexecuted instantiation: eccsi.c:c16toa Unexecuted instantiation: ed25519.c:c16toa Unexecuted instantiation: ed448.c:c16toa Unexecuted instantiation: fe_448.c:c16toa Unexecuted instantiation: fe_operations.c:c16toa Unexecuted instantiation: ge_448.c:c16toa Unexecuted instantiation: ge_operations.c:c16toa Unexecuted instantiation: hash.c:c16toa Unexecuted instantiation: hmac.c:c16toa Unexecuted instantiation: kdf.c:c16toa Unexecuted instantiation: md2.c:c16toa Unexecuted instantiation: md4.c:c16toa Unexecuted instantiation: md5.c:c16toa Unexecuted instantiation: poly1305.c:c16toa Unexecuted instantiation: pwdbased.c:c16toa Unexecuted instantiation: random.c:c16toa Unexecuted instantiation: ripemd.c:c16toa Unexecuted instantiation: rsa.c:c16toa Unexecuted instantiation: sha.c:c16toa Unexecuted instantiation: sha256.c:c16toa Unexecuted instantiation: sha3.c:c16toa Unexecuted instantiation: sha512.c:c16toa Unexecuted instantiation: siphash.c:c16toa Unexecuted instantiation: sm2.c:c16toa Unexecuted instantiation: sm3.c:c16toa Unexecuted instantiation: sm4.c:c16toa Unexecuted instantiation: sp_int.c:c16toa Unexecuted instantiation: wc_encrypt.c:c16toa Unexecuted instantiation: wolfmath.c:c16toa Unexecuted instantiation: ssl.c:c16toa Unexecuted instantiation: tls.c:c16toa Unexecuted instantiation: tls13.c:c16toa Unexecuted instantiation: internal.c:c16toa |
548 | | |
549 | | /* convert 32 bit integer to opaque */ |
550 | | WC_MISC_STATIC WC_INLINE void c32toa(word32 wc_u32, byte* c) |
551 | 0 | { |
552 | 0 | #ifdef WOLFSSL_USE_ALIGN |
553 | 0 | c[0] = (byte)((wc_u32 >> 24) & 0xff); |
554 | 0 | c[1] = (byte)((wc_u32 >> 16) & 0xff); |
555 | 0 | c[2] = (byte)((wc_u32 >> 8) & 0xff); |
556 | 0 | c[3] = (byte)(wc_u32 & 0xff); |
557 | | #elif defined(LITTLE_ENDIAN_ORDER) |
558 | | *(word32*)c = ByteReverseWord32(wc_u32); |
559 | | #else |
560 | | *(word32*)c = wc_u32; |
561 | | #endif |
562 | 0 | } Unexecuted instantiation: aes.c:c32toa Unexecuted instantiation: asn.c:c32toa Unexecuted instantiation: camellia.c:c32toa Unexecuted instantiation: chacha.c:c32toa Unexecuted instantiation: chacha20_poly1305.c:c32toa Unexecuted instantiation: cmac.c:c32toa Unexecuted instantiation: coding.c:c32toa Unexecuted instantiation: curve25519.c:c32toa Unexecuted instantiation: curve448.c:c32toa Unexecuted instantiation: des3.c:c32toa Unexecuted instantiation: dh.c:c32toa Unexecuted instantiation: ecc.c:c32toa Unexecuted instantiation: eccsi.c:c32toa Unexecuted instantiation: ed25519.c:c32toa Unexecuted instantiation: ed448.c:c32toa Unexecuted instantiation: fe_448.c:c32toa Unexecuted instantiation: fe_operations.c:c32toa Unexecuted instantiation: ge_448.c:c32toa Unexecuted instantiation: ge_operations.c:c32toa Unexecuted instantiation: hash.c:c32toa Unexecuted instantiation: hmac.c:c32toa Unexecuted instantiation: kdf.c:c32toa Unexecuted instantiation: md2.c:c32toa Unexecuted instantiation: md4.c:c32toa Unexecuted instantiation: md5.c:c32toa Unexecuted instantiation: poly1305.c:c32toa Unexecuted instantiation: pwdbased.c:c32toa Unexecuted instantiation: random.c:c32toa Unexecuted instantiation: ripemd.c:c32toa Unexecuted instantiation: rsa.c:c32toa Unexecuted instantiation: sha.c:c32toa Unexecuted instantiation: sha256.c:c32toa Unexecuted instantiation: sha3.c:c32toa Unexecuted instantiation: sha512.c:c32toa Unexecuted instantiation: siphash.c:c32toa Unexecuted instantiation: sm2.c:c32toa Unexecuted instantiation: sm3.c:c32toa Unexecuted instantiation: sm4.c:c32toa Unexecuted instantiation: sp_int.c:c32toa Unexecuted instantiation: wc_encrypt.c:c32toa Unexecuted instantiation: wolfmath.c:c32toa Unexecuted instantiation: ssl.c:c32toa Unexecuted instantiation: tls.c:c32toa Unexecuted instantiation: tls13.c:c32toa Unexecuted instantiation: internal.c:c32toa |
563 | | #endif |
564 | | |
565 | | #ifndef WOLFSSL_NO_INT_DECODE |
566 | | /* convert a 24 bit integer into a 32 bit one */ |
567 | | WC_MISC_STATIC WC_INLINE void c24to32(const word24 wc_u24, word32* wc_u32) |
568 | 0 | { |
569 | 0 | *wc_u32 = ((word32)wc_u24[0] << 16) | |
570 | 0 | ((word32)wc_u24[1] << 8) | |
571 | 0 | (word32)wc_u24[2]; |
572 | 0 | } Unexecuted instantiation: aes.c:c24to32 Unexecuted instantiation: asn.c:c24to32 Unexecuted instantiation: camellia.c:c24to32 Unexecuted instantiation: chacha.c:c24to32 Unexecuted instantiation: chacha20_poly1305.c:c24to32 Unexecuted instantiation: cmac.c:c24to32 Unexecuted instantiation: coding.c:c24to32 Unexecuted instantiation: curve25519.c:c24to32 Unexecuted instantiation: curve448.c:c24to32 Unexecuted instantiation: des3.c:c24to32 Unexecuted instantiation: dh.c:c24to32 Unexecuted instantiation: ecc.c:c24to32 Unexecuted instantiation: eccsi.c:c24to32 Unexecuted instantiation: ed25519.c:c24to32 Unexecuted instantiation: ed448.c:c24to32 Unexecuted instantiation: fe_448.c:c24to32 Unexecuted instantiation: fe_operations.c:c24to32 Unexecuted instantiation: ge_448.c:c24to32 Unexecuted instantiation: ge_operations.c:c24to32 Unexecuted instantiation: hash.c:c24to32 Unexecuted instantiation: hmac.c:c24to32 Unexecuted instantiation: kdf.c:c24to32 Unexecuted instantiation: md2.c:c24to32 Unexecuted instantiation: md4.c:c24to32 Unexecuted instantiation: md5.c:c24to32 Unexecuted instantiation: poly1305.c:c24to32 Unexecuted instantiation: pwdbased.c:c24to32 Unexecuted instantiation: random.c:c24to32 Unexecuted instantiation: ripemd.c:c24to32 Unexecuted instantiation: rsa.c:c24to32 Unexecuted instantiation: sha.c:c24to32 Unexecuted instantiation: sha256.c:c24to32 Unexecuted instantiation: sha3.c:c24to32 Unexecuted instantiation: sha512.c:c24to32 Unexecuted instantiation: siphash.c:c24to32 Unexecuted instantiation: sm2.c:c24to32 Unexecuted instantiation: sm3.c:c24to32 Unexecuted instantiation: sm4.c:c24to32 Unexecuted instantiation: sp_int.c:c24to32 Unexecuted instantiation: wc_encrypt.c:c24to32 Unexecuted instantiation: wolfmath.c:c24to32 Unexecuted instantiation: ssl.c:c24to32 Unexecuted instantiation: tls.c:c24to32 Unexecuted instantiation: tls13.c:c24to32 Unexecuted instantiation: internal.c:c24to32 |
573 | | |
574 | | |
575 | | /* convert opaque to 24 bit integer */ |
576 | | WC_MISC_STATIC WC_INLINE void ato24(const byte* c, word32* wc_u24) |
577 | 0 | { |
578 | 0 | *wc_u24 = ((word32)c[0] << 16) | ((word32)c[1] << 8) | c[2]; |
579 | 0 | } Unexecuted instantiation: aes.c:ato24 Unexecuted instantiation: asn.c:ato24 Unexecuted instantiation: camellia.c:ato24 Unexecuted instantiation: chacha.c:ato24 Unexecuted instantiation: chacha20_poly1305.c:ato24 Unexecuted instantiation: cmac.c:ato24 Unexecuted instantiation: coding.c:ato24 Unexecuted instantiation: curve25519.c:ato24 Unexecuted instantiation: curve448.c:ato24 Unexecuted instantiation: des3.c:ato24 Unexecuted instantiation: dh.c:ato24 Unexecuted instantiation: ecc.c:ato24 Unexecuted instantiation: eccsi.c:ato24 Unexecuted instantiation: ed25519.c:ato24 Unexecuted instantiation: ed448.c:ato24 Unexecuted instantiation: fe_448.c:ato24 Unexecuted instantiation: fe_operations.c:ato24 Unexecuted instantiation: ge_448.c:ato24 Unexecuted instantiation: ge_operations.c:ato24 Unexecuted instantiation: hash.c:ato24 Unexecuted instantiation: hmac.c:ato24 Unexecuted instantiation: kdf.c:ato24 Unexecuted instantiation: md2.c:ato24 Unexecuted instantiation: md4.c:ato24 Unexecuted instantiation: md5.c:ato24 Unexecuted instantiation: poly1305.c:ato24 Unexecuted instantiation: pwdbased.c:ato24 Unexecuted instantiation: random.c:ato24 Unexecuted instantiation: ripemd.c:ato24 Unexecuted instantiation: rsa.c:ato24 Unexecuted instantiation: sha.c:ato24 Unexecuted instantiation: sha256.c:ato24 Unexecuted instantiation: sha3.c:ato24 Unexecuted instantiation: sha512.c:ato24 Unexecuted instantiation: siphash.c:ato24 Unexecuted instantiation: sm2.c:ato24 Unexecuted instantiation: sm3.c:ato24 Unexecuted instantiation: sm4.c:ato24 Unexecuted instantiation: sp_int.c:ato24 Unexecuted instantiation: wc_encrypt.c:ato24 Unexecuted instantiation: wolfmath.c:ato24 Unexecuted instantiation: ssl.c:ato24 Unexecuted instantiation: tls.c:ato24 Unexecuted instantiation: tls13.c:ato24 Unexecuted instantiation: internal.c:ato24 |
580 | | |
581 | | /* convert opaque to 16 bit integer */ |
582 | | WC_MISC_STATIC WC_INLINE void ato16(const byte* c, word16* wc_u16) |
583 | 0 | { |
584 | 0 | *wc_u16 = (word16) ((c[0] << 8) | (c[1])); |
585 | 0 | } Unexecuted instantiation: aes.c:ato16 Unexecuted instantiation: asn.c:ato16 Unexecuted instantiation: camellia.c:ato16 Unexecuted instantiation: chacha.c:ato16 Unexecuted instantiation: chacha20_poly1305.c:ato16 Unexecuted instantiation: cmac.c:ato16 Unexecuted instantiation: coding.c:ato16 Unexecuted instantiation: curve25519.c:ato16 Unexecuted instantiation: curve448.c:ato16 Unexecuted instantiation: des3.c:ato16 Unexecuted instantiation: dh.c:ato16 Unexecuted instantiation: ecc.c:ato16 Unexecuted instantiation: eccsi.c:ato16 Unexecuted instantiation: ed25519.c:ato16 Unexecuted instantiation: ed448.c:ato16 Unexecuted instantiation: fe_448.c:ato16 Unexecuted instantiation: fe_operations.c:ato16 Unexecuted instantiation: ge_448.c:ato16 Unexecuted instantiation: ge_operations.c:ato16 Unexecuted instantiation: hash.c:ato16 Unexecuted instantiation: hmac.c:ato16 Unexecuted instantiation: kdf.c:ato16 Unexecuted instantiation: md2.c:ato16 Unexecuted instantiation: md4.c:ato16 Unexecuted instantiation: md5.c:ato16 Unexecuted instantiation: poly1305.c:ato16 Unexecuted instantiation: pwdbased.c:ato16 Unexecuted instantiation: random.c:ato16 Unexecuted instantiation: ripemd.c:ato16 Unexecuted instantiation: rsa.c:ato16 Unexecuted instantiation: sha.c:ato16 Unexecuted instantiation: sha256.c:ato16 Unexecuted instantiation: sha3.c:ato16 Unexecuted instantiation: sha512.c:ato16 Unexecuted instantiation: siphash.c:ato16 Unexecuted instantiation: sm2.c:ato16 Unexecuted instantiation: sm3.c:ato16 Unexecuted instantiation: sm4.c:ato16 Unexecuted instantiation: sp_int.c:ato16 Unexecuted instantiation: wc_encrypt.c:ato16 Unexecuted instantiation: wolfmath.c:ato16 Unexecuted instantiation: ssl.c:ato16 Unexecuted instantiation: tls.c:ato16 Unexecuted instantiation: tls13.c:ato16 Unexecuted instantiation: internal.c:ato16 |
586 | | |
587 | | /* convert opaque to 32 bit integer */ |
588 | | WC_MISC_STATIC WC_INLINE void ato32(const byte* c, word32* wc_u32) |
589 | 0 | { |
590 | 0 | #ifdef WOLFSSL_USE_ALIGN |
591 | 0 | *wc_u32 = ((word32)c[0] << 24) | |
592 | 0 | ((word32)c[1] << 16) | |
593 | 0 | ((word32)c[2] << 8) | |
594 | 0 | (word32)c[3]; |
595 | 0 | #elif defined(LITTLE_ENDIAN_ORDER) |
596 | 0 | *wc_u32 = ByteReverseWord32(*(word32*)c); |
597 | 0 | #else |
598 | 0 | *wc_u32 = *(word32*)c; |
599 | 0 | #endif |
600 | 0 | } Unexecuted instantiation: aes.c:ato32 Unexecuted instantiation: asn.c:ato32 Unexecuted instantiation: camellia.c:ato32 Unexecuted instantiation: chacha.c:ato32 Unexecuted instantiation: chacha20_poly1305.c:ato32 Unexecuted instantiation: cmac.c:ato32 Unexecuted instantiation: coding.c:ato32 Unexecuted instantiation: curve25519.c:ato32 Unexecuted instantiation: curve448.c:ato32 Unexecuted instantiation: des3.c:ato32 Unexecuted instantiation: dh.c:ato32 Unexecuted instantiation: ecc.c:ato32 Unexecuted instantiation: eccsi.c:ato32 Unexecuted instantiation: ed25519.c:ato32 Unexecuted instantiation: ed448.c:ato32 Unexecuted instantiation: fe_448.c:ato32 Unexecuted instantiation: fe_operations.c:ato32 Unexecuted instantiation: ge_448.c:ato32 Unexecuted instantiation: ge_operations.c:ato32 Unexecuted instantiation: hash.c:ato32 Unexecuted instantiation: hmac.c:ato32 Unexecuted instantiation: kdf.c:ato32 Unexecuted instantiation: md2.c:ato32 Unexecuted instantiation: md4.c:ato32 Unexecuted instantiation: md5.c:ato32 Unexecuted instantiation: poly1305.c:ato32 Unexecuted instantiation: pwdbased.c:ato32 Unexecuted instantiation: random.c:ato32 Unexecuted instantiation: ripemd.c:ato32 Unexecuted instantiation: rsa.c:ato32 Unexecuted instantiation: sha.c:ato32 Unexecuted instantiation: sha256.c:ato32 Unexecuted instantiation: sha3.c:ato32 Unexecuted instantiation: sha512.c:ato32 Unexecuted instantiation: siphash.c:ato32 Unexecuted instantiation: sm2.c:ato32 Unexecuted instantiation: sm3.c:ato32 Unexecuted instantiation: sm4.c:ato32 Unexecuted instantiation: sp_int.c:ato32 Unexecuted instantiation: wc_encrypt.c:ato32 Unexecuted instantiation: wolfmath.c:ato32 Unexecuted instantiation: ssl.c:ato32 Unexecuted instantiation: tls.c:ato32 Unexecuted instantiation: tls13.c:ato32 Unexecuted instantiation: internal.c:ato32 |
601 | | |
602 | | /* convert opaque to 32 bit integer. Interpret as little endian. */ |
603 | | WC_MISC_STATIC WC_INLINE void ato32le(const byte* c, word32* wc_u32) |
604 | 0 | { |
605 | 0 | *wc_u32 = (word32)c[0] | |
606 | 0 | ((word32)c[1] << 8) | |
607 | 0 | ((word32)c[2] << 16) | |
608 | 0 | ((word32)c[3] << 24); |
609 | 0 | } Unexecuted instantiation: aes.c:ato32le Unexecuted instantiation: asn.c:ato32le Unexecuted instantiation: camellia.c:ato32le Unexecuted instantiation: chacha.c:ato32le Unexecuted instantiation: chacha20_poly1305.c:ato32le Unexecuted instantiation: cmac.c:ato32le Unexecuted instantiation: coding.c:ato32le Unexecuted instantiation: curve25519.c:ato32le Unexecuted instantiation: curve448.c:ato32le Unexecuted instantiation: des3.c:ato32le Unexecuted instantiation: dh.c:ato32le Unexecuted instantiation: ecc.c:ato32le Unexecuted instantiation: eccsi.c:ato32le Unexecuted instantiation: ed25519.c:ato32le Unexecuted instantiation: ed448.c:ato32le Unexecuted instantiation: fe_448.c:ato32le Unexecuted instantiation: fe_operations.c:ato32le Unexecuted instantiation: ge_448.c:ato32le Unexecuted instantiation: ge_operations.c:ato32le Unexecuted instantiation: hash.c:ato32le Unexecuted instantiation: hmac.c:ato32le Unexecuted instantiation: kdf.c:ato32le Unexecuted instantiation: md2.c:ato32le Unexecuted instantiation: md4.c:ato32le Unexecuted instantiation: md5.c:ato32le Unexecuted instantiation: poly1305.c:ato32le Unexecuted instantiation: pwdbased.c:ato32le Unexecuted instantiation: random.c:ato32le Unexecuted instantiation: ripemd.c:ato32le Unexecuted instantiation: rsa.c:ato32le Unexecuted instantiation: sha.c:ato32le Unexecuted instantiation: sha256.c:ato32le Unexecuted instantiation: sha3.c:ato32le Unexecuted instantiation: sha512.c:ato32le Unexecuted instantiation: siphash.c:ato32le Unexecuted instantiation: sm2.c:ato32le Unexecuted instantiation: sm3.c:ato32le Unexecuted instantiation: sm4.c:ato32le Unexecuted instantiation: sp_int.c:ato32le Unexecuted instantiation: wc_encrypt.c:ato32le Unexecuted instantiation: wolfmath.c:ato32le Unexecuted instantiation: ssl.c:ato32le Unexecuted instantiation: tls.c:ato32le Unexecuted instantiation: tls13.c:ato32le Unexecuted instantiation: internal.c:ato32le |
610 | | |
611 | | |
612 | | WC_MISC_STATIC WC_INLINE word32 btoi(byte b) |
613 | 0 | { |
614 | 0 | return (word32)(b - 0x30); |
615 | 0 | } Unexecuted instantiation: aes.c:btoi Unexecuted instantiation: asn.c:btoi Unexecuted instantiation: camellia.c:btoi Unexecuted instantiation: chacha.c:btoi Unexecuted instantiation: chacha20_poly1305.c:btoi Unexecuted instantiation: cmac.c:btoi Unexecuted instantiation: coding.c:btoi Unexecuted instantiation: curve25519.c:btoi Unexecuted instantiation: curve448.c:btoi Unexecuted instantiation: des3.c:btoi Unexecuted instantiation: dh.c:btoi Unexecuted instantiation: ecc.c:btoi Unexecuted instantiation: eccsi.c:btoi Unexecuted instantiation: ed25519.c:btoi Unexecuted instantiation: ed448.c:btoi Unexecuted instantiation: fe_448.c:btoi Unexecuted instantiation: fe_operations.c:btoi Unexecuted instantiation: ge_448.c:btoi Unexecuted instantiation: ge_operations.c:btoi Unexecuted instantiation: hash.c:btoi Unexecuted instantiation: hmac.c:btoi Unexecuted instantiation: kdf.c:btoi Unexecuted instantiation: md2.c:btoi Unexecuted instantiation: md4.c:btoi Unexecuted instantiation: md5.c:btoi Unexecuted instantiation: poly1305.c:btoi Unexecuted instantiation: pwdbased.c:btoi Unexecuted instantiation: random.c:btoi Unexecuted instantiation: ripemd.c:btoi Unexecuted instantiation: rsa.c:btoi Unexecuted instantiation: sha.c:btoi Unexecuted instantiation: sha256.c:btoi Unexecuted instantiation: sha3.c:btoi Unexecuted instantiation: sha512.c:btoi Unexecuted instantiation: siphash.c:btoi Unexecuted instantiation: sm2.c:btoi Unexecuted instantiation: sm3.c:btoi Unexecuted instantiation: sm4.c:btoi Unexecuted instantiation: sp_int.c:btoi Unexecuted instantiation: wc_encrypt.c:btoi Unexecuted instantiation: wolfmath.c:btoi Unexecuted instantiation: ssl.c:btoi Unexecuted instantiation: tls.c:btoi Unexecuted instantiation: tls13.c:btoi Unexecuted instantiation: internal.c:btoi |
616 | | #endif |
617 | | |
618 | | WC_MISC_STATIC WC_INLINE signed char HexCharToByte(char ch) |
619 | 742k | { |
620 | 742k | signed char ret = (signed char)ch; |
621 | 742k | if (ret >= '0' && ret <= '9') |
622 | 459k | ret -= '0'; |
623 | 283k | else if (ret >= 'A' && ret <= 'F') |
624 | 31.4k | ret -= 'A' - 10; |
625 | 252k | else if (ret >= 'a' && ret <= 'f') |
626 | 252k | ret -= 'a' - 10; |
627 | 0 | else |
628 | 0 | ret = -1; /* error case - return code must be signed */ |
629 | 742k | return ret; |
630 | 742k | } Unexecuted instantiation: aes.c:HexCharToByte Unexecuted instantiation: asn.c:HexCharToByte Unexecuted instantiation: camellia.c:HexCharToByte Unexecuted instantiation: chacha.c:HexCharToByte Unexecuted instantiation: chacha20_poly1305.c:HexCharToByte Unexecuted instantiation: cmac.c:HexCharToByte Unexecuted instantiation: coding.c:HexCharToByte Unexecuted instantiation: curve25519.c:HexCharToByte Unexecuted instantiation: curve448.c:HexCharToByte Unexecuted instantiation: des3.c:HexCharToByte Unexecuted instantiation: dh.c:HexCharToByte Unexecuted instantiation: ecc.c:HexCharToByte Unexecuted instantiation: eccsi.c:HexCharToByte Unexecuted instantiation: ed25519.c:HexCharToByte Unexecuted instantiation: ed448.c:HexCharToByte Unexecuted instantiation: fe_448.c:HexCharToByte Unexecuted instantiation: fe_operations.c:HexCharToByte Unexecuted instantiation: ge_448.c:HexCharToByte Unexecuted instantiation: ge_operations.c:HexCharToByte Unexecuted instantiation: hash.c:HexCharToByte Unexecuted instantiation: hmac.c:HexCharToByte Unexecuted instantiation: kdf.c:HexCharToByte Unexecuted instantiation: md2.c:HexCharToByte Unexecuted instantiation: md4.c:HexCharToByte Unexecuted instantiation: md5.c:HexCharToByte Unexecuted instantiation: poly1305.c:HexCharToByte Unexecuted instantiation: pwdbased.c:HexCharToByte Unexecuted instantiation: random.c:HexCharToByte Unexecuted instantiation: ripemd.c:HexCharToByte Unexecuted instantiation: rsa.c:HexCharToByte Unexecuted instantiation: sha.c:HexCharToByte Unexecuted instantiation: sha256.c:HexCharToByte Unexecuted instantiation: sha3.c:HexCharToByte Unexecuted instantiation: sha512.c:HexCharToByte Unexecuted instantiation: siphash.c:HexCharToByte Unexecuted instantiation: sm2.c:HexCharToByte Unexecuted instantiation: sm3.c:HexCharToByte Unexecuted instantiation: sm4.c:HexCharToByte Line | Count | Source | 619 | 742k | { | 620 | 742k | signed char ret = (signed char)ch; | 621 | 742k | if (ret >= '0' && ret <= '9') | 622 | 459k | ret -= '0'; | 623 | 283k | else if (ret >= 'A' && ret <= 'F') | 624 | 31.4k | ret -= 'A' - 10; | 625 | 252k | else if (ret >= 'a' && ret <= 'f') | 626 | 252k | ret -= 'a' - 10; | 627 | 0 | else | 628 | 0 | ret = -1; /* error case - return code must be signed */ | 629 | 742k | return ret; | 630 | 742k | } |
Unexecuted instantiation: wc_encrypt.c:HexCharToByte Unexecuted instantiation: wolfmath.c:HexCharToByte Unexecuted instantiation: ssl.c:HexCharToByte Unexecuted instantiation: tls.c:HexCharToByte Unexecuted instantiation: tls13.c:HexCharToByte Unexecuted instantiation: internal.c:HexCharToByte |
631 | | |
632 | | WC_MISC_STATIC WC_INLINE char ByteToHex(byte in) |
633 | 34.0k | { |
634 | 34.0k | static const char kHexChar[] = { '0', '1', '2', '3', '4', '5', '6', '7', |
635 | 34.0k | '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; |
636 | 34.0k | return (char)(kHexChar[in & 0xF]); |
637 | 34.0k | } Unexecuted instantiation: aes.c:ByteToHex Unexecuted instantiation: asn.c:ByteToHex Unexecuted instantiation: camellia.c:ByteToHex Unexecuted instantiation: chacha.c:ByteToHex Unexecuted instantiation: chacha20_poly1305.c:ByteToHex Unexecuted instantiation: cmac.c:ByteToHex Unexecuted instantiation: coding.c:ByteToHex Unexecuted instantiation: curve25519.c:ByteToHex Unexecuted instantiation: curve448.c:ByteToHex Unexecuted instantiation: des3.c:ByteToHex Unexecuted instantiation: dh.c:ByteToHex Unexecuted instantiation: ecc.c:ByteToHex Unexecuted instantiation: eccsi.c:ByteToHex Unexecuted instantiation: ed25519.c:ByteToHex Unexecuted instantiation: ed448.c:ByteToHex Unexecuted instantiation: fe_448.c:ByteToHex Unexecuted instantiation: fe_operations.c:ByteToHex Unexecuted instantiation: ge_448.c:ByteToHex Unexecuted instantiation: ge_operations.c:ByteToHex Unexecuted instantiation: hash.c:ByteToHex Unexecuted instantiation: hmac.c:ByteToHex Unexecuted instantiation: kdf.c:ByteToHex Unexecuted instantiation: md2.c:ByteToHex Unexecuted instantiation: md4.c:ByteToHex Unexecuted instantiation: md5.c:ByteToHex Unexecuted instantiation: poly1305.c:ByteToHex Unexecuted instantiation: pwdbased.c:ByteToHex Unexecuted instantiation: random.c:ByteToHex Unexecuted instantiation: ripemd.c:ByteToHex Unexecuted instantiation: rsa.c:ByteToHex Unexecuted instantiation: sha.c:ByteToHex Unexecuted instantiation: sha256.c:ByteToHex Unexecuted instantiation: sha3.c:ByteToHex Unexecuted instantiation: sha512.c:ByteToHex Unexecuted instantiation: siphash.c:ByteToHex Unexecuted instantiation: sm2.c:ByteToHex Unexecuted instantiation: sm3.c:ByteToHex Unexecuted instantiation: sm4.c:ByteToHex Line | Count | Source | 633 | 34.0k | { | 634 | 34.0k | static const char kHexChar[] = { '0', '1', '2', '3', '4', '5', '6', '7', | 635 | 34.0k | '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; | 636 | 34.0k | return (char)(kHexChar[in & 0xF]); | 637 | 34.0k | } |
Unexecuted instantiation: wc_encrypt.c:ByteToHex Unexecuted instantiation: wolfmath.c:ByteToHex Unexecuted instantiation: ssl.c:ByteToHex Unexecuted instantiation: tls.c:ByteToHex Unexecuted instantiation: tls13.c:ByteToHex Unexecuted instantiation: internal.c:ByteToHex |
638 | | |
639 | | WC_MISC_STATIC WC_INLINE int ByteToHexStr(byte in, char* out) |
640 | 0 | { |
641 | 0 | if (out == NULL) |
642 | 0 | return -1; |
643 | 0 |
|
644 | 0 | out[0] = ByteToHex((byte)(in >> 4)); |
645 | 0 | out[1] = ByteToHex((byte)(in & 0xf)); |
646 | 0 | return 0; |
647 | 0 | } Unexecuted instantiation: aes.c:ByteToHexStr Unexecuted instantiation: asn.c:ByteToHexStr Unexecuted instantiation: camellia.c:ByteToHexStr Unexecuted instantiation: chacha.c:ByteToHexStr Unexecuted instantiation: chacha20_poly1305.c:ByteToHexStr Unexecuted instantiation: cmac.c:ByteToHexStr Unexecuted instantiation: coding.c:ByteToHexStr Unexecuted instantiation: curve25519.c:ByteToHexStr Unexecuted instantiation: curve448.c:ByteToHexStr Unexecuted instantiation: des3.c:ByteToHexStr Unexecuted instantiation: dh.c:ByteToHexStr Unexecuted instantiation: ecc.c:ByteToHexStr Unexecuted instantiation: eccsi.c:ByteToHexStr Unexecuted instantiation: ed25519.c:ByteToHexStr Unexecuted instantiation: ed448.c:ByteToHexStr Unexecuted instantiation: fe_448.c:ByteToHexStr Unexecuted instantiation: fe_operations.c:ByteToHexStr Unexecuted instantiation: ge_448.c:ByteToHexStr Unexecuted instantiation: ge_operations.c:ByteToHexStr Unexecuted instantiation: hash.c:ByteToHexStr Unexecuted instantiation: hmac.c:ByteToHexStr Unexecuted instantiation: kdf.c:ByteToHexStr Unexecuted instantiation: md2.c:ByteToHexStr Unexecuted instantiation: md4.c:ByteToHexStr Unexecuted instantiation: md5.c:ByteToHexStr Unexecuted instantiation: poly1305.c:ByteToHexStr Unexecuted instantiation: pwdbased.c:ByteToHexStr Unexecuted instantiation: random.c:ByteToHexStr Unexecuted instantiation: ripemd.c:ByteToHexStr Unexecuted instantiation: rsa.c:ByteToHexStr Unexecuted instantiation: sha.c:ByteToHexStr Unexecuted instantiation: sha256.c:ByteToHexStr Unexecuted instantiation: sha3.c:ByteToHexStr Unexecuted instantiation: sha512.c:ByteToHexStr Unexecuted instantiation: siphash.c:ByteToHexStr Unexecuted instantiation: sm2.c:ByteToHexStr Unexecuted instantiation: sm3.c:ByteToHexStr Unexecuted instantiation: sm4.c:ByteToHexStr Unexecuted instantiation: sp_int.c:ByteToHexStr Unexecuted instantiation: wc_encrypt.c:ByteToHexStr Unexecuted instantiation: wolfmath.c:ByteToHexStr Unexecuted instantiation: ssl.c:ByteToHexStr Unexecuted instantiation: tls.c:ByteToHexStr Unexecuted instantiation: tls13.c:ByteToHexStr Unexecuted instantiation: internal.c:ByteToHexStr |
648 | | |
649 | | WC_MISC_STATIC WC_INLINE int CharIsWhiteSpace(char ch) |
650 | 0 | { |
651 | 0 | switch (ch) { |
652 | 0 | case ' ': |
653 | 0 | case '\t': |
654 | 0 | case '\n': |
655 | 0 | return 1; |
656 | 0 | default: |
657 | 0 | return 0; |
658 | 0 | } |
659 | 0 | } Unexecuted instantiation: aes.c:CharIsWhiteSpace Unexecuted instantiation: asn.c:CharIsWhiteSpace Unexecuted instantiation: camellia.c:CharIsWhiteSpace Unexecuted instantiation: chacha.c:CharIsWhiteSpace Unexecuted instantiation: chacha20_poly1305.c:CharIsWhiteSpace Unexecuted instantiation: cmac.c:CharIsWhiteSpace Unexecuted instantiation: coding.c:CharIsWhiteSpace Unexecuted instantiation: curve25519.c:CharIsWhiteSpace Unexecuted instantiation: curve448.c:CharIsWhiteSpace Unexecuted instantiation: des3.c:CharIsWhiteSpace Unexecuted instantiation: dh.c:CharIsWhiteSpace Unexecuted instantiation: ecc.c:CharIsWhiteSpace Unexecuted instantiation: eccsi.c:CharIsWhiteSpace Unexecuted instantiation: ed25519.c:CharIsWhiteSpace Unexecuted instantiation: ed448.c:CharIsWhiteSpace Unexecuted instantiation: fe_448.c:CharIsWhiteSpace Unexecuted instantiation: fe_operations.c:CharIsWhiteSpace Unexecuted instantiation: ge_448.c:CharIsWhiteSpace Unexecuted instantiation: ge_operations.c:CharIsWhiteSpace Unexecuted instantiation: hash.c:CharIsWhiteSpace Unexecuted instantiation: hmac.c:CharIsWhiteSpace Unexecuted instantiation: kdf.c:CharIsWhiteSpace Unexecuted instantiation: md2.c:CharIsWhiteSpace Unexecuted instantiation: md4.c:CharIsWhiteSpace Unexecuted instantiation: md5.c:CharIsWhiteSpace Unexecuted instantiation: poly1305.c:CharIsWhiteSpace Unexecuted instantiation: pwdbased.c:CharIsWhiteSpace Unexecuted instantiation: random.c:CharIsWhiteSpace Unexecuted instantiation: ripemd.c:CharIsWhiteSpace Unexecuted instantiation: rsa.c:CharIsWhiteSpace Unexecuted instantiation: sha.c:CharIsWhiteSpace Unexecuted instantiation: sha256.c:CharIsWhiteSpace Unexecuted instantiation: sha3.c:CharIsWhiteSpace Unexecuted instantiation: sha512.c:CharIsWhiteSpace Unexecuted instantiation: siphash.c:CharIsWhiteSpace Unexecuted instantiation: sm2.c:CharIsWhiteSpace Unexecuted instantiation: sm3.c:CharIsWhiteSpace Unexecuted instantiation: sm4.c:CharIsWhiteSpace Unexecuted instantiation: sp_int.c:CharIsWhiteSpace Unexecuted instantiation: wc_encrypt.c:CharIsWhiteSpace Unexecuted instantiation: wolfmath.c:CharIsWhiteSpace Unexecuted instantiation: ssl.c:CharIsWhiteSpace Unexecuted instantiation: tls.c:CharIsWhiteSpace Unexecuted instantiation: tls13.c:CharIsWhiteSpace Unexecuted instantiation: internal.c:CharIsWhiteSpace |
660 | | |
661 | | #ifndef WOLFSSL_NO_CT_OPS |
662 | | /* Constant time - mask set when a > b. */ |
663 | | WC_MISC_STATIC WC_INLINE byte ctMaskGT(int a, int b) |
664 | 0 | { |
665 | 0 | return (byte)((((word32)a - (word32)b - 1) >> 31) - 1); |
666 | 0 | } Unexecuted instantiation: aes.c:ctMaskGT Unexecuted instantiation: asn.c:ctMaskGT Unexecuted instantiation: camellia.c:ctMaskGT Unexecuted instantiation: chacha.c:ctMaskGT Unexecuted instantiation: chacha20_poly1305.c:ctMaskGT Unexecuted instantiation: cmac.c:ctMaskGT Unexecuted instantiation: coding.c:ctMaskGT Unexecuted instantiation: curve25519.c:ctMaskGT Unexecuted instantiation: curve448.c:ctMaskGT Unexecuted instantiation: des3.c:ctMaskGT Unexecuted instantiation: dh.c:ctMaskGT Unexecuted instantiation: ecc.c:ctMaskGT Unexecuted instantiation: eccsi.c:ctMaskGT Unexecuted instantiation: ed25519.c:ctMaskGT Unexecuted instantiation: ed448.c:ctMaskGT Unexecuted instantiation: fe_448.c:ctMaskGT Unexecuted instantiation: fe_operations.c:ctMaskGT Unexecuted instantiation: ge_448.c:ctMaskGT Unexecuted instantiation: ge_operations.c:ctMaskGT Unexecuted instantiation: hash.c:ctMaskGT Unexecuted instantiation: hmac.c:ctMaskGT Unexecuted instantiation: kdf.c:ctMaskGT Unexecuted instantiation: md2.c:ctMaskGT Unexecuted instantiation: md4.c:ctMaskGT Unexecuted instantiation: md5.c:ctMaskGT Unexecuted instantiation: poly1305.c:ctMaskGT Unexecuted instantiation: pwdbased.c:ctMaskGT Unexecuted instantiation: random.c:ctMaskGT Unexecuted instantiation: ripemd.c:ctMaskGT Unexecuted instantiation: rsa.c:ctMaskGT Unexecuted instantiation: sha.c:ctMaskGT Unexecuted instantiation: sha256.c:ctMaskGT Unexecuted instantiation: sha3.c:ctMaskGT Unexecuted instantiation: sha512.c:ctMaskGT Unexecuted instantiation: siphash.c:ctMaskGT Unexecuted instantiation: sm2.c:ctMaskGT Unexecuted instantiation: sm3.c:ctMaskGT Unexecuted instantiation: sm4.c:ctMaskGT Unexecuted instantiation: sp_int.c:ctMaskGT Unexecuted instantiation: wc_encrypt.c:ctMaskGT Unexecuted instantiation: wolfmath.c:ctMaskGT Unexecuted instantiation: ssl.c:ctMaskGT Unexecuted instantiation: tls.c:ctMaskGT Unexecuted instantiation: tls13.c:ctMaskGT Unexecuted instantiation: internal.c:ctMaskGT |
667 | | |
668 | | /* Constant time - mask set when a >= b. */ |
669 | | WC_MISC_STATIC WC_INLINE byte ctMaskGTE(int a, int b) |
670 | 0 | { |
671 | 0 | return (byte)((((word32)a - (word32)b) >> 31) - 1); |
672 | 0 | } Unexecuted instantiation: aes.c:ctMaskGTE Unexecuted instantiation: asn.c:ctMaskGTE Unexecuted instantiation: camellia.c:ctMaskGTE Unexecuted instantiation: chacha.c:ctMaskGTE Unexecuted instantiation: chacha20_poly1305.c:ctMaskGTE Unexecuted instantiation: cmac.c:ctMaskGTE Unexecuted instantiation: coding.c:ctMaskGTE Unexecuted instantiation: curve25519.c:ctMaskGTE Unexecuted instantiation: curve448.c:ctMaskGTE Unexecuted instantiation: des3.c:ctMaskGTE Unexecuted instantiation: dh.c:ctMaskGTE Unexecuted instantiation: ecc.c:ctMaskGTE Unexecuted instantiation: eccsi.c:ctMaskGTE Unexecuted instantiation: ed25519.c:ctMaskGTE Unexecuted instantiation: ed448.c:ctMaskGTE Unexecuted instantiation: fe_448.c:ctMaskGTE Unexecuted instantiation: fe_operations.c:ctMaskGTE Unexecuted instantiation: ge_448.c:ctMaskGTE Unexecuted instantiation: ge_operations.c:ctMaskGTE Unexecuted instantiation: hash.c:ctMaskGTE Unexecuted instantiation: hmac.c:ctMaskGTE Unexecuted instantiation: kdf.c:ctMaskGTE Unexecuted instantiation: md2.c:ctMaskGTE Unexecuted instantiation: md4.c:ctMaskGTE Unexecuted instantiation: md5.c:ctMaskGTE Unexecuted instantiation: poly1305.c:ctMaskGTE Unexecuted instantiation: pwdbased.c:ctMaskGTE Unexecuted instantiation: random.c:ctMaskGTE Unexecuted instantiation: ripemd.c:ctMaskGTE Unexecuted instantiation: rsa.c:ctMaskGTE Unexecuted instantiation: sha.c:ctMaskGTE Unexecuted instantiation: sha256.c:ctMaskGTE Unexecuted instantiation: sha3.c:ctMaskGTE Unexecuted instantiation: sha512.c:ctMaskGTE Unexecuted instantiation: siphash.c:ctMaskGTE Unexecuted instantiation: sm2.c:ctMaskGTE Unexecuted instantiation: sm3.c:ctMaskGTE Unexecuted instantiation: sm4.c:ctMaskGTE Unexecuted instantiation: sp_int.c:ctMaskGTE Unexecuted instantiation: wc_encrypt.c:ctMaskGTE Unexecuted instantiation: wolfmath.c:ctMaskGTE Unexecuted instantiation: ssl.c:ctMaskGTE Unexecuted instantiation: tls.c:ctMaskGTE Unexecuted instantiation: tls13.c:ctMaskGTE Unexecuted instantiation: internal.c:ctMaskGTE |
673 | | |
674 | | /* Constant time - mask set when a >= b. */ |
675 | | WC_MISC_STATIC WC_INLINE int ctMaskIntGTE(int a, int b) |
676 | 0 | { |
677 | 0 | return (int)((((word32)a - (word32)b) >> 31) - 1); |
678 | 0 | } Unexecuted instantiation: aes.c:ctMaskIntGTE Unexecuted instantiation: asn.c:ctMaskIntGTE Unexecuted instantiation: camellia.c:ctMaskIntGTE Unexecuted instantiation: chacha.c:ctMaskIntGTE Unexecuted instantiation: chacha20_poly1305.c:ctMaskIntGTE Unexecuted instantiation: cmac.c:ctMaskIntGTE Unexecuted instantiation: coding.c:ctMaskIntGTE Unexecuted instantiation: curve25519.c:ctMaskIntGTE Unexecuted instantiation: curve448.c:ctMaskIntGTE Unexecuted instantiation: des3.c:ctMaskIntGTE Unexecuted instantiation: dh.c:ctMaskIntGTE Unexecuted instantiation: ecc.c:ctMaskIntGTE Unexecuted instantiation: eccsi.c:ctMaskIntGTE Unexecuted instantiation: ed25519.c:ctMaskIntGTE Unexecuted instantiation: ed448.c:ctMaskIntGTE Unexecuted instantiation: fe_448.c:ctMaskIntGTE Unexecuted instantiation: fe_operations.c:ctMaskIntGTE Unexecuted instantiation: ge_448.c:ctMaskIntGTE Unexecuted instantiation: ge_operations.c:ctMaskIntGTE Unexecuted instantiation: hash.c:ctMaskIntGTE Unexecuted instantiation: hmac.c:ctMaskIntGTE Unexecuted instantiation: kdf.c:ctMaskIntGTE Unexecuted instantiation: md2.c:ctMaskIntGTE Unexecuted instantiation: md4.c:ctMaskIntGTE Unexecuted instantiation: md5.c:ctMaskIntGTE Unexecuted instantiation: poly1305.c:ctMaskIntGTE Unexecuted instantiation: pwdbased.c:ctMaskIntGTE Unexecuted instantiation: random.c:ctMaskIntGTE Unexecuted instantiation: ripemd.c:ctMaskIntGTE Unexecuted instantiation: rsa.c:ctMaskIntGTE Unexecuted instantiation: sha.c:ctMaskIntGTE Unexecuted instantiation: sha256.c:ctMaskIntGTE Unexecuted instantiation: sha3.c:ctMaskIntGTE Unexecuted instantiation: sha512.c:ctMaskIntGTE Unexecuted instantiation: siphash.c:ctMaskIntGTE Unexecuted instantiation: sm2.c:ctMaskIntGTE Unexecuted instantiation: sm3.c:ctMaskIntGTE Unexecuted instantiation: sm4.c:ctMaskIntGTE Unexecuted instantiation: sp_int.c:ctMaskIntGTE Unexecuted instantiation: wc_encrypt.c:ctMaskIntGTE Unexecuted instantiation: wolfmath.c:ctMaskIntGTE Unexecuted instantiation: ssl.c:ctMaskIntGTE Unexecuted instantiation: tls.c:ctMaskIntGTE Unexecuted instantiation: tls13.c:ctMaskIntGTE Unexecuted instantiation: internal.c:ctMaskIntGTE |
679 | | |
680 | | /* Constant time - mask set when a < b. */ |
681 | | WC_MISC_STATIC WC_INLINE byte ctMaskLT(int a, int b) |
682 | 0 | { |
683 | 0 | return (byte)((((word32)b - (word32)a - 1) >> 31) - 1); |
684 | 0 | } Unexecuted instantiation: aes.c:ctMaskLT Unexecuted instantiation: asn.c:ctMaskLT Unexecuted instantiation: camellia.c:ctMaskLT Unexecuted instantiation: chacha.c:ctMaskLT Unexecuted instantiation: chacha20_poly1305.c:ctMaskLT Unexecuted instantiation: cmac.c:ctMaskLT Unexecuted instantiation: coding.c:ctMaskLT Unexecuted instantiation: curve25519.c:ctMaskLT Unexecuted instantiation: curve448.c:ctMaskLT Unexecuted instantiation: des3.c:ctMaskLT Unexecuted instantiation: dh.c:ctMaskLT Unexecuted instantiation: ecc.c:ctMaskLT Unexecuted instantiation: eccsi.c:ctMaskLT Unexecuted instantiation: ed25519.c:ctMaskLT Unexecuted instantiation: ed448.c:ctMaskLT Unexecuted instantiation: fe_448.c:ctMaskLT Unexecuted instantiation: fe_operations.c:ctMaskLT Unexecuted instantiation: ge_448.c:ctMaskLT Unexecuted instantiation: ge_operations.c:ctMaskLT Unexecuted instantiation: hash.c:ctMaskLT Unexecuted instantiation: hmac.c:ctMaskLT Unexecuted instantiation: kdf.c:ctMaskLT Unexecuted instantiation: md2.c:ctMaskLT Unexecuted instantiation: md4.c:ctMaskLT Unexecuted instantiation: md5.c:ctMaskLT Unexecuted instantiation: poly1305.c:ctMaskLT Unexecuted instantiation: pwdbased.c:ctMaskLT Unexecuted instantiation: random.c:ctMaskLT Unexecuted instantiation: ripemd.c:ctMaskLT Unexecuted instantiation: rsa.c:ctMaskLT Unexecuted instantiation: sha.c:ctMaskLT Unexecuted instantiation: sha256.c:ctMaskLT Unexecuted instantiation: sha3.c:ctMaskLT Unexecuted instantiation: sha512.c:ctMaskLT Unexecuted instantiation: siphash.c:ctMaskLT Unexecuted instantiation: sm2.c:ctMaskLT Unexecuted instantiation: sm3.c:ctMaskLT Unexecuted instantiation: sm4.c:ctMaskLT Unexecuted instantiation: sp_int.c:ctMaskLT Unexecuted instantiation: wc_encrypt.c:ctMaskLT Unexecuted instantiation: wolfmath.c:ctMaskLT Unexecuted instantiation: ssl.c:ctMaskLT Unexecuted instantiation: tls.c:ctMaskLT Unexecuted instantiation: tls13.c:ctMaskLT Unexecuted instantiation: internal.c:ctMaskLT |
685 | | |
686 | | /* Constant time - mask set when a <= b. */ |
687 | | WC_MISC_STATIC WC_INLINE byte ctMaskLTE(int a, int b) |
688 | 0 | { |
689 | 0 | return (byte)((((word32)b - (word32)a) >> 31) - 1); |
690 | 0 | } Unexecuted instantiation: aes.c:ctMaskLTE Unexecuted instantiation: asn.c:ctMaskLTE Unexecuted instantiation: camellia.c:ctMaskLTE Unexecuted instantiation: chacha.c:ctMaskLTE Unexecuted instantiation: chacha20_poly1305.c:ctMaskLTE Unexecuted instantiation: cmac.c:ctMaskLTE Unexecuted instantiation: coding.c:ctMaskLTE Unexecuted instantiation: curve25519.c:ctMaskLTE Unexecuted instantiation: curve448.c:ctMaskLTE Unexecuted instantiation: des3.c:ctMaskLTE Unexecuted instantiation: dh.c:ctMaskLTE Unexecuted instantiation: ecc.c:ctMaskLTE Unexecuted instantiation: eccsi.c:ctMaskLTE Unexecuted instantiation: ed25519.c:ctMaskLTE Unexecuted instantiation: ed448.c:ctMaskLTE Unexecuted instantiation: fe_448.c:ctMaskLTE Unexecuted instantiation: fe_operations.c:ctMaskLTE Unexecuted instantiation: ge_448.c:ctMaskLTE Unexecuted instantiation: ge_operations.c:ctMaskLTE Unexecuted instantiation: hash.c:ctMaskLTE Unexecuted instantiation: hmac.c:ctMaskLTE Unexecuted instantiation: kdf.c:ctMaskLTE Unexecuted instantiation: md2.c:ctMaskLTE Unexecuted instantiation: md4.c:ctMaskLTE Unexecuted instantiation: md5.c:ctMaskLTE Unexecuted instantiation: poly1305.c:ctMaskLTE Unexecuted instantiation: pwdbased.c:ctMaskLTE Unexecuted instantiation: random.c:ctMaskLTE Unexecuted instantiation: ripemd.c:ctMaskLTE Unexecuted instantiation: rsa.c:ctMaskLTE Unexecuted instantiation: sha.c:ctMaskLTE Unexecuted instantiation: sha256.c:ctMaskLTE Unexecuted instantiation: sha3.c:ctMaskLTE Unexecuted instantiation: sha512.c:ctMaskLTE Unexecuted instantiation: siphash.c:ctMaskLTE Unexecuted instantiation: sm2.c:ctMaskLTE Unexecuted instantiation: sm3.c:ctMaskLTE Unexecuted instantiation: sm4.c:ctMaskLTE Unexecuted instantiation: sp_int.c:ctMaskLTE Unexecuted instantiation: wc_encrypt.c:ctMaskLTE Unexecuted instantiation: wolfmath.c:ctMaskLTE Unexecuted instantiation: ssl.c:ctMaskLTE Unexecuted instantiation: tls.c:ctMaskLTE Unexecuted instantiation: tls13.c:ctMaskLTE Unexecuted instantiation: internal.c:ctMaskLTE |
691 | | |
692 | | /* Constant time - mask set when a == b. */ |
693 | | WC_MISC_STATIC WC_INLINE byte ctMaskEq(int a, int b) |
694 | 0 | { |
695 | 0 | return (byte)((byte)(~ctMaskGT(a, b)) & (byte)(~ctMaskLT(a, b))); |
696 | 0 | } Unexecuted instantiation: aes.c:ctMaskEq Unexecuted instantiation: asn.c:ctMaskEq Unexecuted instantiation: camellia.c:ctMaskEq Unexecuted instantiation: chacha.c:ctMaskEq Unexecuted instantiation: chacha20_poly1305.c:ctMaskEq Unexecuted instantiation: cmac.c:ctMaskEq Unexecuted instantiation: coding.c:ctMaskEq Unexecuted instantiation: curve25519.c:ctMaskEq Unexecuted instantiation: curve448.c:ctMaskEq Unexecuted instantiation: des3.c:ctMaskEq Unexecuted instantiation: dh.c:ctMaskEq Unexecuted instantiation: ecc.c:ctMaskEq Unexecuted instantiation: eccsi.c:ctMaskEq Unexecuted instantiation: ed25519.c:ctMaskEq Unexecuted instantiation: ed448.c:ctMaskEq Unexecuted instantiation: fe_448.c:ctMaskEq Unexecuted instantiation: fe_operations.c:ctMaskEq Unexecuted instantiation: ge_448.c:ctMaskEq Unexecuted instantiation: ge_operations.c:ctMaskEq Unexecuted instantiation: hash.c:ctMaskEq Unexecuted instantiation: hmac.c:ctMaskEq Unexecuted instantiation: kdf.c:ctMaskEq Unexecuted instantiation: md2.c:ctMaskEq Unexecuted instantiation: md4.c:ctMaskEq Unexecuted instantiation: md5.c:ctMaskEq Unexecuted instantiation: poly1305.c:ctMaskEq Unexecuted instantiation: pwdbased.c:ctMaskEq Unexecuted instantiation: random.c:ctMaskEq Unexecuted instantiation: ripemd.c:ctMaskEq Unexecuted instantiation: rsa.c:ctMaskEq Unexecuted instantiation: sha.c:ctMaskEq Unexecuted instantiation: sha256.c:ctMaskEq Unexecuted instantiation: sha3.c:ctMaskEq Unexecuted instantiation: sha512.c:ctMaskEq Unexecuted instantiation: siphash.c:ctMaskEq Unexecuted instantiation: sm2.c:ctMaskEq Unexecuted instantiation: sm3.c:ctMaskEq Unexecuted instantiation: sm4.c:ctMaskEq Unexecuted instantiation: sp_int.c:ctMaskEq Unexecuted instantiation: wc_encrypt.c:ctMaskEq Unexecuted instantiation: wolfmath.c:ctMaskEq Unexecuted instantiation: ssl.c:ctMaskEq Unexecuted instantiation: tls.c:ctMaskEq Unexecuted instantiation: tls13.c:ctMaskEq Unexecuted instantiation: internal.c:ctMaskEq |
697 | | |
698 | | /* Constant time - sets 16 bit integer mask when a > b */ |
699 | | WC_MISC_STATIC WC_INLINE word16 ctMask16GT(int a, int b) |
700 | 0 | { |
701 | 0 | return (word16)((((word32)a - (word32)b - 1) >> 31) - 1); |
702 | 0 | } Unexecuted instantiation: aes.c:ctMask16GT Unexecuted instantiation: asn.c:ctMask16GT Unexecuted instantiation: camellia.c:ctMask16GT Unexecuted instantiation: chacha.c:ctMask16GT Unexecuted instantiation: chacha20_poly1305.c:ctMask16GT Unexecuted instantiation: cmac.c:ctMask16GT Unexecuted instantiation: coding.c:ctMask16GT Unexecuted instantiation: curve25519.c:ctMask16GT Unexecuted instantiation: curve448.c:ctMask16GT Unexecuted instantiation: des3.c:ctMask16GT Unexecuted instantiation: dh.c:ctMask16GT Unexecuted instantiation: ecc.c:ctMask16GT Unexecuted instantiation: eccsi.c:ctMask16GT Unexecuted instantiation: ed25519.c:ctMask16GT Unexecuted instantiation: ed448.c:ctMask16GT Unexecuted instantiation: fe_448.c:ctMask16GT Unexecuted instantiation: fe_operations.c:ctMask16GT Unexecuted instantiation: ge_448.c:ctMask16GT Unexecuted instantiation: ge_operations.c:ctMask16GT Unexecuted instantiation: hash.c:ctMask16GT Unexecuted instantiation: hmac.c:ctMask16GT Unexecuted instantiation: kdf.c:ctMask16GT Unexecuted instantiation: md2.c:ctMask16GT Unexecuted instantiation: md4.c:ctMask16GT Unexecuted instantiation: md5.c:ctMask16GT Unexecuted instantiation: poly1305.c:ctMask16GT Unexecuted instantiation: pwdbased.c:ctMask16GT Unexecuted instantiation: random.c:ctMask16GT Unexecuted instantiation: ripemd.c:ctMask16GT Unexecuted instantiation: rsa.c:ctMask16GT Unexecuted instantiation: sha.c:ctMask16GT Unexecuted instantiation: sha256.c:ctMask16GT Unexecuted instantiation: sha3.c:ctMask16GT Unexecuted instantiation: sha512.c:ctMask16GT Unexecuted instantiation: siphash.c:ctMask16GT Unexecuted instantiation: sm2.c:ctMask16GT Unexecuted instantiation: sm3.c:ctMask16GT Unexecuted instantiation: sm4.c:ctMask16GT Unexecuted instantiation: sp_int.c:ctMask16GT Unexecuted instantiation: wc_encrypt.c:ctMask16GT Unexecuted instantiation: wolfmath.c:ctMask16GT Unexecuted instantiation: ssl.c:ctMask16GT Unexecuted instantiation: tls.c:ctMask16GT Unexecuted instantiation: tls13.c:ctMask16GT Unexecuted instantiation: internal.c:ctMask16GT |
703 | | |
704 | | /* Constant time - sets 16 bit integer mask when a >= b */ |
705 | | WC_MISC_STATIC WC_INLINE word16 ctMask16GTE(int a, int b) |
706 | 0 | { |
707 | 0 | return (word16)((((word32)a - (word32)b) >> 31) - 1); |
708 | 0 | } Unexecuted instantiation: aes.c:ctMask16GTE Unexecuted instantiation: asn.c:ctMask16GTE Unexecuted instantiation: camellia.c:ctMask16GTE Unexecuted instantiation: chacha.c:ctMask16GTE Unexecuted instantiation: chacha20_poly1305.c:ctMask16GTE Unexecuted instantiation: cmac.c:ctMask16GTE Unexecuted instantiation: coding.c:ctMask16GTE Unexecuted instantiation: curve25519.c:ctMask16GTE Unexecuted instantiation: curve448.c:ctMask16GTE Unexecuted instantiation: des3.c:ctMask16GTE Unexecuted instantiation: dh.c:ctMask16GTE Unexecuted instantiation: ecc.c:ctMask16GTE Unexecuted instantiation: eccsi.c:ctMask16GTE Unexecuted instantiation: ed25519.c:ctMask16GTE Unexecuted instantiation: ed448.c:ctMask16GTE Unexecuted instantiation: fe_448.c:ctMask16GTE Unexecuted instantiation: fe_operations.c:ctMask16GTE Unexecuted instantiation: ge_448.c:ctMask16GTE Unexecuted instantiation: ge_operations.c:ctMask16GTE Unexecuted instantiation: hash.c:ctMask16GTE Unexecuted instantiation: hmac.c:ctMask16GTE Unexecuted instantiation: kdf.c:ctMask16GTE Unexecuted instantiation: md2.c:ctMask16GTE Unexecuted instantiation: md4.c:ctMask16GTE Unexecuted instantiation: md5.c:ctMask16GTE Unexecuted instantiation: poly1305.c:ctMask16GTE Unexecuted instantiation: pwdbased.c:ctMask16GTE Unexecuted instantiation: random.c:ctMask16GTE Unexecuted instantiation: ripemd.c:ctMask16GTE Unexecuted instantiation: rsa.c:ctMask16GTE Unexecuted instantiation: sha.c:ctMask16GTE Unexecuted instantiation: sha256.c:ctMask16GTE Unexecuted instantiation: sha3.c:ctMask16GTE Unexecuted instantiation: sha512.c:ctMask16GTE Unexecuted instantiation: siphash.c:ctMask16GTE Unexecuted instantiation: sm2.c:ctMask16GTE Unexecuted instantiation: sm3.c:ctMask16GTE Unexecuted instantiation: sm4.c:ctMask16GTE Unexecuted instantiation: sp_int.c:ctMask16GTE Unexecuted instantiation: wc_encrypt.c:ctMask16GTE Unexecuted instantiation: wolfmath.c:ctMask16GTE Unexecuted instantiation: ssl.c:ctMask16GTE Unexecuted instantiation: tls.c:ctMask16GTE Unexecuted instantiation: tls13.c:ctMask16GTE Unexecuted instantiation: internal.c:ctMask16GTE |
709 | | |
710 | | /* Constant time - sets 16 bit integer mask when a < b. */ |
711 | | WC_MISC_STATIC WC_INLINE word16 ctMask16LT(int a, int b) |
712 | 0 | { |
713 | 0 | return (word16)((((word32)b - (word32)a - 1) >> 31) - 1); |
714 | 0 | } Unexecuted instantiation: aes.c:ctMask16LT Unexecuted instantiation: asn.c:ctMask16LT Unexecuted instantiation: camellia.c:ctMask16LT Unexecuted instantiation: chacha.c:ctMask16LT Unexecuted instantiation: chacha20_poly1305.c:ctMask16LT Unexecuted instantiation: cmac.c:ctMask16LT Unexecuted instantiation: coding.c:ctMask16LT Unexecuted instantiation: curve25519.c:ctMask16LT Unexecuted instantiation: curve448.c:ctMask16LT Unexecuted instantiation: des3.c:ctMask16LT Unexecuted instantiation: dh.c:ctMask16LT Unexecuted instantiation: ecc.c:ctMask16LT Unexecuted instantiation: eccsi.c:ctMask16LT Unexecuted instantiation: ed25519.c:ctMask16LT Unexecuted instantiation: ed448.c:ctMask16LT Unexecuted instantiation: fe_448.c:ctMask16LT Unexecuted instantiation: fe_operations.c:ctMask16LT Unexecuted instantiation: ge_448.c:ctMask16LT Unexecuted instantiation: ge_operations.c:ctMask16LT Unexecuted instantiation: hash.c:ctMask16LT Unexecuted instantiation: hmac.c:ctMask16LT Unexecuted instantiation: kdf.c:ctMask16LT Unexecuted instantiation: md2.c:ctMask16LT Unexecuted instantiation: md4.c:ctMask16LT Unexecuted instantiation: md5.c:ctMask16LT Unexecuted instantiation: poly1305.c:ctMask16LT Unexecuted instantiation: pwdbased.c:ctMask16LT Unexecuted instantiation: random.c:ctMask16LT Unexecuted instantiation: ripemd.c:ctMask16LT Unexecuted instantiation: rsa.c:ctMask16LT Unexecuted instantiation: sha.c:ctMask16LT Unexecuted instantiation: sha256.c:ctMask16LT Unexecuted instantiation: sha3.c:ctMask16LT Unexecuted instantiation: sha512.c:ctMask16LT Unexecuted instantiation: siphash.c:ctMask16LT Unexecuted instantiation: sm2.c:ctMask16LT Unexecuted instantiation: sm3.c:ctMask16LT Unexecuted instantiation: sm4.c:ctMask16LT Unexecuted instantiation: sp_int.c:ctMask16LT Unexecuted instantiation: wc_encrypt.c:ctMask16LT Unexecuted instantiation: wolfmath.c:ctMask16LT Unexecuted instantiation: ssl.c:ctMask16LT Unexecuted instantiation: tls.c:ctMask16LT Unexecuted instantiation: tls13.c:ctMask16LT Unexecuted instantiation: internal.c:ctMask16LT |
715 | | |
716 | | /* Constant time - sets 16 bit integer mask when a <= b. */ |
717 | | WC_MISC_STATIC WC_INLINE word16 ctMask16LTE(int a, int b) |
718 | 0 | { |
719 | 0 | return (word16)((((word32)b - (word32)a) >> 31) - 1); |
720 | 0 | } Unexecuted instantiation: aes.c:ctMask16LTE Unexecuted instantiation: asn.c:ctMask16LTE Unexecuted instantiation: camellia.c:ctMask16LTE Unexecuted instantiation: chacha.c:ctMask16LTE Unexecuted instantiation: chacha20_poly1305.c:ctMask16LTE Unexecuted instantiation: cmac.c:ctMask16LTE Unexecuted instantiation: coding.c:ctMask16LTE Unexecuted instantiation: curve25519.c:ctMask16LTE Unexecuted instantiation: curve448.c:ctMask16LTE Unexecuted instantiation: des3.c:ctMask16LTE Unexecuted instantiation: dh.c:ctMask16LTE Unexecuted instantiation: ecc.c:ctMask16LTE Unexecuted instantiation: eccsi.c:ctMask16LTE Unexecuted instantiation: ed25519.c:ctMask16LTE Unexecuted instantiation: ed448.c:ctMask16LTE Unexecuted instantiation: fe_448.c:ctMask16LTE Unexecuted instantiation: fe_operations.c:ctMask16LTE Unexecuted instantiation: ge_448.c:ctMask16LTE Unexecuted instantiation: ge_operations.c:ctMask16LTE Unexecuted instantiation: hash.c:ctMask16LTE Unexecuted instantiation: hmac.c:ctMask16LTE Unexecuted instantiation: kdf.c:ctMask16LTE Unexecuted instantiation: md2.c:ctMask16LTE Unexecuted instantiation: md4.c:ctMask16LTE Unexecuted instantiation: md5.c:ctMask16LTE Unexecuted instantiation: poly1305.c:ctMask16LTE Unexecuted instantiation: pwdbased.c:ctMask16LTE Unexecuted instantiation: random.c:ctMask16LTE Unexecuted instantiation: ripemd.c:ctMask16LTE Unexecuted instantiation: rsa.c:ctMask16LTE Unexecuted instantiation: sha.c:ctMask16LTE Unexecuted instantiation: sha256.c:ctMask16LTE Unexecuted instantiation: sha3.c:ctMask16LTE Unexecuted instantiation: sha512.c:ctMask16LTE Unexecuted instantiation: siphash.c:ctMask16LTE Unexecuted instantiation: sm2.c:ctMask16LTE Unexecuted instantiation: sm3.c:ctMask16LTE Unexecuted instantiation: sm4.c:ctMask16LTE Unexecuted instantiation: sp_int.c:ctMask16LTE Unexecuted instantiation: wc_encrypt.c:ctMask16LTE Unexecuted instantiation: wolfmath.c:ctMask16LTE Unexecuted instantiation: ssl.c:ctMask16LTE Unexecuted instantiation: tls.c:ctMask16LTE Unexecuted instantiation: tls13.c:ctMask16LTE Unexecuted instantiation: internal.c:ctMask16LTE |
721 | | |
722 | | /* Constant time - sets 16 bit integer mask when a == b. */ |
723 | | WC_MISC_STATIC WC_INLINE word16 ctMask16Eq(int a, int b) |
724 | 0 | { |
725 | 0 | return (word16)((word16)(~ctMask16GT(a, b)) & (word16)(~ctMask16LT(a, b))); |
726 | 0 | } Unexecuted instantiation: aes.c:ctMask16Eq Unexecuted instantiation: asn.c:ctMask16Eq Unexecuted instantiation: camellia.c:ctMask16Eq Unexecuted instantiation: chacha.c:ctMask16Eq Unexecuted instantiation: chacha20_poly1305.c:ctMask16Eq Unexecuted instantiation: cmac.c:ctMask16Eq Unexecuted instantiation: coding.c:ctMask16Eq Unexecuted instantiation: curve25519.c:ctMask16Eq Unexecuted instantiation: curve448.c:ctMask16Eq Unexecuted instantiation: des3.c:ctMask16Eq Unexecuted instantiation: dh.c:ctMask16Eq Unexecuted instantiation: ecc.c:ctMask16Eq Unexecuted instantiation: eccsi.c:ctMask16Eq Unexecuted instantiation: ed25519.c:ctMask16Eq Unexecuted instantiation: ed448.c:ctMask16Eq Unexecuted instantiation: fe_448.c:ctMask16Eq Unexecuted instantiation: fe_operations.c:ctMask16Eq Unexecuted instantiation: ge_448.c:ctMask16Eq Unexecuted instantiation: ge_operations.c:ctMask16Eq Unexecuted instantiation: hash.c:ctMask16Eq Unexecuted instantiation: hmac.c:ctMask16Eq Unexecuted instantiation: kdf.c:ctMask16Eq Unexecuted instantiation: md2.c:ctMask16Eq Unexecuted instantiation: md4.c:ctMask16Eq Unexecuted instantiation: md5.c:ctMask16Eq Unexecuted instantiation: poly1305.c:ctMask16Eq Unexecuted instantiation: pwdbased.c:ctMask16Eq Unexecuted instantiation: random.c:ctMask16Eq Unexecuted instantiation: ripemd.c:ctMask16Eq Unexecuted instantiation: rsa.c:ctMask16Eq Unexecuted instantiation: sha.c:ctMask16Eq Unexecuted instantiation: sha256.c:ctMask16Eq Unexecuted instantiation: sha3.c:ctMask16Eq Unexecuted instantiation: sha512.c:ctMask16Eq Unexecuted instantiation: siphash.c:ctMask16Eq Unexecuted instantiation: sm2.c:ctMask16Eq Unexecuted instantiation: sm3.c:ctMask16Eq Unexecuted instantiation: sm4.c:ctMask16Eq Unexecuted instantiation: sp_int.c:ctMask16Eq Unexecuted instantiation: wc_encrypt.c:ctMask16Eq Unexecuted instantiation: wolfmath.c:ctMask16Eq Unexecuted instantiation: ssl.c:ctMask16Eq Unexecuted instantiation: tls.c:ctMask16Eq Unexecuted instantiation: tls13.c:ctMask16Eq Unexecuted instantiation: internal.c:ctMask16Eq |
727 | | |
728 | | /* Constant time - mask set when a != b. */ |
729 | | WC_MISC_STATIC WC_INLINE byte ctMaskNotEq(int a, int b) |
730 | 0 | { |
731 | 0 | return (byte)((byte)ctMaskGT(a, b) | (byte)ctMaskLT(a, b)); |
732 | 0 | } Unexecuted instantiation: aes.c:ctMaskNotEq Unexecuted instantiation: asn.c:ctMaskNotEq Unexecuted instantiation: camellia.c:ctMaskNotEq Unexecuted instantiation: chacha.c:ctMaskNotEq Unexecuted instantiation: chacha20_poly1305.c:ctMaskNotEq Unexecuted instantiation: cmac.c:ctMaskNotEq Unexecuted instantiation: coding.c:ctMaskNotEq Unexecuted instantiation: curve25519.c:ctMaskNotEq Unexecuted instantiation: curve448.c:ctMaskNotEq Unexecuted instantiation: des3.c:ctMaskNotEq Unexecuted instantiation: dh.c:ctMaskNotEq Unexecuted instantiation: ecc.c:ctMaskNotEq Unexecuted instantiation: eccsi.c:ctMaskNotEq Unexecuted instantiation: ed25519.c:ctMaskNotEq Unexecuted instantiation: ed448.c:ctMaskNotEq Unexecuted instantiation: fe_448.c:ctMaskNotEq Unexecuted instantiation: fe_operations.c:ctMaskNotEq Unexecuted instantiation: ge_448.c:ctMaskNotEq Unexecuted instantiation: ge_operations.c:ctMaskNotEq Unexecuted instantiation: hash.c:ctMaskNotEq Unexecuted instantiation: hmac.c:ctMaskNotEq Unexecuted instantiation: kdf.c:ctMaskNotEq Unexecuted instantiation: md2.c:ctMaskNotEq Unexecuted instantiation: md4.c:ctMaskNotEq Unexecuted instantiation: md5.c:ctMaskNotEq Unexecuted instantiation: poly1305.c:ctMaskNotEq Unexecuted instantiation: pwdbased.c:ctMaskNotEq Unexecuted instantiation: random.c:ctMaskNotEq Unexecuted instantiation: ripemd.c:ctMaskNotEq Unexecuted instantiation: rsa.c:ctMaskNotEq Unexecuted instantiation: sha.c:ctMaskNotEq Unexecuted instantiation: sha256.c:ctMaskNotEq Unexecuted instantiation: sha3.c:ctMaskNotEq Unexecuted instantiation: sha512.c:ctMaskNotEq Unexecuted instantiation: siphash.c:ctMaskNotEq Unexecuted instantiation: sm2.c:ctMaskNotEq Unexecuted instantiation: sm3.c:ctMaskNotEq Unexecuted instantiation: sm4.c:ctMaskNotEq Unexecuted instantiation: sp_int.c:ctMaskNotEq Unexecuted instantiation: wc_encrypt.c:ctMaskNotEq Unexecuted instantiation: wolfmath.c:ctMaskNotEq Unexecuted instantiation: ssl.c:ctMaskNotEq Unexecuted instantiation: tls.c:ctMaskNotEq Unexecuted instantiation: tls13.c:ctMaskNotEq Unexecuted instantiation: internal.c:ctMaskNotEq |
733 | | |
734 | | /* Constant time - select a when mask is set and b otherwise. */ |
735 | | WC_MISC_STATIC WC_INLINE byte ctMaskSel(byte m, byte a, byte b) |
736 | 0 | { |
737 | 0 | return (byte)((b & ((byte)~(word32)m)) | (a & m)); |
738 | 0 | } Unexecuted instantiation: aes.c:ctMaskSel Unexecuted instantiation: asn.c:ctMaskSel Unexecuted instantiation: camellia.c:ctMaskSel Unexecuted instantiation: chacha.c:ctMaskSel Unexecuted instantiation: chacha20_poly1305.c:ctMaskSel Unexecuted instantiation: cmac.c:ctMaskSel Unexecuted instantiation: coding.c:ctMaskSel Unexecuted instantiation: curve25519.c:ctMaskSel Unexecuted instantiation: curve448.c:ctMaskSel Unexecuted instantiation: des3.c:ctMaskSel Unexecuted instantiation: dh.c:ctMaskSel Unexecuted instantiation: ecc.c:ctMaskSel Unexecuted instantiation: eccsi.c:ctMaskSel Unexecuted instantiation: ed25519.c:ctMaskSel Unexecuted instantiation: ed448.c:ctMaskSel Unexecuted instantiation: fe_448.c:ctMaskSel Unexecuted instantiation: fe_operations.c:ctMaskSel Unexecuted instantiation: ge_448.c:ctMaskSel Unexecuted instantiation: ge_operations.c:ctMaskSel Unexecuted instantiation: hash.c:ctMaskSel Unexecuted instantiation: hmac.c:ctMaskSel Unexecuted instantiation: kdf.c:ctMaskSel Unexecuted instantiation: md2.c:ctMaskSel Unexecuted instantiation: md4.c:ctMaskSel Unexecuted instantiation: md5.c:ctMaskSel Unexecuted instantiation: poly1305.c:ctMaskSel Unexecuted instantiation: pwdbased.c:ctMaskSel Unexecuted instantiation: random.c:ctMaskSel Unexecuted instantiation: ripemd.c:ctMaskSel Unexecuted instantiation: rsa.c:ctMaskSel Unexecuted instantiation: sha.c:ctMaskSel Unexecuted instantiation: sha256.c:ctMaskSel Unexecuted instantiation: sha3.c:ctMaskSel Unexecuted instantiation: sha512.c:ctMaskSel Unexecuted instantiation: siphash.c:ctMaskSel Unexecuted instantiation: sm2.c:ctMaskSel Unexecuted instantiation: sm3.c:ctMaskSel Unexecuted instantiation: sm4.c:ctMaskSel Unexecuted instantiation: sp_int.c:ctMaskSel Unexecuted instantiation: wc_encrypt.c:ctMaskSel Unexecuted instantiation: wolfmath.c:ctMaskSel Unexecuted instantiation: ssl.c:ctMaskSel Unexecuted instantiation: tls.c:ctMaskSel Unexecuted instantiation: tls13.c:ctMaskSel Unexecuted instantiation: internal.c:ctMaskSel |
739 | | |
740 | | /* Constant time - select integer a when mask is set and integer b otherwise. */ |
741 | | WC_MISC_STATIC WC_INLINE int ctMaskSelInt(byte m, int a, int b) |
742 | 0 | { |
743 | 0 | return (b & (~(signed int)(signed char)m)) | |
744 | 0 | (a & ( (signed int)(signed char)m)); |
745 | 0 | } Unexecuted instantiation: aes.c:ctMaskSelInt Unexecuted instantiation: asn.c:ctMaskSelInt Unexecuted instantiation: camellia.c:ctMaskSelInt Unexecuted instantiation: chacha.c:ctMaskSelInt Unexecuted instantiation: chacha20_poly1305.c:ctMaskSelInt Unexecuted instantiation: cmac.c:ctMaskSelInt Unexecuted instantiation: coding.c:ctMaskSelInt Unexecuted instantiation: curve25519.c:ctMaskSelInt Unexecuted instantiation: curve448.c:ctMaskSelInt Unexecuted instantiation: des3.c:ctMaskSelInt Unexecuted instantiation: dh.c:ctMaskSelInt Unexecuted instantiation: ecc.c:ctMaskSelInt Unexecuted instantiation: eccsi.c:ctMaskSelInt Unexecuted instantiation: ed25519.c:ctMaskSelInt Unexecuted instantiation: ed448.c:ctMaskSelInt Unexecuted instantiation: fe_448.c:ctMaskSelInt Unexecuted instantiation: fe_operations.c:ctMaskSelInt Unexecuted instantiation: ge_448.c:ctMaskSelInt Unexecuted instantiation: ge_operations.c:ctMaskSelInt Unexecuted instantiation: hash.c:ctMaskSelInt Unexecuted instantiation: hmac.c:ctMaskSelInt Unexecuted instantiation: kdf.c:ctMaskSelInt Unexecuted instantiation: md2.c:ctMaskSelInt Unexecuted instantiation: md4.c:ctMaskSelInt Unexecuted instantiation: md5.c:ctMaskSelInt Unexecuted instantiation: poly1305.c:ctMaskSelInt Unexecuted instantiation: pwdbased.c:ctMaskSelInt Unexecuted instantiation: random.c:ctMaskSelInt Unexecuted instantiation: ripemd.c:ctMaskSelInt Unexecuted instantiation: rsa.c:ctMaskSelInt Unexecuted instantiation: sha.c:ctMaskSelInt Unexecuted instantiation: sha256.c:ctMaskSelInt Unexecuted instantiation: sha3.c:ctMaskSelInt Unexecuted instantiation: sha512.c:ctMaskSelInt Unexecuted instantiation: siphash.c:ctMaskSelInt Unexecuted instantiation: sm2.c:ctMaskSelInt Unexecuted instantiation: sm3.c:ctMaskSelInt Unexecuted instantiation: sm4.c:ctMaskSelInt Unexecuted instantiation: sp_int.c:ctMaskSelInt Unexecuted instantiation: wc_encrypt.c:ctMaskSelInt Unexecuted instantiation: wolfmath.c:ctMaskSelInt Unexecuted instantiation: ssl.c:ctMaskSelInt Unexecuted instantiation: tls.c:ctMaskSelInt Unexecuted instantiation: tls13.c:ctMaskSelInt Unexecuted instantiation: internal.c:ctMaskSelInt |
746 | | |
747 | | /* Constant time - select word32 a when mask is set and word32 b otherwise. */ |
748 | | WC_MISC_STATIC WC_INLINE word32 ctMaskSelWord32(byte m, word32 a, word32 b) |
749 | 0 | { |
750 | 0 | return (((word32)b & (word32)(~(signed int)(signed char)m)) | |
751 | 0 | ((word32)a & (word32)( (signed int)(signed char)m))); |
752 | 0 | } Unexecuted instantiation: aes.c:ctMaskSelWord32 Unexecuted instantiation: asn.c:ctMaskSelWord32 Unexecuted instantiation: camellia.c:ctMaskSelWord32 Unexecuted instantiation: chacha.c:ctMaskSelWord32 Unexecuted instantiation: chacha20_poly1305.c:ctMaskSelWord32 Unexecuted instantiation: cmac.c:ctMaskSelWord32 Unexecuted instantiation: coding.c:ctMaskSelWord32 Unexecuted instantiation: curve25519.c:ctMaskSelWord32 Unexecuted instantiation: curve448.c:ctMaskSelWord32 Unexecuted instantiation: des3.c:ctMaskSelWord32 Unexecuted instantiation: dh.c:ctMaskSelWord32 Unexecuted instantiation: ecc.c:ctMaskSelWord32 Unexecuted instantiation: eccsi.c:ctMaskSelWord32 Unexecuted instantiation: ed25519.c:ctMaskSelWord32 Unexecuted instantiation: ed448.c:ctMaskSelWord32 Unexecuted instantiation: fe_448.c:ctMaskSelWord32 Unexecuted instantiation: fe_operations.c:ctMaskSelWord32 Unexecuted instantiation: ge_448.c:ctMaskSelWord32 Unexecuted instantiation: ge_operations.c:ctMaskSelWord32 Unexecuted instantiation: hash.c:ctMaskSelWord32 Unexecuted instantiation: hmac.c:ctMaskSelWord32 Unexecuted instantiation: kdf.c:ctMaskSelWord32 Unexecuted instantiation: md2.c:ctMaskSelWord32 Unexecuted instantiation: md4.c:ctMaskSelWord32 Unexecuted instantiation: md5.c:ctMaskSelWord32 Unexecuted instantiation: poly1305.c:ctMaskSelWord32 Unexecuted instantiation: pwdbased.c:ctMaskSelWord32 Unexecuted instantiation: random.c:ctMaskSelWord32 Unexecuted instantiation: ripemd.c:ctMaskSelWord32 Unexecuted instantiation: rsa.c:ctMaskSelWord32 Unexecuted instantiation: sha.c:ctMaskSelWord32 Unexecuted instantiation: sha256.c:ctMaskSelWord32 Unexecuted instantiation: sha3.c:ctMaskSelWord32 Unexecuted instantiation: sha512.c:ctMaskSelWord32 Unexecuted instantiation: siphash.c:ctMaskSelWord32 Unexecuted instantiation: sm2.c:ctMaskSelWord32 Unexecuted instantiation: sm3.c:ctMaskSelWord32 Unexecuted instantiation: sm4.c:ctMaskSelWord32 Unexecuted instantiation: sp_int.c:ctMaskSelWord32 Unexecuted instantiation: wc_encrypt.c:ctMaskSelWord32 Unexecuted instantiation: wolfmath.c:ctMaskSelWord32 Unexecuted instantiation: ssl.c:ctMaskSelWord32 Unexecuted instantiation: tls.c:ctMaskSelWord32 Unexecuted instantiation: tls13.c:ctMaskSelWord32 Unexecuted instantiation: internal.c:ctMaskSelWord32 |
753 | | |
754 | | /* Constant time - bit set when a <= b. */ |
755 | | WC_MISC_STATIC WC_INLINE byte ctSetLTE(int a, int b) |
756 | 0 | { |
757 | 0 | return (byte)(((word32)a - (word32)b - 1) >> 31); |
758 | 0 | } Unexecuted instantiation: aes.c:ctSetLTE Unexecuted instantiation: asn.c:ctSetLTE Unexecuted instantiation: camellia.c:ctSetLTE Unexecuted instantiation: chacha.c:ctSetLTE Unexecuted instantiation: chacha20_poly1305.c:ctSetLTE Unexecuted instantiation: cmac.c:ctSetLTE Unexecuted instantiation: coding.c:ctSetLTE Unexecuted instantiation: curve25519.c:ctSetLTE Unexecuted instantiation: curve448.c:ctSetLTE Unexecuted instantiation: des3.c:ctSetLTE Unexecuted instantiation: dh.c:ctSetLTE Unexecuted instantiation: ecc.c:ctSetLTE Unexecuted instantiation: eccsi.c:ctSetLTE Unexecuted instantiation: ed25519.c:ctSetLTE Unexecuted instantiation: ed448.c:ctSetLTE Unexecuted instantiation: fe_448.c:ctSetLTE Unexecuted instantiation: fe_operations.c:ctSetLTE Unexecuted instantiation: ge_448.c:ctSetLTE Unexecuted instantiation: ge_operations.c:ctSetLTE Unexecuted instantiation: hash.c:ctSetLTE Unexecuted instantiation: hmac.c:ctSetLTE Unexecuted instantiation: kdf.c:ctSetLTE Unexecuted instantiation: md2.c:ctSetLTE Unexecuted instantiation: md4.c:ctSetLTE Unexecuted instantiation: md5.c:ctSetLTE Unexecuted instantiation: poly1305.c:ctSetLTE Unexecuted instantiation: pwdbased.c:ctSetLTE Unexecuted instantiation: random.c:ctSetLTE Unexecuted instantiation: ripemd.c:ctSetLTE Unexecuted instantiation: rsa.c:ctSetLTE Unexecuted instantiation: sha.c:ctSetLTE Unexecuted instantiation: sha256.c:ctSetLTE Unexecuted instantiation: sha3.c:ctSetLTE Unexecuted instantiation: sha512.c:ctSetLTE Unexecuted instantiation: siphash.c:ctSetLTE Unexecuted instantiation: sm2.c:ctSetLTE Unexecuted instantiation: sm3.c:ctSetLTE Unexecuted instantiation: sm4.c:ctSetLTE Unexecuted instantiation: sp_int.c:ctSetLTE Unexecuted instantiation: wc_encrypt.c:ctSetLTE Unexecuted instantiation: wolfmath.c:ctSetLTE Unexecuted instantiation: ssl.c:ctSetLTE Unexecuted instantiation: tls.c:ctSetLTE Unexecuted instantiation: tls13.c:ctSetLTE Unexecuted instantiation: internal.c:ctSetLTE |
759 | | |
760 | | /* Constant time - conditionally copy size bytes from src to dst if mask is set |
761 | | */ |
762 | | WC_MISC_STATIC WC_INLINE void ctMaskCopy(byte mask, byte* dst, byte* src, |
763 | | word16 size) |
764 | 0 | { |
765 | 0 | int i; |
766 | 0 | for (i = 0; i < size; ++i) { |
767 | 0 | dst[i] ^= (dst[i] ^ src[i]) & mask; |
768 | 0 | } |
769 | 0 | } Unexecuted instantiation: aes.c:ctMaskCopy Unexecuted instantiation: asn.c:ctMaskCopy Unexecuted instantiation: camellia.c:ctMaskCopy Unexecuted instantiation: chacha.c:ctMaskCopy Unexecuted instantiation: chacha20_poly1305.c:ctMaskCopy Unexecuted instantiation: cmac.c:ctMaskCopy Unexecuted instantiation: coding.c:ctMaskCopy Unexecuted instantiation: curve25519.c:ctMaskCopy Unexecuted instantiation: curve448.c:ctMaskCopy Unexecuted instantiation: des3.c:ctMaskCopy Unexecuted instantiation: dh.c:ctMaskCopy Unexecuted instantiation: ecc.c:ctMaskCopy Unexecuted instantiation: eccsi.c:ctMaskCopy Unexecuted instantiation: ed25519.c:ctMaskCopy Unexecuted instantiation: ed448.c:ctMaskCopy Unexecuted instantiation: fe_448.c:ctMaskCopy Unexecuted instantiation: fe_operations.c:ctMaskCopy Unexecuted instantiation: ge_448.c:ctMaskCopy Unexecuted instantiation: ge_operations.c:ctMaskCopy Unexecuted instantiation: hash.c:ctMaskCopy Unexecuted instantiation: hmac.c:ctMaskCopy Unexecuted instantiation: kdf.c:ctMaskCopy Unexecuted instantiation: md2.c:ctMaskCopy Unexecuted instantiation: md4.c:ctMaskCopy Unexecuted instantiation: md5.c:ctMaskCopy Unexecuted instantiation: poly1305.c:ctMaskCopy Unexecuted instantiation: pwdbased.c:ctMaskCopy Unexecuted instantiation: random.c:ctMaskCopy Unexecuted instantiation: ripemd.c:ctMaskCopy Unexecuted instantiation: rsa.c:ctMaskCopy Unexecuted instantiation: sha.c:ctMaskCopy Unexecuted instantiation: sha256.c:ctMaskCopy Unexecuted instantiation: sha3.c:ctMaskCopy Unexecuted instantiation: sha512.c:ctMaskCopy Unexecuted instantiation: siphash.c:ctMaskCopy Unexecuted instantiation: sm2.c:ctMaskCopy Unexecuted instantiation: sm3.c:ctMaskCopy Unexecuted instantiation: sm4.c:ctMaskCopy Unexecuted instantiation: sp_int.c:ctMaskCopy Unexecuted instantiation: wc_encrypt.c:ctMaskCopy Unexecuted instantiation: wolfmath.c:ctMaskCopy Unexecuted instantiation: ssl.c:ctMaskCopy Unexecuted instantiation: tls.c:ctMaskCopy Unexecuted instantiation: tls13.c:ctMaskCopy Unexecuted instantiation: internal.c:ctMaskCopy |
770 | | |
771 | | #endif |
772 | | |
773 | | #if defined(WOLFSSL_W64_WRAPPER) |
774 | | #if defined(WORD64_AVAILABLE) && !defined(WOLFSSL_W64_WRAPPER_TEST) |
775 | 0 | WC_MISC_STATIC WC_INLINE void w64Increment(w64wrapper *n) { |
776 | 0 | n->n++; |
777 | 0 | } Unexecuted instantiation: aes.c:w64Increment Unexecuted instantiation: asn.c:w64Increment Unexecuted instantiation: camellia.c:w64Increment Unexecuted instantiation: chacha.c:w64Increment Unexecuted instantiation: chacha20_poly1305.c:w64Increment Unexecuted instantiation: cmac.c:w64Increment Unexecuted instantiation: coding.c:w64Increment Unexecuted instantiation: curve25519.c:w64Increment Unexecuted instantiation: curve448.c:w64Increment Unexecuted instantiation: des3.c:w64Increment Unexecuted instantiation: dh.c:w64Increment Unexecuted instantiation: ecc.c:w64Increment Unexecuted instantiation: eccsi.c:w64Increment Unexecuted instantiation: ed25519.c:w64Increment Unexecuted instantiation: ed448.c:w64Increment Unexecuted instantiation: fe_448.c:w64Increment Unexecuted instantiation: fe_operations.c:w64Increment Unexecuted instantiation: ge_448.c:w64Increment Unexecuted instantiation: ge_operations.c:w64Increment Unexecuted instantiation: hash.c:w64Increment Unexecuted instantiation: hmac.c:w64Increment Unexecuted instantiation: kdf.c:w64Increment Unexecuted instantiation: md2.c:w64Increment Unexecuted instantiation: md4.c:w64Increment Unexecuted instantiation: md5.c:w64Increment Unexecuted instantiation: poly1305.c:w64Increment Unexecuted instantiation: pwdbased.c:w64Increment Unexecuted instantiation: random.c:w64Increment Unexecuted instantiation: ripemd.c:w64Increment Unexecuted instantiation: rsa.c:w64Increment Unexecuted instantiation: sha.c:w64Increment Unexecuted instantiation: sha256.c:w64Increment Unexecuted instantiation: sha3.c:w64Increment Unexecuted instantiation: sha512.c:w64Increment Unexecuted instantiation: siphash.c:w64Increment Unexecuted instantiation: sm2.c:w64Increment Unexecuted instantiation: sm3.c:w64Increment Unexecuted instantiation: sm4.c:w64Increment Unexecuted instantiation: sp_int.c:w64Increment Unexecuted instantiation: wc_encrypt.c:w64Increment Unexecuted instantiation: wolfmath.c:w64Increment Unexecuted instantiation: ssl.c:w64Increment Unexecuted instantiation: tls.c:w64Increment Unexecuted instantiation: tls13.c:w64Increment Unexecuted instantiation: internal.c:w64Increment |
778 | | |
779 | 0 | WC_MISC_STATIC WC_INLINE void w64Decrement(w64wrapper *n) { |
780 | 0 | n->n--; |
781 | 0 | } Unexecuted instantiation: aes.c:w64Decrement Unexecuted instantiation: asn.c:w64Decrement Unexecuted instantiation: camellia.c:w64Decrement Unexecuted instantiation: chacha.c:w64Decrement Unexecuted instantiation: chacha20_poly1305.c:w64Decrement Unexecuted instantiation: cmac.c:w64Decrement Unexecuted instantiation: coding.c:w64Decrement Unexecuted instantiation: curve25519.c:w64Decrement Unexecuted instantiation: curve448.c:w64Decrement Unexecuted instantiation: des3.c:w64Decrement Unexecuted instantiation: dh.c:w64Decrement Unexecuted instantiation: ecc.c:w64Decrement Unexecuted instantiation: eccsi.c:w64Decrement Unexecuted instantiation: ed25519.c:w64Decrement Unexecuted instantiation: ed448.c:w64Decrement Unexecuted instantiation: fe_448.c:w64Decrement Unexecuted instantiation: fe_operations.c:w64Decrement Unexecuted instantiation: ge_448.c:w64Decrement Unexecuted instantiation: ge_operations.c:w64Decrement Unexecuted instantiation: hash.c:w64Decrement Unexecuted instantiation: hmac.c:w64Decrement Unexecuted instantiation: kdf.c:w64Decrement Unexecuted instantiation: md2.c:w64Decrement Unexecuted instantiation: md4.c:w64Decrement Unexecuted instantiation: md5.c:w64Decrement Unexecuted instantiation: poly1305.c:w64Decrement Unexecuted instantiation: pwdbased.c:w64Decrement Unexecuted instantiation: random.c:w64Decrement Unexecuted instantiation: ripemd.c:w64Decrement Unexecuted instantiation: rsa.c:w64Decrement Unexecuted instantiation: sha.c:w64Decrement Unexecuted instantiation: sha256.c:w64Decrement Unexecuted instantiation: sha3.c:w64Decrement Unexecuted instantiation: sha512.c:w64Decrement Unexecuted instantiation: siphash.c:w64Decrement Unexecuted instantiation: sm2.c:w64Decrement Unexecuted instantiation: sm3.c:w64Decrement Unexecuted instantiation: sm4.c:w64Decrement Unexecuted instantiation: sp_int.c:w64Decrement Unexecuted instantiation: wc_encrypt.c:w64Decrement Unexecuted instantiation: wolfmath.c:w64Decrement Unexecuted instantiation: ssl.c:w64Decrement Unexecuted instantiation: tls.c:w64Decrement Unexecuted instantiation: tls13.c:w64Decrement Unexecuted instantiation: internal.c:w64Decrement |
782 | | |
783 | 0 | WC_MISC_STATIC WC_INLINE byte w64Equal(w64wrapper a, w64wrapper b) { |
784 | 0 | return (a.n == b.n); |
785 | 0 | } Unexecuted instantiation: aes.c:w64Equal Unexecuted instantiation: asn.c:w64Equal Unexecuted instantiation: camellia.c:w64Equal Unexecuted instantiation: chacha.c:w64Equal Unexecuted instantiation: chacha20_poly1305.c:w64Equal Unexecuted instantiation: cmac.c:w64Equal Unexecuted instantiation: coding.c:w64Equal Unexecuted instantiation: curve25519.c:w64Equal Unexecuted instantiation: curve448.c:w64Equal Unexecuted instantiation: des3.c:w64Equal Unexecuted instantiation: dh.c:w64Equal Unexecuted instantiation: ecc.c:w64Equal Unexecuted instantiation: eccsi.c:w64Equal Unexecuted instantiation: ed25519.c:w64Equal Unexecuted instantiation: ed448.c:w64Equal Unexecuted instantiation: fe_448.c:w64Equal Unexecuted instantiation: fe_operations.c:w64Equal Unexecuted instantiation: ge_448.c:w64Equal Unexecuted instantiation: ge_operations.c:w64Equal Unexecuted instantiation: hash.c:w64Equal Unexecuted instantiation: hmac.c:w64Equal Unexecuted instantiation: kdf.c:w64Equal Unexecuted instantiation: md2.c:w64Equal Unexecuted instantiation: md4.c:w64Equal Unexecuted instantiation: md5.c:w64Equal Unexecuted instantiation: poly1305.c:w64Equal Unexecuted instantiation: pwdbased.c:w64Equal Unexecuted instantiation: random.c:w64Equal Unexecuted instantiation: ripemd.c:w64Equal Unexecuted instantiation: rsa.c:w64Equal Unexecuted instantiation: sha.c:w64Equal Unexecuted instantiation: sha256.c:w64Equal Unexecuted instantiation: sha3.c:w64Equal Unexecuted instantiation: sha512.c:w64Equal Unexecuted instantiation: siphash.c:w64Equal Unexecuted instantiation: sm2.c:w64Equal Unexecuted instantiation: sm3.c:w64Equal Unexecuted instantiation: sm4.c:w64Equal Unexecuted instantiation: sp_int.c:w64Equal Unexecuted instantiation: wc_encrypt.c:w64Equal Unexecuted instantiation: wolfmath.c:w64Equal Unexecuted instantiation: ssl.c:w64Equal Unexecuted instantiation: tls.c:w64Equal Unexecuted instantiation: tls13.c:w64Equal Unexecuted instantiation: internal.c:w64Equal |
786 | | |
787 | 0 | WC_MISC_STATIC WC_INLINE word32 w64GetLow32(w64wrapper n) { |
788 | 0 | return (word32)n.n; |
789 | 0 | } Unexecuted instantiation: aes.c:w64GetLow32 Unexecuted instantiation: asn.c:w64GetLow32 Unexecuted instantiation: camellia.c:w64GetLow32 Unexecuted instantiation: chacha.c:w64GetLow32 Unexecuted instantiation: chacha20_poly1305.c:w64GetLow32 Unexecuted instantiation: cmac.c:w64GetLow32 Unexecuted instantiation: coding.c:w64GetLow32 Unexecuted instantiation: curve25519.c:w64GetLow32 Unexecuted instantiation: curve448.c:w64GetLow32 Unexecuted instantiation: des3.c:w64GetLow32 Unexecuted instantiation: dh.c:w64GetLow32 Unexecuted instantiation: ecc.c:w64GetLow32 Unexecuted instantiation: eccsi.c:w64GetLow32 Unexecuted instantiation: ed25519.c:w64GetLow32 Unexecuted instantiation: ed448.c:w64GetLow32 Unexecuted instantiation: fe_448.c:w64GetLow32 Unexecuted instantiation: fe_operations.c:w64GetLow32 Unexecuted instantiation: ge_448.c:w64GetLow32 Unexecuted instantiation: ge_operations.c:w64GetLow32 Unexecuted instantiation: hash.c:w64GetLow32 Unexecuted instantiation: hmac.c:w64GetLow32 Unexecuted instantiation: kdf.c:w64GetLow32 Unexecuted instantiation: md2.c:w64GetLow32 Unexecuted instantiation: md4.c:w64GetLow32 Unexecuted instantiation: md5.c:w64GetLow32 Unexecuted instantiation: poly1305.c:w64GetLow32 Unexecuted instantiation: pwdbased.c:w64GetLow32 Unexecuted instantiation: random.c:w64GetLow32 Unexecuted instantiation: ripemd.c:w64GetLow32 Unexecuted instantiation: rsa.c:w64GetLow32 Unexecuted instantiation: sha.c:w64GetLow32 Unexecuted instantiation: sha256.c:w64GetLow32 Unexecuted instantiation: sha3.c:w64GetLow32 Unexecuted instantiation: sha512.c:w64GetLow32 Unexecuted instantiation: siphash.c:w64GetLow32 Unexecuted instantiation: sm2.c:w64GetLow32 Unexecuted instantiation: sm3.c:w64GetLow32 Unexecuted instantiation: sm4.c:w64GetLow32 Unexecuted instantiation: sp_int.c:w64GetLow32 Unexecuted instantiation: wc_encrypt.c:w64GetLow32 Unexecuted instantiation: wolfmath.c:w64GetLow32 Unexecuted instantiation: ssl.c:w64GetLow32 Unexecuted instantiation: tls.c:w64GetLow32 Unexecuted instantiation: tls13.c:w64GetLow32 Unexecuted instantiation: internal.c:w64GetLow32 |
790 | | |
791 | 0 | WC_MISC_STATIC WC_INLINE word32 w64GetHigh32(w64wrapper n) { |
792 | 0 | return (word32)(n.n >> 32); |
793 | 0 | } Unexecuted instantiation: aes.c:w64GetHigh32 Unexecuted instantiation: asn.c:w64GetHigh32 Unexecuted instantiation: camellia.c:w64GetHigh32 Unexecuted instantiation: chacha.c:w64GetHigh32 Unexecuted instantiation: chacha20_poly1305.c:w64GetHigh32 Unexecuted instantiation: cmac.c:w64GetHigh32 Unexecuted instantiation: coding.c:w64GetHigh32 Unexecuted instantiation: curve25519.c:w64GetHigh32 Unexecuted instantiation: curve448.c:w64GetHigh32 Unexecuted instantiation: des3.c:w64GetHigh32 Unexecuted instantiation: dh.c:w64GetHigh32 Unexecuted instantiation: ecc.c:w64GetHigh32 Unexecuted instantiation: eccsi.c:w64GetHigh32 Unexecuted instantiation: ed25519.c:w64GetHigh32 Unexecuted instantiation: ed448.c:w64GetHigh32 Unexecuted instantiation: fe_448.c:w64GetHigh32 Unexecuted instantiation: fe_operations.c:w64GetHigh32 Unexecuted instantiation: ge_448.c:w64GetHigh32 Unexecuted instantiation: ge_operations.c:w64GetHigh32 Unexecuted instantiation: hash.c:w64GetHigh32 Unexecuted instantiation: hmac.c:w64GetHigh32 Unexecuted instantiation: kdf.c:w64GetHigh32 Unexecuted instantiation: md2.c:w64GetHigh32 Unexecuted instantiation: md4.c:w64GetHigh32 Unexecuted instantiation: md5.c:w64GetHigh32 Unexecuted instantiation: poly1305.c:w64GetHigh32 Unexecuted instantiation: pwdbased.c:w64GetHigh32 Unexecuted instantiation: random.c:w64GetHigh32 Unexecuted instantiation: ripemd.c:w64GetHigh32 Unexecuted instantiation: rsa.c:w64GetHigh32 Unexecuted instantiation: sha.c:w64GetHigh32 Unexecuted instantiation: sha256.c:w64GetHigh32 Unexecuted instantiation: sha3.c:w64GetHigh32 Unexecuted instantiation: sha512.c:w64GetHigh32 Unexecuted instantiation: siphash.c:w64GetHigh32 Unexecuted instantiation: sm2.c:w64GetHigh32 Unexecuted instantiation: sm3.c:w64GetHigh32 Unexecuted instantiation: sm4.c:w64GetHigh32 Unexecuted instantiation: sp_int.c:w64GetHigh32 Unexecuted instantiation: wc_encrypt.c:w64GetHigh32 Unexecuted instantiation: wolfmath.c:w64GetHigh32 Unexecuted instantiation: ssl.c:w64GetHigh32 Unexecuted instantiation: tls.c:w64GetHigh32 Unexecuted instantiation: tls13.c:w64GetHigh32 Unexecuted instantiation: internal.c:w64GetHigh32 |
794 | | |
795 | 0 | WC_MISC_STATIC WC_INLINE void w64SetLow32(w64wrapper *n, word32 low) { |
796 | 0 | n->n = (n->n & (~(word64)(0xffffffff))) | low; |
797 | 0 | } Unexecuted instantiation: aes.c:w64SetLow32 Unexecuted instantiation: asn.c:w64SetLow32 Unexecuted instantiation: camellia.c:w64SetLow32 Unexecuted instantiation: chacha.c:w64SetLow32 Unexecuted instantiation: chacha20_poly1305.c:w64SetLow32 Unexecuted instantiation: cmac.c:w64SetLow32 Unexecuted instantiation: coding.c:w64SetLow32 Unexecuted instantiation: curve25519.c:w64SetLow32 Unexecuted instantiation: curve448.c:w64SetLow32 Unexecuted instantiation: des3.c:w64SetLow32 Unexecuted instantiation: dh.c:w64SetLow32 Unexecuted instantiation: ecc.c:w64SetLow32 Unexecuted instantiation: eccsi.c:w64SetLow32 Unexecuted instantiation: ed25519.c:w64SetLow32 Unexecuted instantiation: ed448.c:w64SetLow32 Unexecuted instantiation: fe_448.c:w64SetLow32 Unexecuted instantiation: fe_operations.c:w64SetLow32 Unexecuted instantiation: ge_448.c:w64SetLow32 Unexecuted instantiation: ge_operations.c:w64SetLow32 Unexecuted instantiation: hash.c:w64SetLow32 Unexecuted instantiation: hmac.c:w64SetLow32 Unexecuted instantiation: kdf.c:w64SetLow32 Unexecuted instantiation: md2.c:w64SetLow32 Unexecuted instantiation: md4.c:w64SetLow32 Unexecuted instantiation: md5.c:w64SetLow32 Unexecuted instantiation: poly1305.c:w64SetLow32 Unexecuted instantiation: pwdbased.c:w64SetLow32 Unexecuted instantiation: random.c:w64SetLow32 Unexecuted instantiation: ripemd.c:w64SetLow32 Unexecuted instantiation: rsa.c:w64SetLow32 Unexecuted instantiation: sha.c:w64SetLow32 Unexecuted instantiation: sha256.c:w64SetLow32 Unexecuted instantiation: sha3.c:w64SetLow32 Unexecuted instantiation: sha512.c:w64SetLow32 Unexecuted instantiation: siphash.c:w64SetLow32 Unexecuted instantiation: sm2.c:w64SetLow32 Unexecuted instantiation: sm3.c:w64SetLow32 Unexecuted instantiation: sm4.c:w64SetLow32 Unexecuted instantiation: sp_int.c:w64SetLow32 Unexecuted instantiation: wc_encrypt.c:w64SetLow32 Unexecuted instantiation: wolfmath.c:w64SetLow32 Unexecuted instantiation: ssl.c:w64SetLow32 Unexecuted instantiation: tls.c:w64SetLow32 Unexecuted instantiation: tls13.c:w64SetLow32 Unexecuted instantiation: internal.c:w64SetLow32 |
798 | | |
799 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Add32(w64wrapper a, word32 b, byte *wrap) |
800 | 0 | { |
801 | 0 | a.n += b; |
802 | 0 | if (a.n < b && wrap != NULL) |
803 | 0 | *wrap = 1; |
804 | 0 |
|
805 | 0 | return a; |
806 | 0 | } Unexecuted instantiation: aes.c:w64Add32 Unexecuted instantiation: asn.c:w64Add32 Unexecuted instantiation: camellia.c:w64Add32 Unexecuted instantiation: chacha.c:w64Add32 Unexecuted instantiation: chacha20_poly1305.c:w64Add32 Unexecuted instantiation: cmac.c:w64Add32 Unexecuted instantiation: coding.c:w64Add32 Unexecuted instantiation: curve25519.c:w64Add32 Unexecuted instantiation: curve448.c:w64Add32 Unexecuted instantiation: des3.c:w64Add32 Unexecuted instantiation: dh.c:w64Add32 Unexecuted instantiation: ecc.c:w64Add32 Unexecuted instantiation: eccsi.c:w64Add32 Unexecuted instantiation: ed25519.c:w64Add32 Unexecuted instantiation: ed448.c:w64Add32 Unexecuted instantiation: fe_448.c:w64Add32 Unexecuted instantiation: fe_operations.c:w64Add32 Unexecuted instantiation: ge_448.c:w64Add32 Unexecuted instantiation: ge_operations.c:w64Add32 Unexecuted instantiation: hash.c:w64Add32 Unexecuted instantiation: hmac.c:w64Add32 Unexecuted instantiation: kdf.c:w64Add32 Unexecuted instantiation: md2.c:w64Add32 Unexecuted instantiation: md4.c:w64Add32 Unexecuted instantiation: md5.c:w64Add32 Unexecuted instantiation: poly1305.c:w64Add32 Unexecuted instantiation: pwdbased.c:w64Add32 Unexecuted instantiation: random.c:w64Add32 Unexecuted instantiation: ripemd.c:w64Add32 Unexecuted instantiation: rsa.c:w64Add32 Unexecuted instantiation: sha.c:w64Add32 Unexecuted instantiation: sha256.c:w64Add32 Unexecuted instantiation: sha3.c:w64Add32 Unexecuted instantiation: sha512.c:w64Add32 Unexecuted instantiation: siphash.c:w64Add32 Unexecuted instantiation: sm2.c:w64Add32 Unexecuted instantiation: sm3.c:w64Add32 Unexecuted instantiation: sm4.c:w64Add32 Unexecuted instantiation: sp_int.c:w64Add32 Unexecuted instantiation: wc_encrypt.c:w64Add32 Unexecuted instantiation: wolfmath.c:w64Add32 Unexecuted instantiation: ssl.c:w64Add32 Unexecuted instantiation: tls.c:w64Add32 Unexecuted instantiation: tls13.c:w64Add32 Unexecuted instantiation: internal.c:w64Add32 |
807 | | |
808 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Add(w64wrapper a, w64wrapper b, |
809 | | byte *wrap) |
810 | 0 | { |
811 | 0 | a.n += b.n; |
812 | 0 | if (a.n < b.n && wrap != NULL) |
813 | 0 | *wrap = 1; |
814 | 0 |
|
815 | 0 | return a; |
816 | 0 | } Unexecuted instantiation: aes.c:w64Add Unexecuted instantiation: asn.c:w64Add Unexecuted instantiation: camellia.c:w64Add Unexecuted instantiation: chacha.c:w64Add Unexecuted instantiation: chacha20_poly1305.c:w64Add Unexecuted instantiation: cmac.c:w64Add Unexecuted instantiation: coding.c:w64Add Unexecuted instantiation: curve25519.c:w64Add Unexecuted instantiation: curve448.c:w64Add Unexecuted instantiation: des3.c:w64Add Unexecuted instantiation: dh.c:w64Add Unexecuted instantiation: ecc.c:w64Add Unexecuted instantiation: eccsi.c:w64Add Unexecuted instantiation: ed25519.c:w64Add Unexecuted instantiation: ed448.c:w64Add Unexecuted instantiation: fe_448.c:w64Add Unexecuted instantiation: fe_operations.c:w64Add Unexecuted instantiation: ge_448.c:w64Add Unexecuted instantiation: ge_operations.c:w64Add Unexecuted instantiation: hash.c:w64Add Unexecuted instantiation: hmac.c:w64Add Unexecuted instantiation: kdf.c:w64Add Unexecuted instantiation: md2.c:w64Add Unexecuted instantiation: md4.c:w64Add Unexecuted instantiation: md5.c:w64Add Unexecuted instantiation: poly1305.c:w64Add Unexecuted instantiation: pwdbased.c:w64Add Unexecuted instantiation: random.c:w64Add Unexecuted instantiation: ripemd.c:w64Add Unexecuted instantiation: rsa.c:w64Add Unexecuted instantiation: sha.c:w64Add Unexecuted instantiation: sha256.c:w64Add Unexecuted instantiation: sha3.c:w64Add Unexecuted instantiation: sha512.c:w64Add Unexecuted instantiation: siphash.c:w64Add Unexecuted instantiation: sm2.c:w64Add Unexecuted instantiation: sm3.c:w64Add Unexecuted instantiation: sm4.c:w64Add Unexecuted instantiation: sp_int.c:w64Add Unexecuted instantiation: wc_encrypt.c:w64Add Unexecuted instantiation: wolfmath.c:w64Add Unexecuted instantiation: ssl.c:w64Add Unexecuted instantiation: tls.c:w64Add Unexecuted instantiation: tls13.c:w64Add Unexecuted instantiation: internal.c:w64Add |
817 | | |
818 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Sub32(w64wrapper a, word32 b, byte *wrap) |
819 | 0 | { |
820 | 0 | if (a.n < b && wrap != NULL) |
821 | 0 | *wrap = 1; |
822 | 0 | a.n = a.n - b; |
823 | 0 | return a; |
824 | 0 | } Unexecuted instantiation: aes.c:w64Sub32 Unexecuted instantiation: asn.c:w64Sub32 Unexecuted instantiation: camellia.c:w64Sub32 Unexecuted instantiation: chacha.c:w64Sub32 Unexecuted instantiation: chacha20_poly1305.c:w64Sub32 Unexecuted instantiation: cmac.c:w64Sub32 Unexecuted instantiation: coding.c:w64Sub32 Unexecuted instantiation: curve25519.c:w64Sub32 Unexecuted instantiation: curve448.c:w64Sub32 Unexecuted instantiation: des3.c:w64Sub32 Unexecuted instantiation: dh.c:w64Sub32 Unexecuted instantiation: ecc.c:w64Sub32 Unexecuted instantiation: eccsi.c:w64Sub32 Unexecuted instantiation: ed25519.c:w64Sub32 Unexecuted instantiation: ed448.c:w64Sub32 Unexecuted instantiation: fe_448.c:w64Sub32 Unexecuted instantiation: fe_operations.c:w64Sub32 Unexecuted instantiation: ge_448.c:w64Sub32 Unexecuted instantiation: ge_operations.c:w64Sub32 Unexecuted instantiation: hash.c:w64Sub32 Unexecuted instantiation: hmac.c:w64Sub32 Unexecuted instantiation: kdf.c:w64Sub32 Unexecuted instantiation: md2.c:w64Sub32 Unexecuted instantiation: md4.c:w64Sub32 Unexecuted instantiation: md5.c:w64Sub32 Unexecuted instantiation: poly1305.c:w64Sub32 Unexecuted instantiation: pwdbased.c:w64Sub32 Unexecuted instantiation: random.c:w64Sub32 Unexecuted instantiation: ripemd.c:w64Sub32 Unexecuted instantiation: rsa.c:w64Sub32 Unexecuted instantiation: sha.c:w64Sub32 Unexecuted instantiation: sha256.c:w64Sub32 Unexecuted instantiation: sha3.c:w64Sub32 Unexecuted instantiation: sha512.c:w64Sub32 Unexecuted instantiation: siphash.c:w64Sub32 Unexecuted instantiation: sm2.c:w64Sub32 Unexecuted instantiation: sm3.c:w64Sub32 Unexecuted instantiation: sm4.c:w64Sub32 Unexecuted instantiation: sp_int.c:w64Sub32 Unexecuted instantiation: wc_encrypt.c:w64Sub32 Unexecuted instantiation: wolfmath.c:w64Sub32 Unexecuted instantiation: ssl.c:w64Sub32 Unexecuted instantiation: tls.c:w64Sub32 Unexecuted instantiation: tls13.c:w64Sub32 Unexecuted instantiation: internal.c:w64Sub32 |
825 | | |
826 | | WC_MISC_STATIC WC_INLINE byte w64GT(w64wrapper a, w64wrapper b) |
827 | 0 | { |
828 | 0 | return a.n > b.n; |
829 | 0 | } Unexecuted instantiation: aes.c:w64GT Unexecuted instantiation: asn.c:w64GT Unexecuted instantiation: camellia.c:w64GT Unexecuted instantiation: chacha.c:w64GT Unexecuted instantiation: chacha20_poly1305.c:w64GT Unexecuted instantiation: cmac.c:w64GT Unexecuted instantiation: coding.c:w64GT Unexecuted instantiation: curve25519.c:w64GT Unexecuted instantiation: curve448.c:w64GT Unexecuted instantiation: des3.c:w64GT Unexecuted instantiation: dh.c:w64GT Unexecuted instantiation: ecc.c:w64GT Unexecuted instantiation: eccsi.c:w64GT Unexecuted instantiation: ed25519.c:w64GT Unexecuted instantiation: ed448.c:w64GT Unexecuted instantiation: fe_448.c:w64GT Unexecuted instantiation: fe_operations.c:w64GT Unexecuted instantiation: ge_448.c:w64GT Unexecuted instantiation: ge_operations.c:w64GT Unexecuted instantiation: hash.c:w64GT Unexecuted instantiation: hmac.c:w64GT Unexecuted instantiation: kdf.c:w64GT Unexecuted instantiation: md2.c:w64GT Unexecuted instantiation: md4.c:w64GT Unexecuted instantiation: md5.c:w64GT Unexecuted instantiation: poly1305.c:w64GT Unexecuted instantiation: pwdbased.c:w64GT Unexecuted instantiation: random.c:w64GT Unexecuted instantiation: ripemd.c:w64GT Unexecuted instantiation: rsa.c:w64GT Unexecuted instantiation: sha.c:w64GT Unexecuted instantiation: sha256.c:w64GT Unexecuted instantiation: sha3.c:w64GT Unexecuted instantiation: sha512.c:w64GT Unexecuted instantiation: siphash.c:w64GT Unexecuted instantiation: sm2.c:w64GT Unexecuted instantiation: sm3.c:w64GT Unexecuted instantiation: sm4.c:w64GT Unexecuted instantiation: sp_int.c:w64GT Unexecuted instantiation: wc_encrypt.c:w64GT Unexecuted instantiation: wolfmath.c:w64GT Unexecuted instantiation: ssl.c:w64GT Unexecuted instantiation: tls.c:w64GT Unexecuted instantiation: tls13.c:w64GT Unexecuted instantiation: internal.c:w64GT |
830 | | |
831 | | WC_MISC_STATIC WC_INLINE byte w64IsZero(w64wrapper a) |
832 | 0 | { |
833 | 0 | return a.n == 0; |
834 | 0 | } Unexecuted instantiation: aes.c:w64IsZero Unexecuted instantiation: asn.c:w64IsZero Unexecuted instantiation: camellia.c:w64IsZero Unexecuted instantiation: chacha.c:w64IsZero Unexecuted instantiation: chacha20_poly1305.c:w64IsZero Unexecuted instantiation: cmac.c:w64IsZero Unexecuted instantiation: coding.c:w64IsZero Unexecuted instantiation: curve25519.c:w64IsZero Unexecuted instantiation: curve448.c:w64IsZero Unexecuted instantiation: des3.c:w64IsZero Unexecuted instantiation: dh.c:w64IsZero Unexecuted instantiation: ecc.c:w64IsZero Unexecuted instantiation: eccsi.c:w64IsZero Unexecuted instantiation: ed25519.c:w64IsZero Unexecuted instantiation: ed448.c:w64IsZero Unexecuted instantiation: fe_448.c:w64IsZero Unexecuted instantiation: fe_operations.c:w64IsZero Unexecuted instantiation: ge_448.c:w64IsZero Unexecuted instantiation: ge_operations.c:w64IsZero Unexecuted instantiation: hash.c:w64IsZero Unexecuted instantiation: hmac.c:w64IsZero Unexecuted instantiation: kdf.c:w64IsZero Unexecuted instantiation: md2.c:w64IsZero Unexecuted instantiation: md4.c:w64IsZero Unexecuted instantiation: md5.c:w64IsZero Unexecuted instantiation: poly1305.c:w64IsZero Unexecuted instantiation: pwdbased.c:w64IsZero Unexecuted instantiation: random.c:w64IsZero Unexecuted instantiation: ripemd.c:w64IsZero Unexecuted instantiation: rsa.c:w64IsZero Unexecuted instantiation: sha.c:w64IsZero Unexecuted instantiation: sha256.c:w64IsZero Unexecuted instantiation: sha3.c:w64IsZero Unexecuted instantiation: sha512.c:w64IsZero Unexecuted instantiation: siphash.c:w64IsZero Unexecuted instantiation: sm2.c:w64IsZero Unexecuted instantiation: sm3.c:w64IsZero Unexecuted instantiation: sm4.c:w64IsZero Unexecuted instantiation: sp_int.c:w64IsZero Unexecuted instantiation: wc_encrypt.c:w64IsZero Unexecuted instantiation: wolfmath.c:w64IsZero Unexecuted instantiation: ssl.c:w64IsZero Unexecuted instantiation: tls.c:w64IsZero Unexecuted instantiation: tls13.c:w64IsZero Unexecuted instantiation: internal.c:w64IsZero |
835 | | |
836 | | WC_MISC_STATIC WC_INLINE void c64toa(const w64wrapper *a, byte *out) |
837 | 0 | { |
838 | 0 | #ifdef BIG_ENDIAN_ORDER |
839 | 0 | XMEMCPY(out, &a->n, sizeof(a->n)); |
840 | 0 | #else |
841 | 0 | word64 _out; |
842 | 0 | _out = ByteReverseWord64(a->n); |
843 | 0 | XMEMCPY(out, &_out, sizeof(_out)); |
844 | 0 | #endif /* BIG_ENDIAN_ORDER */ |
845 | 0 | } Unexecuted instantiation: aes.c:c64toa Unexecuted instantiation: asn.c:c64toa Unexecuted instantiation: camellia.c:c64toa Unexecuted instantiation: chacha.c:c64toa Unexecuted instantiation: chacha20_poly1305.c:c64toa Unexecuted instantiation: cmac.c:c64toa Unexecuted instantiation: coding.c:c64toa Unexecuted instantiation: curve25519.c:c64toa Unexecuted instantiation: curve448.c:c64toa Unexecuted instantiation: des3.c:c64toa Unexecuted instantiation: dh.c:c64toa Unexecuted instantiation: ecc.c:c64toa Unexecuted instantiation: eccsi.c:c64toa Unexecuted instantiation: ed25519.c:c64toa Unexecuted instantiation: ed448.c:c64toa Unexecuted instantiation: fe_448.c:c64toa Unexecuted instantiation: fe_operations.c:c64toa Unexecuted instantiation: ge_448.c:c64toa Unexecuted instantiation: ge_operations.c:c64toa Unexecuted instantiation: hash.c:c64toa Unexecuted instantiation: hmac.c:c64toa Unexecuted instantiation: kdf.c:c64toa Unexecuted instantiation: md2.c:c64toa Unexecuted instantiation: md4.c:c64toa Unexecuted instantiation: md5.c:c64toa Unexecuted instantiation: poly1305.c:c64toa Unexecuted instantiation: pwdbased.c:c64toa Unexecuted instantiation: random.c:c64toa Unexecuted instantiation: ripemd.c:c64toa Unexecuted instantiation: rsa.c:c64toa Unexecuted instantiation: sha.c:c64toa Unexecuted instantiation: sha256.c:c64toa Unexecuted instantiation: sha3.c:c64toa Unexecuted instantiation: sha512.c:c64toa Unexecuted instantiation: siphash.c:c64toa Unexecuted instantiation: sm2.c:c64toa Unexecuted instantiation: sm3.c:c64toa Unexecuted instantiation: sm4.c:c64toa Unexecuted instantiation: sp_int.c:c64toa Unexecuted instantiation: wc_encrypt.c:c64toa Unexecuted instantiation: wolfmath.c:c64toa Unexecuted instantiation: ssl.c:c64toa Unexecuted instantiation: tls.c:c64toa Unexecuted instantiation: tls13.c:c64toa Unexecuted instantiation: internal.c:c64toa |
846 | | |
847 | | WC_MISC_STATIC WC_INLINE void ato64(const byte *in, w64wrapper *w64) |
848 | 0 | { |
849 | 0 | #ifdef BIG_ENDIAN_ORDER |
850 | 0 | XMEMCPY(&w64->n, in, sizeof(w64->n)); |
851 | 0 | #else |
852 | 0 | word64 _in; |
853 | 0 | XMEMCPY(&_in, in, sizeof(_in)); |
854 | 0 | w64->n = ByteReverseWord64(_in); |
855 | 0 | #endif /* BIG_ENDIAN_ORDER */ |
856 | 0 | } Unexecuted instantiation: aes.c:ato64 Unexecuted instantiation: asn.c:ato64 Unexecuted instantiation: camellia.c:ato64 Unexecuted instantiation: chacha.c:ato64 Unexecuted instantiation: chacha20_poly1305.c:ato64 Unexecuted instantiation: cmac.c:ato64 Unexecuted instantiation: coding.c:ato64 Unexecuted instantiation: curve25519.c:ato64 Unexecuted instantiation: curve448.c:ato64 Unexecuted instantiation: des3.c:ato64 Unexecuted instantiation: dh.c:ato64 Unexecuted instantiation: ecc.c:ato64 Unexecuted instantiation: eccsi.c:ato64 Unexecuted instantiation: ed25519.c:ato64 Unexecuted instantiation: ed448.c:ato64 Unexecuted instantiation: fe_448.c:ato64 Unexecuted instantiation: fe_operations.c:ato64 Unexecuted instantiation: ge_448.c:ato64 Unexecuted instantiation: ge_operations.c:ato64 Unexecuted instantiation: hash.c:ato64 Unexecuted instantiation: hmac.c:ato64 Unexecuted instantiation: kdf.c:ato64 Unexecuted instantiation: md2.c:ato64 Unexecuted instantiation: md4.c:ato64 Unexecuted instantiation: md5.c:ato64 Unexecuted instantiation: poly1305.c:ato64 Unexecuted instantiation: pwdbased.c:ato64 Unexecuted instantiation: random.c:ato64 Unexecuted instantiation: ripemd.c:ato64 Unexecuted instantiation: rsa.c:ato64 Unexecuted instantiation: sha.c:ato64 Unexecuted instantiation: sha256.c:ato64 Unexecuted instantiation: sha3.c:ato64 Unexecuted instantiation: sha512.c:ato64 Unexecuted instantiation: siphash.c:ato64 Unexecuted instantiation: sm2.c:ato64 Unexecuted instantiation: sm3.c:ato64 Unexecuted instantiation: sm4.c:ato64 Unexecuted instantiation: sp_int.c:ato64 Unexecuted instantiation: wc_encrypt.c:ato64 Unexecuted instantiation: wolfmath.c:ato64 Unexecuted instantiation: ssl.c:ato64 Unexecuted instantiation: tls.c:ato64 Unexecuted instantiation: tls13.c:ato64 Unexecuted instantiation: internal.c:ato64 |
857 | | |
858 | | WC_MISC_STATIC WC_INLINE w64wrapper w64From32(word32 hi, word32 lo) |
859 | 0 | { |
860 | 0 | w64wrapper ret; |
861 | 0 | ret.n = ((word64)hi << 32) | lo; |
862 | 0 | return ret; |
863 | 0 | } Unexecuted instantiation: aes.c:w64From32 Unexecuted instantiation: asn.c:w64From32 Unexecuted instantiation: camellia.c:w64From32 Unexecuted instantiation: chacha.c:w64From32 Unexecuted instantiation: chacha20_poly1305.c:w64From32 Unexecuted instantiation: cmac.c:w64From32 Unexecuted instantiation: coding.c:w64From32 Unexecuted instantiation: curve25519.c:w64From32 Unexecuted instantiation: curve448.c:w64From32 Unexecuted instantiation: des3.c:w64From32 Unexecuted instantiation: dh.c:w64From32 Unexecuted instantiation: ecc.c:w64From32 Unexecuted instantiation: eccsi.c:w64From32 Unexecuted instantiation: ed25519.c:w64From32 Unexecuted instantiation: ed448.c:w64From32 Unexecuted instantiation: fe_448.c:w64From32 Unexecuted instantiation: fe_operations.c:w64From32 Unexecuted instantiation: ge_448.c:w64From32 Unexecuted instantiation: ge_operations.c:w64From32 Unexecuted instantiation: hash.c:w64From32 Unexecuted instantiation: hmac.c:w64From32 Unexecuted instantiation: kdf.c:w64From32 Unexecuted instantiation: md2.c:w64From32 Unexecuted instantiation: md4.c:w64From32 Unexecuted instantiation: md5.c:w64From32 Unexecuted instantiation: poly1305.c:w64From32 Unexecuted instantiation: pwdbased.c:w64From32 Unexecuted instantiation: random.c:w64From32 Unexecuted instantiation: ripemd.c:w64From32 Unexecuted instantiation: rsa.c:w64From32 Unexecuted instantiation: sha.c:w64From32 Unexecuted instantiation: sha256.c:w64From32 Unexecuted instantiation: sha3.c:w64From32 Unexecuted instantiation: sha512.c:w64From32 Unexecuted instantiation: siphash.c:w64From32 Unexecuted instantiation: sm2.c:w64From32 Unexecuted instantiation: sm3.c:w64From32 Unexecuted instantiation: sm4.c:w64From32 Unexecuted instantiation: sp_int.c:w64From32 Unexecuted instantiation: wc_encrypt.c:w64From32 Unexecuted instantiation: wolfmath.c:w64From32 Unexecuted instantiation: ssl.c:w64From32 Unexecuted instantiation: tls.c:w64From32 Unexecuted instantiation: tls13.c:w64From32 Unexecuted instantiation: internal.c:w64From32 |
864 | | |
865 | | WC_MISC_STATIC WC_INLINE byte w64GTE(w64wrapper a, w64wrapper b) |
866 | 0 | { |
867 | 0 | return a.n >= b.n; |
868 | 0 | } Unexecuted instantiation: aes.c:w64GTE Unexecuted instantiation: asn.c:w64GTE Unexecuted instantiation: camellia.c:w64GTE Unexecuted instantiation: chacha.c:w64GTE Unexecuted instantiation: chacha20_poly1305.c:w64GTE Unexecuted instantiation: cmac.c:w64GTE Unexecuted instantiation: coding.c:w64GTE Unexecuted instantiation: curve25519.c:w64GTE Unexecuted instantiation: curve448.c:w64GTE Unexecuted instantiation: des3.c:w64GTE Unexecuted instantiation: dh.c:w64GTE Unexecuted instantiation: ecc.c:w64GTE Unexecuted instantiation: eccsi.c:w64GTE Unexecuted instantiation: ed25519.c:w64GTE Unexecuted instantiation: ed448.c:w64GTE Unexecuted instantiation: fe_448.c:w64GTE Unexecuted instantiation: fe_operations.c:w64GTE Unexecuted instantiation: ge_448.c:w64GTE Unexecuted instantiation: ge_operations.c:w64GTE Unexecuted instantiation: hash.c:w64GTE Unexecuted instantiation: hmac.c:w64GTE Unexecuted instantiation: kdf.c:w64GTE Unexecuted instantiation: md2.c:w64GTE Unexecuted instantiation: md4.c:w64GTE Unexecuted instantiation: md5.c:w64GTE Unexecuted instantiation: poly1305.c:w64GTE Unexecuted instantiation: pwdbased.c:w64GTE Unexecuted instantiation: random.c:w64GTE Unexecuted instantiation: ripemd.c:w64GTE Unexecuted instantiation: rsa.c:w64GTE Unexecuted instantiation: sha.c:w64GTE Unexecuted instantiation: sha256.c:w64GTE Unexecuted instantiation: sha3.c:w64GTE Unexecuted instantiation: sha512.c:w64GTE Unexecuted instantiation: siphash.c:w64GTE Unexecuted instantiation: sm2.c:w64GTE Unexecuted instantiation: sm3.c:w64GTE Unexecuted instantiation: sm4.c:w64GTE Unexecuted instantiation: sp_int.c:w64GTE Unexecuted instantiation: wc_encrypt.c:w64GTE Unexecuted instantiation: wolfmath.c:w64GTE Unexecuted instantiation: ssl.c:w64GTE Unexecuted instantiation: tls.c:w64GTE Unexecuted instantiation: tls13.c:w64GTE Unexecuted instantiation: internal.c:w64GTE |
869 | | |
870 | | WC_MISC_STATIC WC_INLINE byte w64LT(w64wrapper a, w64wrapper b) |
871 | 0 | { |
872 | 0 | return a.n < b.n; |
873 | 0 | } Unexecuted instantiation: aes.c:w64LT Unexecuted instantiation: asn.c:w64LT Unexecuted instantiation: camellia.c:w64LT Unexecuted instantiation: chacha.c:w64LT Unexecuted instantiation: chacha20_poly1305.c:w64LT Unexecuted instantiation: cmac.c:w64LT Unexecuted instantiation: coding.c:w64LT Unexecuted instantiation: curve25519.c:w64LT Unexecuted instantiation: curve448.c:w64LT Unexecuted instantiation: des3.c:w64LT Unexecuted instantiation: dh.c:w64LT Unexecuted instantiation: ecc.c:w64LT Unexecuted instantiation: eccsi.c:w64LT Unexecuted instantiation: ed25519.c:w64LT Unexecuted instantiation: ed448.c:w64LT Unexecuted instantiation: fe_448.c:w64LT Unexecuted instantiation: fe_operations.c:w64LT Unexecuted instantiation: ge_448.c:w64LT Unexecuted instantiation: ge_operations.c:w64LT Unexecuted instantiation: hash.c:w64LT Unexecuted instantiation: hmac.c:w64LT Unexecuted instantiation: kdf.c:w64LT Unexecuted instantiation: md2.c:w64LT Unexecuted instantiation: md4.c:w64LT Unexecuted instantiation: md5.c:w64LT Unexecuted instantiation: poly1305.c:w64LT Unexecuted instantiation: pwdbased.c:w64LT Unexecuted instantiation: random.c:w64LT Unexecuted instantiation: ripemd.c:w64LT Unexecuted instantiation: rsa.c:w64LT Unexecuted instantiation: sha.c:w64LT Unexecuted instantiation: sha256.c:w64LT Unexecuted instantiation: sha3.c:w64LT Unexecuted instantiation: sha512.c:w64LT Unexecuted instantiation: siphash.c:w64LT Unexecuted instantiation: sm2.c:w64LT Unexecuted instantiation: sm3.c:w64LT Unexecuted instantiation: sm4.c:w64LT Unexecuted instantiation: sp_int.c:w64LT Unexecuted instantiation: wc_encrypt.c:w64LT Unexecuted instantiation: wolfmath.c:w64LT Unexecuted instantiation: ssl.c:w64LT Unexecuted instantiation: tls.c:w64LT Unexecuted instantiation: tls13.c:w64LT Unexecuted instantiation: internal.c:w64LT |
874 | | |
875 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Sub(w64wrapper a, w64wrapper b) |
876 | 0 | { |
877 | 0 | a.n -= b.n; |
878 | 0 | return a; |
879 | 0 | } Unexecuted instantiation: aes.c:w64Sub Unexecuted instantiation: asn.c:w64Sub Unexecuted instantiation: camellia.c:w64Sub Unexecuted instantiation: chacha.c:w64Sub Unexecuted instantiation: chacha20_poly1305.c:w64Sub Unexecuted instantiation: cmac.c:w64Sub Unexecuted instantiation: coding.c:w64Sub Unexecuted instantiation: curve25519.c:w64Sub Unexecuted instantiation: curve448.c:w64Sub Unexecuted instantiation: des3.c:w64Sub Unexecuted instantiation: dh.c:w64Sub Unexecuted instantiation: ecc.c:w64Sub Unexecuted instantiation: eccsi.c:w64Sub Unexecuted instantiation: ed25519.c:w64Sub Unexecuted instantiation: ed448.c:w64Sub Unexecuted instantiation: fe_448.c:w64Sub Unexecuted instantiation: fe_operations.c:w64Sub Unexecuted instantiation: ge_448.c:w64Sub Unexecuted instantiation: ge_operations.c:w64Sub Unexecuted instantiation: hash.c:w64Sub Unexecuted instantiation: hmac.c:w64Sub Unexecuted instantiation: kdf.c:w64Sub Unexecuted instantiation: md2.c:w64Sub Unexecuted instantiation: md4.c:w64Sub Unexecuted instantiation: md5.c:w64Sub Unexecuted instantiation: poly1305.c:w64Sub Unexecuted instantiation: pwdbased.c:w64Sub Unexecuted instantiation: random.c:w64Sub Unexecuted instantiation: ripemd.c:w64Sub Unexecuted instantiation: rsa.c:w64Sub Unexecuted instantiation: sha.c:w64Sub Unexecuted instantiation: sha256.c:w64Sub Unexecuted instantiation: sha3.c:w64Sub Unexecuted instantiation: sha512.c:w64Sub Unexecuted instantiation: siphash.c:w64Sub Unexecuted instantiation: sm2.c:w64Sub Unexecuted instantiation: sm3.c:w64Sub Unexecuted instantiation: sm4.c:w64Sub Unexecuted instantiation: sp_int.c:w64Sub Unexecuted instantiation: wc_encrypt.c:w64Sub Unexecuted instantiation: wolfmath.c:w64Sub Unexecuted instantiation: ssl.c:w64Sub Unexecuted instantiation: tls.c:w64Sub Unexecuted instantiation: tls13.c:w64Sub Unexecuted instantiation: internal.c:w64Sub |
880 | | |
881 | | WC_MISC_STATIC WC_INLINE void w64Zero(w64wrapper *a) |
882 | 0 | { |
883 | 0 | a->n = 0; |
884 | 0 | } Unexecuted instantiation: aes.c:w64Zero Unexecuted instantiation: asn.c:w64Zero Unexecuted instantiation: camellia.c:w64Zero Unexecuted instantiation: chacha.c:w64Zero Unexecuted instantiation: chacha20_poly1305.c:w64Zero Unexecuted instantiation: cmac.c:w64Zero Unexecuted instantiation: coding.c:w64Zero Unexecuted instantiation: curve25519.c:w64Zero Unexecuted instantiation: curve448.c:w64Zero Unexecuted instantiation: des3.c:w64Zero Unexecuted instantiation: dh.c:w64Zero Unexecuted instantiation: ecc.c:w64Zero Unexecuted instantiation: eccsi.c:w64Zero Unexecuted instantiation: ed25519.c:w64Zero Unexecuted instantiation: ed448.c:w64Zero Unexecuted instantiation: fe_448.c:w64Zero Unexecuted instantiation: fe_operations.c:w64Zero Unexecuted instantiation: ge_448.c:w64Zero Unexecuted instantiation: ge_operations.c:w64Zero Unexecuted instantiation: hash.c:w64Zero Unexecuted instantiation: hmac.c:w64Zero Unexecuted instantiation: kdf.c:w64Zero Unexecuted instantiation: md2.c:w64Zero Unexecuted instantiation: md4.c:w64Zero Unexecuted instantiation: md5.c:w64Zero Unexecuted instantiation: poly1305.c:w64Zero Unexecuted instantiation: pwdbased.c:w64Zero Unexecuted instantiation: random.c:w64Zero Unexecuted instantiation: ripemd.c:w64Zero Unexecuted instantiation: rsa.c:w64Zero Unexecuted instantiation: sha.c:w64Zero Unexecuted instantiation: sha256.c:w64Zero Unexecuted instantiation: sha3.c:w64Zero Unexecuted instantiation: sha512.c:w64Zero Unexecuted instantiation: siphash.c:w64Zero Unexecuted instantiation: sm2.c:w64Zero Unexecuted instantiation: sm3.c:w64Zero Unexecuted instantiation: sm4.c:w64Zero Unexecuted instantiation: sp_int.c:w64Zero Unexecuted instantiation: wc_encrypt.c:w64Zero Unexecuted instantiation: wolfmath.c:w64Zero Unexecuted instantiation: ssl.c:w64Zero Unexecuted instantiation: tls.c:w64Zero Unexecuted instantiation: tls13.c:w64Zero Unexecuted instantiation: internal.c:w64Zero |
885 | | |
886 | | WC_MISC_STATIC WC_INLINE w64wrapper w64ShiftRight(w64wrapper a, int shift) |
887 | 0 | { |
888 | 0 | a.n >>= shift; |
889 | 0 | return a; |
890 | 0 | } Unexecuted instantiation: aes.c:w64ShiftRight Unexecuted instantiation: asn.c:w64ShiftRight Unexecuted instantiation: camellia.c:w64ShiftRight Unexecuted instantiation: chacha.c:w64ShiftRight Unexecuted instantiation: chacha20_poly1305.c:w64ShiftRight Unexecuted instantiation: cmac.c:w64ShiftRight Unexecuted instantiation: coding.c:w64ShiftRight Unexecuted instantiation: curve25519.c:w64ShiftRight Unexecuted instantiation: curve448.c:w64ShiftRight Unexecuted instantiation: des3.c:w64ShiftRight Unexecuted instantiation: dh.c:w64ShiftRight Unexecuted instantiation: ecc.c:w64ShiftRight Unexecuted instantiation: eccsi.c:w64ShiftRight Unexecuted instantiation: ed25519.c:w64ShiftRight Unexecuted instantiation: ed448.c:w64ShiftRight Unexecuted instantiation: fe_448.c:w64ShiftRight Unexecuted instantiation: fe_operations.c:w64ShiftRight Unexecuted instantiation: ge_448.c:w64ShiftRight Unexecuted instantiation: ge_operations.c:w64ShiftRight Unexecuted instantiation: hash.c:w64ShiftRight Unexecuted instantiation: hmac.c:w64ShiftRight Unexecuted instantiation: kdf.c:w64ShiftRight Unexecuted instantiation: md2.c:w64ShiftRight Unexecuted instantiation: md4.c:w64ShiftRight Unexecuted instantiation: md5.c:w64ShiftRight Unexecuted instantiation: poly1305.c:w64ShiftRight Unexecuted instantiation: pwdbased.c:w64ShiftRight Unexecuted instantiation: random.c:w64ShiftRight Unexecuted instantiation: ripemd.c:w64ShiftRight Unexecuted instantiation: rsa.c:w64ShiftRight Unexecuted instantiation: sha.c:w64ShiftRight Unexecuted instantiation: sha256.c:w64ShiftRight Unexecuted instantiation: sha3.c:w64ShiftRight Unexecuted instantiation: sha512.c:w64ShiftRight Unexecuted instantiation: siphash.c:w64ShiftRight Unexecuted instantiation: sm2.c:w64ShiftRight Unexecuted instantiation: sm3.c:w64ShiftRight Unexecuted instantiation: sm4.c:w64ShiftRight Unexecuted instantiation: sp_int.c:w64ShiftRight Unexecuted instantiation: wc_encrypt.c:w64ShiftRight Unexecuted instantiation: wolfmath.c:w64ShiftRight Unexecuted instantiation: ssl.c:w64ShiftRight Unexecuted instantiation: tls.c:w64ShiftRight Unexecuted instantiation: tls13.c:w64ShiftRight Unexecuted instantiation: internal.c:w64ShiftRight |
891 | | |
892 | | WC_MISC_STATIC WC_INLINE w64wrapper w64ShiftLeft(w64wrapper a, int shift) |
893 | 0 | { |
894 | 0 | a.n <<= shift; |
895 | 0 | return a; |
896 | 0 | } Unexecuted instantiation: aes.c:w64ShiftLeft Unexecuted instantiation: asn.c:w64ShiftLeft Unexecuted instantiation: camellia.c:w64ShiftLeft Unexecuted instantiation: chacha.c:w64ShiftLeft Unexecuted instantiation: chacha20_poly1305.c:w64ShiftLeft Unexecuted instantiation: cmac.c:w64ShiftLeft Unexecuted instantiation: coding.c:w64ShiftLeft Unexecuted instantiation: curve25519.c:w64ShiftLeft Unexecuted instantiation: curve448.c:w64ShiftLeft Unexecuted instantiation: des3.c:w64ShiftLeft Unexecuted instantiation: dh.c:w64ShiftLeft Unexecuted instantiation: ecc.c:w64ShiftLeft Unexecuted instantiation: eccsi.c:w64ShiftLeft Unexecuted instantiation: ed25519.c:w64ShiftLeft Unexecuted instantiation: ed448.c:w64ShiftLeft Unexecuted instantiation: fe_448.c:w64ShiftLeft Unexecuted instantiation: fe_operations.c:w64ShiftLeft Unexecuted instantiation: ge_448.c:w64ShiftLeft Unexecuted instantiation: ge_operations.c:w64ShiftLeft Unexecuted instantiation: hash.c:w64ShiftLeft Unexecuted instantiation: hmac.c:w64ShiftLeft Unexecuted instantiation: kdf.c:w64ShiftLeft Unexecuted instantiation: md2.c:w64ShiftLeft Unexecuted instantiation: md4.c:w64ShiftLeft Unexecuted instantiation: md5.c:w64ShiftLeft Unexecuted instantiation: poly1305.c:w64ShiftLeft Unexecuted instantiation: pwdbased.c:w64ShiftLeft Unexecuted instantiation: random.c:w64ShiftLeft Unexecuted instantiation: ripemd.c:w64ShiftLeft Unexecuted instantiation: rsa.c:w64ShiftLeft Unexecuted instantiation: sha.c:w64ShiftLeft Unexecuted instantiation: sha256.c:w64ShiftLeft Unexecuted instantiation: sha3.c:w64ShiftLeft Unexecuted instantiation: sha512.c:w64ShiftLeft Unexecuted instantiation: siphash.c:w64ShiftLeft Unexecuted instantiation: sm2.c:w64ShiftLeft Unexecuted instantiation: sm3.c:w64ShiftLeft Unexecuted instantiation: sm4.c:w64ShiftLeft Unexecuted instantiation: sp_int.c:w64ShiftLeft Unexecuted instantiation: wc_encrypt.c:w64ShiftLeft Unexecuted instantiation: wolfmath.c:w64ShiftLeft Unexecuted instantiation: ssl.c:w64ShiftLeft Unexecuted instantiation: tls.c:w64ShiftLeft Unexecuted instantiation: tls13.c:w64ShiftLeft Unexecuted instantiation: internal.c:w64ShiftLeft |
897 | | |
898 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Mul(word32 a, word32 b) |
899 | 0 | { |
900 | 0 | w64wrapper ret; |
901 | 0 | ret.n = (word64)a * (word64)b; |
902 | 0 | return ret; |
903 | 0 | } Unexecuted instantiation: aes.c:w64Mul Unexecuted instantiation: asn.c:w64Mul Unexecuted instantiation: camellia.c:w64Mul Unexecuted instantiation: chacha.c:w64Mul Unexecuted instantiation: chacha20_poly1305.c:w64Mul Unexecuted instantiation: cmac.c:w64Mul Unexecuted instantiation: coding.c:w64Mul Unexecuted instantiation: curve25519.c:w64Mul Unexecuted instantiation: curve448.c:w64Mul Unexecuted instantiation: des3.c:w64Mul Unexecuted instantiation: dh.c:w64Mul Unexecuted instantiation: ecc.c:w64Mul Unexecuted instantiation: eccsi.c:w64Mul Unexecuted instantiation: ed25519.c:w64Mul Unexecuted instantiation: ed448.c:w64Mul Unexecuted instantiation: fe_448.c:w64Mul Unexecuted instantiation: fe_operations.c:w64Mul Unexecuted instantiation: ge_448.c:w64Mul Unexecuted instantiation: ge_operations.c:w64Mul Unexecuted instantiation: hash.c:w64Mul Unexecuted instantiation: hmac.c:w64Mul Unexecuted instantiation: kdf.c:w64Mul Unexecuted instantiation: md2.c:w64Mul Unexecuted instantiation: md4.c:w64Mul Unexecuted instantiation: md5.c:w64Mul Unexecuted instantiation: poly1305.c:w64Mul Unexecuted instantiation: pwdbased.c:w64Mul Unexecuted instantiation: random.c:w64Mul Unexecuted instantiation: ripemd.c:w64Mul Unexecuted instantiation: rsa.c:w64Mul Unexecuted instantiation: sha.c:w64Mul Unexecuted instantiation: sha256.c:w64Mul Unexecuted instantiation: sha3.c:w64Mul Unexecuted instantiation: sha512.c:w64Mul Unexecuted instantiation: siphash.c:w64Mul Unexecuted instantiation: sm2.c:w64Mul Unexecuted instantiation: sm3.c:w64Mul Unexecuted instantiation: sm4.c:w64Mul Unexecuted instantiation: sp_int.c:w64Mul Unexecuted instantiation: wc_encrypt.c:w64Mul Unexecuted instantiation: wolfmath.c:w64Mul Unexecuted instantiation: ssl.c:w64Mul Unexecuted instantiation: tls.c:w64Mul Unexecuted instantiation: tls13.c:w64Mul Unexecuted instantiation: internal.c:w64Mul |
904 | | |
905 | | #else |
906 | | |
907 | | WC_MISC_STATIC WC_INLINE void w64Increment(w64wrapper *n) |
908 | | { |
909 | | n->n[1]++; |
910 | | if (n->n[1] == 0) |
911 | | n->n[0]++; |
912 | | } |
913 | | |
914 | | WC_MISC_STATIC WC_INLINE void w64Decrement(w64wrapper *n) { |
915 | | if (n->n[1] == 0) |
916 | | n->n[0]--; |
917 | | n->n[1]--; |
918 | | } |
919 | | |
920 | | WC_MISC_STATIC WC_INLINE byte w64Equal(w64wrapper a, w64wrapper b) |
921 | | { |
922 | | return (a.n[0] == b.n[0] && a.n[1] == b.n[1]); |
923 | | } |
924 | | |
925 | | WC_MISC_STATIC WC_INLINE word32 w64GetLow32(w64wrapper n) { |
926 | | return n.n[1]; |
927 | | } |
928 | | |
929 | | WC_MISC_STATIC WC_INLINE word32 w64GetHigh32(w64wrapper n) { |
930 | | return n.n[0]; |
931 | | } |
932 | | |
933 | | WC_MISC_STATIC WC_INLINE void w64SetLow32(w64wrapper *n, word32 low) |
934 | | { |
935 | | n->n[1] = low; |
936 | | } |
937 | | |
938 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Add32(w64wrapper a, word32 b, byte *wrap) |
939 | | { |
940 | | a.n[1] += b; |
941 | | if (a.n[1] < b) { |
942 | | a.n[0]++; |
943 | | if (wrap != NULL && a.n[0] == 0) |
944 | | *wrap = 1; |
945 | | } |
946 | | |
947 | | return a; |
948 | | } |
949 | | |
950 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Add(w64wrapper a, w64wrapper b, |
951 | | byte *wrap) |
952 | | { |
953 | | a.n[1] += b.n[1]; |
954 | | if (a.n[1] < b.n[1]) { |
955 | | a.n[0]++; |
956 | | if (wrap != NULL && a.n[0] == 0) |
957 | | *wrap = 1; |
958 | | } |
959 | | |
960 | | a.n[0] += b.n[0]; |
961 | | if (wrap != NULL && a.n[0] < b.n[0]) { |
962 | | *wrap = 1; |
963 | | } |
964 | | |
965 | | return a; |
966 | | } |
967 | | |
968 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Sub32(w64wrapper a, word32 b, byte *wrap) |
969 | | { |
970 | | byte _underflow = 0; |
971 | | if (a.n[1] < b) |
972 | | _underflow = 1; |
973 | | |
974 | | a.n[1] -= b; |
975 | | if (_underflow) { |
976 | | if (a.n[0] == 0 && wrap != NULL) |
977 | | *wrap = 1; |
978 | | a.n[0]--; |
979 | | } |
980 | | |
981 | | return a; |
982 | | } |
983 | | |
984 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Sub(w64wrapper a, w64wrapper b) |
985 | | { |
986 | | if (a.n[1] < b.n[1]) |
987 | | a.n[0]--; |
988 | | a.n[1] -= b.n[1]; |
989 | | a.n[0] -= b.n[0]; |
990 | | return a; |
991 | | } |
992 | | |
993 | | WC_MISC_STATIC WC_INLINE void w64Zero(w64wrapper *a) |
994 | | { |
995 | | a->n[0] = a->n[1] = 0; |
996 | | } |
997 | | |
998 | | WC_MISC_STATIC WC_INLINE byte w64GT(w64wrapper a, w64wrapper b) |
999 | | { |
1000 | | if (a.n[0] > b.n[0]) |
1001 | | return 1; |
1002 | | if (a.n[0] == b.n[0]) |
1003 | | return a.n[1] > b.n[1]; |
1004 | | return 0; |
1005 | | } |
1006 | | |
1007 | | WC_MISC_STATIC WC_INLINE byte w64GTE(w64wrapper a, w64wrapper b) |
1008 | | { |
1009 | | if (a.n[0] > b.n[0]) |
1010 | | return 1; |
1011 | | if (a.n[0] == b.n[0]) |
1012 | | return a.n[1] >= b.n[1]; |
1013 | | return 0; |
1014 | | } |
1015 | | |
1016 | | WC_MISC_STATIC WC_INLINE byte w64IsZero(w64wrapper a) |
1017 | | { |
1018 | | return a.n[0] == 0 && a.n[1] == 0; |
1019 | | } |
1020 | | |
1021 | | WC_MISC_STATIC WC_INLINE void c64toa(const w64wrapper *a, byte *out) |
1022 | | { |
1023 | | #ifdef BIG_ENDIAN_ORDER |
1024 | | word32 *_out = (word32*)(out); |
1025 | | _out[0] = a->n[0]; |
1026 | | _out[1] = a->n[1]; |
1027 | | #else |
1028 | | c32toa(a->n[0], out); |
1029 | | c32toa(a->n[1], out + 4); |
1030 | | #endif /* BIG_ENDIAN_ORDER */ |
1031 | | } |
1032 | | |
1033 | | WC_MISC_STATIC WC_INLINE void ato64(const byte *in, w64wrapper *w64) |
1034 | | { |
1035 | | #ifdef BIG_ENDIAN_ORDER |
1036 | | const word32 *_in = (const word32*)(in); |
1037 | | w64->n[0] = *_in; |
1038 | | w64->n[1] = *(_in + 1); |
1039 | | #else |
1040 | | ato32(in, &w64->n[0]); |
1041 | | ato32(in + 4, &w64->n[1]); |
1042 | | #endif /* BIG_ENDIAN_ORDER */ |
1043 | | } |
1044 | | |
1045 | | WC_MISC_STATIC WC_INLINE w64wrapper w64From32(word32 hi, word32 lo) |
1046 | | { |
1047 | | w64wrapper w64; |
1048 | | w64.n[0] = hi; |
1049 | | w64.n[1] = lo; |
1050 | | return w64; |
1051 | | } |
1052 | | |
1053 | | WC_MISC_STATIC WC_INLINE byte w64LT(w64wrapper a, w64wrapper b) |
1054 | | { |
1055 | | if (a.n[0] < b.n[0]) |
1056 | | return 1; |
1057 | | if (a.n[0] == b.n[0]) |
1058 | | return a.n[1] < b.n[1]; |
1059 | | |
1060 | | return 0; |
1061 | | } |
1062 | | |
1063 | | WC_MISC_STATIC WC_INLINE w64wrapper w64ShiftRight(w64wrapper a, int shift) |
1064 | | { |
1065 | | if (shift < 32) { |
1066 | | a.n[1] = (a.n[1] >> shift) | (a.n[0] << (32 - shift)); |
1067 | | a.n[0] >>= shift; |
1068 | | } |
1069 | | else { |
1070 | | a.n[1] = a.n[0] >> (shift - 32); |
1071 | | a.n[0] = 0; |
1072 | | } |
1073 | | return a; |
1074 | | } |
1075 | | WC_MISC_STATIC WC_INLINE w64wrapper w64ShiftLeft(w64wrapper a, int shift) |
1076 | | { |
1077 | | if (shift < 32) { |
1078 | | a.n[0] = (a.n[0] << shift) | (a.n[1] >> (32 - shift)); |
1079 | | a.n[1] <<= shift; |
1080 | | } |
1081 | | else { |
1082 | | a.n[0] = a.n[1] << (shift - 32); |
1083 | | a.n[1] = 0; |
1084 | | } |
1085 | | return a; |
1086 | | } |
1087 | | |
1088 | | WC_MISC_STATIC WC_INLINE w64wrapper w64Mul(word32 a, word32 b) |
1089 | | { |
1090 | | w64wrapper ret; |
1091 | | word16 ltlA, ltlB, ltlC, ltlD; |
1092 | | word32 bigA, bigB, bigC, bigD; |
1093 | | |
1094 | | ltlA = a & 0xFFFF; |
1095 | | ltlB = (a >> 16) & 0xFFFF; |
1096 | | ltlC = b & 0xFFFF; |
1097 | | ltlD = (b >> 16) & 0xFFFF; |
1098 | | |
1099 | | bigA = (word32)ltlA * (word32)ltlC; |
1100 | | bigC = (word32)ltlB * (word32)ltlC; |
1101 | | bigD = (word32)ltlA * (word32)ltlD; |
1102 | | bigB = (word32)ltlB * (word32)ltlD; |
1103 | | |
1104 | | ret = w64From32(0, bigB); |
1105 | | ret = w64ShiftLeft(ret, 16); |
1106 | | ret = w64Add32(ret, bigD, NULL); |
1107 | | ret = w64Add32(ret, bigC, NULL); |
1108 | | ret = w64ShiftLeft(ret, 16); |
1109 | | return w64Add32(ret, bigA, NULL); |
1110 | | } |
1111 | | |
1112 | | #endif /* WORD64_AVAILABLE && !WOLFSSL_W64_WRAPPER_TEST */ |
1113 | | #endif /* WOLFSSL_W64_WRAPPER */ |
1114 | | |
1115 | | #if defined(HAVE_SESSION_TICKET) || !defined(NO_CERTS) || \ |
1116 | | !defined(NO_SESSION_CACHE) |
1117 | | /* Make a word from the front of random hash */ |
1118 | | WC_MISC_STATIC WC_INLINE word32 MakeWordFromHash(const byte* hashID) |
1119 | 0 | { |
1120 | 0 | return ((word32)hashID[0] << 24) | ((word32)hashID[1] << 16) | |
1121 | 0 | ((word32)hashID[2] << 8) | (word32)hashID[3]; |
1122 | 0 | } Unexecuted instantiation: aes.c:MakeWordFromHash Unexecuted instantiation: asn.c:MakeWordFromHash Unexecuted instantiation: camellia.c:MakeWordFromHash Unexecuted instantiation: chacha.c:MakeWordFromHash Unexecuted instantiation: chacha20_poly1305.c:MakeWordFromHash Unexecuted instantiation: cmac.c:MakeWordFromHash Unexecuted instantiation: coding.c:MakeWordFromHash Unexecuted instantiation: curve25519.c:MakeWordFromHash Unexecuted instantiation: curve448.c:MakeWordFromHash Unexecuted instantiation: des3.c:MakeWordFromHash Unexecuted instantiation: dh.c:MakeWordFromHash Unexecuted instantiation: ecc.c:MakeWordFromHash Unexecuted instantiation: eccsi.c:MakeWordFromHash Unexecuted instantiation: ed25519.c:MakeWordFromHash Unexecuted instantiation: ed448.c:MakeWordFromHash Unexecuted instantiation: fe_448.c:MakeWordFromHash Unexecuted instantiation: fe_operations.c:MakeWordFromHash Unexecuted instantiation: ge_448.c:MakeWordFromHash Unexecuted instantiation: ge_operations.c:MakeWordFromHash Unexecuted instantiation: hash.c:MakeWordFromHash Unexecuted instantiation: hmac.c:MakeWordFromHash Unexecuted instantiation: kdf.c:MakeWordFromHash Unexecuted instantiation: md2.c:MakeWordFromHash Unexecuted instantiation: md4.c:MakeWordFromHash Unexecuted instantiation: md5.c:MakeWordFromHash Unexecuted instantiation: poly1305.c:MakeWordFromHash Unexecuted instantiation: pwdbased.c:MakeWordFromHash Unexecuted instantiation: random.c:MakeWordFromHash Unexecuted instantiation: ripemd.c:MakeWordFromHash Unexecuted instantiation: rsa.c:MakeWordFromHash Unexecuted instantiation: sha.c:MakeWordFromHash Unexecuted instantiation: sha256.c:MakeWordFromHash Unexecuted instantiation: sha3.c:MakeWordFromHash Unexecuted instantiation: sha512.c:MakeWordFromHash Unexecuted instantiation: siphash.c:MakeWordFromHash Unexecuted instantiation: sm2.c:MakeWordFromHash Unexecuted instantiation: sm3.c:MakeWordFromHash Unexecuted instantiation: sm4.c:MakeWordFromHash Unexecuted instantiation: sp_int.c:MakeWordFromHash Unexecuted instantiation: wc_encrypt.c:MakeWordFromHash Unexecuted instantiation: wolfmath.c:MakeWordFromHash Unexecuted instantiation: ssl.c:MakeWordFromHash Unexecuted instantiation: tls.c:MakeWordFromHash Unexecuted instantiation: tls13.c:MakeWordFromHash Unexecuted instantiation: internal.c:MakeWordFromHash |
1123 | | #endif /* HAVE_SESSION_TICKET || !NO_CERTS || !NO_SESSION_CACHE */ |
1124 | | |
1125 | | |
1126 | | #if !defined(WOLFCRYPT_ONLY) && !defined(NO_HASH_WRAPPER) && \ |
1127 | | (!defined(NO_SESSION_CACHE) || defined(HAVE_SESSION_TICKET)) |
1128 | | |
1129 | | #include <wolfssl/wolfcrypt/hash.h> |
1130 | | |
1131 | | /* some session IDs aren't random after all, let's make them random */ |
1132 | | WC_MISC_STATIC WC_INLINE word32 HashObject(const byte* o, word32 len, |
1133 | | int* error) |
1134 | 0 | { |
1135 | 0 | byte digest[WC_MAX_DIGEST_SIZE]; |
1136 | |
|
1137 | 0 | #ifndef NO_MD5 |
1138 | 0 | *error = wc_Md5Hash(o, len, digest); |
1139 | | #elif !defined(NO_SHA) |
1140 | | *error = wc_ShaHash(o, len, digest); |
1141 | | #elif !defined(NO_SHA256) |
1142 | | *error = wc_Sha256Hash(o, len, digest); |
1143 | | #else |
1144 | | #error "We need a digest to hash the session IDs" |
1145 | | #endif |
1146 | |
|
1147 | 0 | return *error == 0 ? MakeWordFromHash(digest) : 0; /* 0 on failure */ |
1148 | 0 | } Unexecuted instantiation: aes.c:HashObject Unexecuted instantiation: asn.c:HashObject Unexecuted instantiation: camellia.c:HashObject Unexecuted instantiation: chacha.c:HashObject Unexecuted instantiation: chacha20_poly1305.c:HashObject Unexecuted instantiation: cmac.c:HashObject Unexecuted instantiation: coding.c:HashObject Unexecuted instantiation: curve25519.c:HashObject Unexecuted instantiation: curve448.c:HashObject Unexecuted instantiation: des3.c:HashObject Unexecuted instantiation: dh.c:HashObject Unexecuted instantiation: ecc.c:HashObject Unexecuted instantiation: eccsi.c:HashObject Unexecuted instantiation: ed25519.c:HashObject Unexecuted instantiation: ed448.c:HashObject Unexecuted instantiation: fe_448.c:HashObject Unexecuted instantiation: fe_operations.c:HashObject Unexecuted instantiation: ge_448.c:HashObject Unexecuted instantiation: ge_operations.c:HashObject Unexecuted instantiation: hash.c:HashObject Unexecuted instantiation: hmac.c:HashObject Unexecuted instantiation: kdf.c:HashObject Unexecuted instantiation: md2.c:HashObject Unexecuted instantiation: md4.c:HashObject Unexecuted instantiation: md5.c:HashObject Unexecuted instantiation: poly1305.c:HashObject Unexecuted instantiation: pwdbased.c:HashObject Unexecuted instantiation: random.c:HashObject Unexecuted instantiation: ripemd.c:HashObject Unexecuted instantiation: rsa.c:HashObject Unexecuted instantiation: sha.c:HashObject Unexecuted instantiation: sha256.c:HashObject Unexecuted instantiation: sha3.c:HashObject Unexecuted instantiation: sha512.c:HashObject Unexecuted instantiation: siphash.c:HashObject Unexecuted instantiation: sm2.c:HashObject Unexecuted instantiation: sm3.c:HashObject Unexecuted instantiation: sm4.c:HashObject Unexecuted instantiation: sp_int.c:HashObject Unexecuted instantiation: wc_encrypt.c:HashObject Unexecuted instantiation: wolfmath.c:HashObject Unexecuted instantiation: ssl.c:HashObject Unexecuted instantiation: tls.c:HashObject Unexecuted instantiation: tls13.c:HashObject Unexecuted instantiation: internal.c:HashObject |
1149 | | #endif /* WOLFCRYPT_ONLY && !NO_HASH_WRAPPER && |
1150 | | * (!NO_SESSION_CACHE || HAVE_SESSION_TICKET) */ |
1151 | | |
1152 | | WC_MISC_STATIC WC_INLINE char* CopyString(const char* src, int srcLen, |
1153 | 0 | void* heap, int type) { |
1154 | 0 | char* dst = NULL; |
1155 | |
|
1156 | 0 | if (src == NULL) |
1157 | 0 | return NULL; |
1158 | | |
1159 | 0 | if (srcLen <= 0) |
1160 | 0 | srcLen = (int)XSTRLEN(src); |
1161 | |
|
1162 | 0 | dst = (char*)XMALLOC((size_t)srcLen + 1, heap, type); |
1163 | 0 | if (dst != NULL) { |
1164 | 0 | XMEMCPY(dst, src, (size_t)srcLen); |
1165 | 0 | dst[srcLen] = '\0'; |
1166 | 0 | } |
1167 | |
|
1168 | 0 | return dst; |
1169 | 0 | } Unexecuted instantiation: aes.c:CopyString Unexecuted instantiation: asn.c:CopyString Unexecuted instantiation: camellia.c:CopyString Unexecuted instantiation: chacha.c:CopyString Unexecuted instantiation: chacha20_poly1305.c:CopyString Unexecuted instantiation: cmac.c:CopyString Unexecuted instantiation: coding.c:CopyString Unexecuted instantiation: curve25519.c:CopyString Unexecuted instantiation: curve448.c:CopyString Unexecuted instantiation: des3.c:CopyString Unexecuted instantiation: dh.c:CopyString Unexecuted instantiation: ecc.c:CopyString Unexecuted instantiation: eccsi.c:CopyString Unexecuted instantiation: ed25519.c:CopyString Unexecuted instantiation: ed448.c:CopyString Unexecuted instantiation: fe_448.c:CopyString Unexecuted instantiation: fe_operations.c:CopyString Unexecuted instantiation: ge_448.c:CopyString Unexecuted instantiation: ge_operations.c:CopyString Unexecuted instantiation: hash.c:CopyString Unexecuted instantiation: hmac.c:CopyString Unexecuted instantiation: kdf.c:CopyString Unexecuted instantiation: md2.c:CopyString Unexecuted instantiation: md4.c:CopyString Unexecuted instantiation: md5.c:CopyString Unexecuted instantiation: poly1305.c:CopyString Unexecuted instantiation: pwdbased.c:CopyString Unexecuted instantiation: random.c:CopyString Unexecuted instantiation: ripemd.c:CopyString Unexecuted instantiation: rsa.c:CopyString Unexecuted instantiation: sha.c:CopyString Unexecuted instantiation: sha256.c:CopyString Unexecuted instantiation: sha3.c:CopyString Unexecuted instantiation: sha512.c:CopyString Unexecuted instantiation: siphash.c:CopyString Unexecuted instantiation: sm2.c:CopyString Unexecuted instantiation: sm3.c:CopyString Unexecuted instantiation: sm4.c:CopyString Unexecuted instantiation: sp_int.c:CopyString Unexecuted instantiation: wc_encrypt.c:CopyString Unexecuted instantiation: wolfmath.c:CopyString Unexecuted instantiation: ssl.c:CopyString Unexecuted instantiation: tls.c:CopyString Unexecuted instantiation: tls13.c:CopyString Unexecuted instantiation: internal.c:CopyString |
1170 | | |
1171 | | #endif /* !WOLFSSL_MISC_INCLUDED && !NO_INLINE */ |
1172 | | |
1173 | | #endif /* WOLF_CRYPT_MISC_C */ |