No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
d2a61b5
... +0 ...
e81171c
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
5 | 5 | \project bee2 [cryptographic library] |
|
6 | 6 | \author (C) Sergey Agievich [agievich@{bsu.by|gmail.com}] |
|
7 | 7 | \created 2020.03.20 |
|
8 | - | \version 2020.03.24 |
|
8 | + | \version 2020.04.09 |
|
9 | 9 | \license This program is released under the GNU General Public License |
|
10 | 10 | version 3. See Copyright Notices in bee2/info.h. |
|
11 | 11 | ******************************************************************************* |
31 | 31 | typedef struct |
|
32 | 32 | { |
|
33 | 33 | u32 key[8]; /*< форматированный ключ */ |
|
34 | - | u32 ctr[4]; /*< счетчик */ |
|
35 | - | word s[W_OF_B(128)]; /*< переменная s */ |
|
34 | + | u32 s[4]; /*< переменная s */ |
|
35 | + | word r[W_OF_B(128)]; /*< переменная r */ |
|
36 | 36 | word t[W_OF_B(128)]; /*< переменная t */ |
|
37 | 37 | word t1[W_OF_B(128)]; /*< копия t/имитовставка */ |
|
38 | 38 | word len[W_OF_B(128)]; /*< обработано открытых || критических данных */ |
55 | 55 | ASSERT(memIsDisjoint2(iv, 16, state, beltCHE_keep())); |
|
56 | 56 | // разобрать key и iv |
|
57 | 57 | beltKeyExpand2(st->key, key, len); |
|
58 | - | beltBlockCopy(st->s, iv); |
|
59 | - | beltBlockEncr((octet*)st->s, st->key); |
|
60 | - | u32From(st->ctr, st->s, 16); |
|
58 | + | beltBlockCopy(st->r, iv); |
|
59 | + | beltBlockEncr((octet*)st->r, st->key); |
|
60 | + | u32From(st->s, st->r, 16); |
|
61 | 61 | #if (OCTET_ORDER == BIG_ENDIAN) |
|
62 | - | beltBlockRevW(st->s); |
|
62 | + | beltBlockRevW(st->r); |
|
63 | 63 | #endif |
|
64 | 64 | // подготовить t |
|
65 | 65 | wwFrom(st->t, beltH(), 16); |
90 | 90 | // цикл по полным блокам |
|
91 | 91 | while (count >= 16) |
|
92 | 92 | { |
|
93 | - | beltBlockMulC(st->ctr), st->ctr[0] ^= 0x00000001; |
|
94 | - | beltBlockCopy(st->block1, st->ctr); |
|
93 | + | beltBlockMulC(st->s), st->s[0] ^= 0x00000001; |
|
94 | + | beltBlockCopy(st->block1, st->s); |
|
95 | 95 | beltBlockEncr2((u32*)st->block1, st->key); |
|
96 | 96 | #if (OCTET_ORDER == BIG_ENDIAN) |
|
97 | 97 | beltBlockRevU32(st->block1); |
103 | 103 | // неполный блок? |
|
104 | 104 | if (count) |
|
105 | 105 | { |
|
106 | - | beltBlockMulC(st->ctr), st->ctr[0] ^= 0x00000001; |
|
107 | - | beltBlockCopy(st->block1, st->ctr); |
|
106 | + | beltBlockMulC(st->s), st->s[0] ^= 0x00000001; |
|
107 | + | beltBlockCopy(st->block1, st->s); |
|
108 | 108 | beltBlockEncr2((u32*)st->block1, st->key); |
|
109 | 109 | #if (OCTET_ORDER == BIG_ENDIAN) |
|
110 | 110 | beltBlockRevU32(st->block1); |
138 | 138 | beltBlockRevW(st->block); |
|
139 | 139 | #endif |
|
140 | 140 | beltBlockXor2(st->t, st->block); |
|
141 | - | beltPolyMul(st->t, st->t, st->s, st->stack); |
|
141 | + | beltPolyMul(st->t, st->t, st->r, st->stack); |
|
142 | 142 | st->filled = 0; |
|
143 | 143 | } |
|
144 | 144 | // цикл по полным блокам |
149 | 149 | beltBlockRevW(st->block); |
|
150 | 150 | #endif |
|
151 | 151 | beltBlockXor2(st->t, st->block); |
|
152 | - | beltPolyMul(st->t, st->t, st->s, st->stack); |
|
152 | + | beltPolyMul(st->t, st->t, st->r, st->stack); |
|
153 | 153 | buf = (const octet*)buf + 16; |
|
154 | 154 | count -= 16; |
|
155 | 155 | } |
171 | 171 | beltBlockRevW(st->block); |
|
172 | 172 | #endif |
|
173 | 173 | beltBlockXor2(st->t, st->block); |
|
174 | - | beltPolyMul(st->t, st->t, st->s, st->stack); |
|
174 | + | beltPolyMul(st->t, st->t, st->r, st->stack); |
|
175 | 175 | st->filled = 0; |
|
176 | 176 | } |
|
177 | 177 | // обновить длину |
192 | 192 | beltBlockRevW(st->block); |
|
193 | 193 | #endif |
|
194 | 194 | beltBlockXor2(st->t, st->block); |
|
195 | - | beltPolyMul(st->t, st->t, st->s, st->stack); |
|
195 | + | beltPolyMul(st->t, st->t, st->r, st->stack); |
|
196 | 196 | st->filled = 0; |
|
197 | 197 | } |
|
198 | 198 | // цикл по полным блокам |
203 | 203 | beltBlockRevW(st->block); |
|
204 | 204 | #endif |
|
205 | 205 | beltBlockXor2(st->t, st->block); |
|
206 | - | beltPolyMul(st->t, st->t, st->s, st->stack); |
|
206 | + | beltPolyMul(st->t, st->t, st->r, st->stack); |
|
207 | 207 | buf = (const octet*)buf + 16; |
|
208 | 208 | count -= 16; |
|
209 | 209 | } |
227 | 227 | memSetZero(st->block + st->filled, 16 - st->filled); |
|
228 | 228 | wwFrom(st->t1, st->block, 16); |
|
229 | 229 | beltBlockXor2(st->t1, st->t); |
|
230 | - | beltPolyMul(st->t1, st->t1, st->s, st->stack); |
|
230 | + | beltPolyMul(st->t1, st->t1, st->r, st->stack); |
|
231 | 231 | } |
|
232 | 232 | else |
|
233 | 233 | memCopy(st->t1, st->t, 16); |
|
234 | 234 | // обработать блок длины |
|
235 | 235 | beltBlockXor2(st->t1, st->len); |
|
236 | - | beltPolyMul(st->t1, st->t1, st->s, st->stack); |
|
236 | + | beltPolyMul(st->t1, st->t1, st->r, st->stack); |
|
237 | 237 | #if (OCTET_ORDER == BIG_ENDIAN) |
|
238 | 238 | beltBlockRevW(st->t1); |
|
239 | 239 | #endif |
Files | Coverage |
---|---|
Project Totals (65 files) | 84.51% |
e81171c
d2a61b5