Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/curve448/arch_32/f_impl.h |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | /* | - | ||||||
2 | * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. | - | ||||||
3 | * Copyright 2014-2016 Cryptography Research, Inc. | - | ||||||
4 | * | - | ||||||
5 | * Licensed under the OpenSSL license (the "License"). You may not use | - | ||||||
6 | * this file except in compliance with the License. You can obtain a copy | - | ||||||
7 | * in the file LICENSE in the source distribution or at | - | ||||||
8 | * https://www.openssl.org/source/license.html | - | ||||||
9 | * | - | ||||||
10 | * Originally written by Mike Hamburg | - | ||||||
11 | */ | - | ||||||
12 | - | |||||||
13 | #ifndef HEADER_ARCH_32_F_IMPL_H | - | ||||||
14 | # define HEADER_ARCH_32_F_IMPL_H | - | ||||||
15 | - | |||||||
16 | # define GF_HEADROOM 2 | - | ||||||
17 | # define LIMB(x) ((x) & ((1 << 28) - 1)), ((x) >> 28) | - | ||||||
18 | # define FIELD_LITERAL(a, b, c, d, e, f, g, h) \ | - | ||||||
19 | {{LIMB(a), LIMB(b), LIMB(c), LIMB(d), LIMB(e), LIMB(f), LIMB(g), LIMB(h)}} | - | ||||||
20 | - | |||||||
21 | # define LIMB_PLACE_VALUE(i) 28 | - | ||||||
22 | - | |||||||
23 | void gf_add_RAW(gf out, const gf a, const gf b) | - | ||||||
24 | { | - | ||||||
25 | unsigned int i; | - | ||||||
26 | - | |||||||
27 | for (i = 0; i < NLIMBS; i++)
| 1872188-29955008 | ||||||
28 | out->limb[i] = a->limb[i] + b->limb[i]; executed 29955008 times by 2 tests: out->limb[i] = a->limb[i] + b->limb[i]; Executed by:
| 29955008 | ||||||
29 | } executed 1872188 times by 2 tests: end of block Executed by:
| 1872188 | ||||||
30 | - | |||||||
31 | void gf_sub_RAW(gf out, const gf a, const gf b) | - | ||||||
32 | { | - | ||||||
33 | unsigned int i; | - | ||||||
34 | - | |||||||
35 | for (i = 0; i < NLIMBS; i++)
| 1885417-30166672 | ||||||
36 | out->limb[i] = a->limb[i] - b->limb[i]; executed 30166672 times by 2 tests: out->limb[i] = a->limb[i] - b->limb[i]; Executed by:
| 30166672 | ||||||
37 | } executed 1885417 times by 2 tests: end of block Executed by:
| 1885417 | ||||||
38 | - | |||||||
39 | void gf_bias(gf a, int amt) | - | ||||||
40 | { | - | ||||||
41 | unsigned int i; | - | ||||||
42 | uint32_t co1 = ((1 << 28) - 1) * amt, co2 = co1 - amt; | - | ||||||
43 | - | |||||||
44 | for (i = 0; i < NLIMBS; i++)
| 1885417-30166672 | ||||||
45 | a->limb[i] += (i == NLIMBS / 2) ? co2 : co1; executed 30166672 times by 2 tests: a->limb[i] += (i == (64/sizeof(word_t)) / 2) ? co2 : co1; Executed by:
| 1885417-30166672 | ||||||
46 | } executed 1885417 times by 2 tests: end of block Executed by:
| 1885417 | ||||||
47 | - | |||||||
48 | void gf_weak_reduce(gf a) | - | ||||||
49 | { | - | ||||||
50 | uint32_t mask = (1 << 28) - 1; | - | ||||||
51 | uint32_t tmp = a->limb[NLIMBS - 1] >> 28; | - | ||||||
52 | unsigned int i; | - | ||||||
53 | - | |||||||
54 | a->limb[NLIMBS / 2] += tmp; | - | ||||||
55 | for (i = NLIMBS - 1; i > 0; i--)
| 1889347-28340205 | ||||||
56 | a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 28); executed 28340205 times by 2 tests: a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 28); Executed by:
| 28340205 | ||||||
57 | a->limb[0] = (a->limb[0] & mask) + tmp; | - | ||||||
58 | } executed 1889347 times by 2 tests: end of block Executed by:
| 1889347 | ||||||
59 | - | |||||||
60 | #endif /* HEADER_ARCH_32_F_IMPL_H */ | - | ||||||
Source code | Switch to Preprocessed file |