Modify the signature of mp_find_prime() to permit the number of
Miller-Rabin rounds to be specified. In addition, valid responses
now include MP_NO, MP_YES, and MP_VAL which is returned when
mp_prime_is_prime() fails.
Change-Id: I0195129a4dd75875e6dddb6d49a5ceb30afb1a17
libtommath protects the inclusion of functions by wrapping their
declarations by CPP #ifdef tests and defining the matching macros
within libtommath_class.h.
Add missing macros:
BN_MP_FIND_PRIME_C
BN_MP_ISPRIME_C
Change-Id: Ic577300114f8e88d7a3af3d9f717a249d57f03b1
As pointed out by Steffen Jaeckel [https://github.com/sjaeckel],
within bn_mp_prime_next_prime() t <= PRIME_SIZE as per the check
at the top of the function. Remove the unnecessary comparison in
a for loop conditional.
Change-Id: I868bee1a7a019e0ab06bf2b81cc71cf66ca9acff
unix_seed(), called by the add-seed-data op unix_add(), attempts to
write seed data to the random data device. If this fails, the failure
is ignored, as it must be, since there is no way to inform the caller.
This change modifies the way in which the return value from write(2)
is ignored, to avoid compiler warnings when building on Ubuntu 12.10,
with gcc 4.7.2 and eglibc 2.15-0ubuntu20.1.
md2.c was doing memset(m, 0, sizeof(m)), and so was only clearing
the first 4 bytes of the passed md2 structure in MD2_Final. Fix
this to clear the entire structure, as expected.
Heimdal can be executed in environments in which the user
account profile is not loaded. In such environments it is
not possible to use PROV_RSA_FULL as it stores required
data within the profile. Instead, fallback to PROV_RNG which
does not store data within the profile and can be used to access
secure random number generator routines.
Change-Id: If600246f39645ed6bf5af0dd237f5adfddcf6c0c
on a big endian machine, usage of this file in the kernel
is somewhat troublesome since the linux kernel already has
a well known global/#define called current.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
most of these warnings are not problems because of ample
use of abort() calls. However, the large number of warnings
makes it difficult to identify real problems. Initialize
the variables to shut up the compilers.
Change-Id: I8477c11b17c7b6a7d9074c721fdd2d7303b186a8
hcrypto: struct x64 doesn't need bitfields
The bitfield specifications on the struct x64 members do not actually do
anything to guarantee/force packing or endian of the members. Removing
them allows the code to compile on certain compilers that do not support
bitfields on 64-bit types.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
When using 64bit constants for initialisation flag them as LL, so
the compiler doesn't try to cast them down to a long, and throw away
information, on 32 bit platforms.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>