randombit / botan
Showing 1 of 3 files from the diff.

@@ -113,8 +113,12 @@
Loading
113 113
   if(m >= m_group.get_p())
114 114
      throw Invalid_Argument("ElGamal encryption: Input is too large");
115 115
116 -
   const size_t k_bits = m_group.exponent_bits();
117 -
   const BigInt k(rng, k_bits);
116 +
   /*
117 +
   Some ElGamal implementations foolishly use prime fields where p - 1 is
118 +
   smooth, as a result it is unsafe to use short exponents.
119 +
   */
120 +
   const size_t k_bits = m_group.p_bits() - 1;
121 +
   const BigInt k(rng, k_bits, false);
118 122
119 123
   const BigInt a = m_group.power_g_p(k, k_bits);
120 124
   const BigInt b = m_group.multiply_mod_p(m, monty_execute(*m_monty_y_p, k, k_bits));
Files Coverage
src 92.32%
Project Totals (568 files) 92.32%
1
---
2

3
# Documentation
4
# https://github.com/codecov/support/wiki/Codecov-Yaml#full-yaml
5
#
6
# Validate this file
7
# curl --data-binary @codecov.yml https://codecov.io/validate
8

9
coverage:
10
  status:
11
    project:
12
      default:
13
        # Random seeds in tests lead to a +/-0.05% coverage span even for PRs
14
        # that do not change source code
15
        threshold: 0.05
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading