summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-28 21:53:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-28 21:53:18 (GMT)
commit7cb32717a995bee029ee18710b3e25e8e73f7377 (patch)
tree1aa971c51b8cf9a725f274d0a1041ca88be267d8
parent3cf1eb2c2370405ae05a7740dfdfdb206883b522 (diff)
downloadtcl-7cb32717a995bee029ee18710b3e25e8e73f7377.zip
tcl-7cb32717a995bee029ee18710b3e25e8e73f7377.tar.gz
tcl-7cb32717a995bee029ee18710b3e25e8e73f7377.tar.bz2
Update to libtommath v1.1.0
-rw-r--r--libtommath/bn_mp_prime_is_prime.c11
-rw-r--r--libtommath/changes.txt22
-rw-r--r--libtommath/libtommath_VS2008.sln29
-rw-r--r--libtommath/libtommath_VS2008.vcproj890
-rw-r--r--libtommath/makefile2
-rw-r--r--libtommath/makefile.shared1
-rw-r--r--libtommath/makefile.unix2
-rw-r--r--libtommath/makefile_include.mk6
-rw-r--r--libtommath/tommath.h7
-rw-r--r--libtommath/tommath_class.h1
10 files changed, 958 insertions, 13 deletions
diff --git a/libtommath/bn_mp_prime_is_prime.c b/libtommath/bn_mp_prime_is_prime.c
index 8d96e6a..15637c8 100644
--- a/libtommath/bn_mp_prime_is_prime.c
+++ b/libtommath/bn_mp_prime_is_prime.c
@@ -71,7 +71,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
}
#ifdef MP_8BIT
/* The search in the loop above was exhaustive in this case */
- if (a->used == 1 && PRIME_SIZE >= 31) {
+ if ((a->used == 1) && (PRIME_SIZE >= 31)) {
return MP_OKAY;
}
#endif
@@ -126,7 +126,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
*/
#if defined (MP_8BIT) || defined (LTM_USE_FROBENIUS_TEST)
err = mp_prime_frobenius_underwood(a, &res);
- if (err != MP_OKAY && err != MP_ITER) {
+ if ((err != MP_OKAY) && (err != MP_ITER)) {
goto LBL_B;
}
if (res == MP_NO) {
@@ -296,7 +296,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
* One 8-bit digit is too small, so concatenate two if the size of
* unsigned int allows for it.
*/
- if ((sizeof(unsigned int) * CHAR_BIT)/2 >= (sizeof(mp_digit) * CHAR_BIT)) {
+ if (((sizeof(unsigned int) * CHAR_BIT)/2) >= (sizeof(mp_digit) * CHAR_BIT)) {
if ((err = mp_rand(&b, 1)) != MP_OKAY) {
goto LBL_B;
}
@@ -305,10 +305,9 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
fips_rand &= mask;
}
#endif
- if (fips_rand > ((unsigned int) INT_MAX - DIGIT_BIT)) {
+ if (fips_rand > (unsigned int)(INT_MAX - DIGIT_BIT)) {
len = INT_MAX / DIGIT_BIT;
- }
- else {
+ } else {
len = (((int)fips_rand + DIGIT_BIT) / DIGIT_BIT);
}
/* Unlikely. */
diff --git a/libtommath/changes.txt b/libtommath/changes.txt
index 51da801..aa0c64c 100644
--- a/libtommath/changes.txt
+++ b/libtommath/changes.txt
@@ -1,3 +1,25 @@
+Jan 28th, 2019
+v1.1.0
+ -- Christoph Zurnieden contributed FIPS 186.4 compliant
+ prime-checking (PR #113), several other fixes and a load of documentation
+ -- Daniel Mendler provided two's-complement functions (PR #124)
+ and mp_{set,get}_double() (PR #123)
+ -- Francois Perrad took care of linting the sources, provided all fixes and
+ a astylerc to auto-format the sources.
+ -- A bunch of patches by Kevin B Kenny have been back-ported from TCL
+ -- Jan Nijtmans provided the patches to `const`ify all API
+ function arguments (also from TCL)
+ -- mp_rand() has now several native random provider implementations
+ and doesn't rely on `rand()` anymore
+ -- Karel Miko provided fixes when building for MS Windows
+ and re-worked the makefile generating process
+ -- The entire environment and build logic has been extended and improved
+ regarding auto-detection of platforms, libtool and a lot more
+ -- Prevent some potential BOF cases
+ -- Improved/fixed mp_lshd() and mp_invmod()
+ -- A load more bugs were fixed by various contributors
+
+
Aug 29th, 2017
v1.0.1
-- Dmitry Kovalenko provided fixes to mp_add_d() and mp_init_copy()
diff --git a/libtommath/libtommath_VS2008.sln b/libtommath/libtommath_VS2008.sln
new file mode 100644
index 0000000..6bfc159
--- /dev/null
+++ b/libtommath/libtommath_VS2008.sln
@@ -0,0 +1,29 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.Build.0 = Debug|Win32
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|x64.ActiveCfg = Debug|x64
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|x64.Build.0 = Debug|x64
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.ActiveCfg = Release|Win32
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.Build.0 = Release|Win32
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|x64.ActiveCfg = Release|x64
+ {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {83B84178-7B4F-4B78-9C5D-17B8201D5B61}
+ EndGlobalSection
+EndGlobal
diff --git a/libtommath/libtommath_VS2008.vcproj b/libtommath/libtommath_VS2008.vcproj
new file mode 100644
index 0000000..5b2637b
--- /dev/null
+++ b/libtommath/libtommath_VS2008.vcproj
@@ -0,0 +1,890 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="tommath"
+ ProjectGUID="{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}"
+ RootNamespace="tommath"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)\tommath.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(OutDir)\tommath.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)\tommath.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(OutDir)\tommath.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)\tommath.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(OutDir)\tommath.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)\tommath.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(OutDir)\tommath.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="bn_error.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_fast_mp_invmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_fast_mp_montgomery_reduce.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_fast_s_mp_mul_digs.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_fast_s_mp_mul_high_digs.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_fast_s_mp_sqr.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_2expt.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_abs.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_add.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_add_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_addmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_and.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_clamp.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_clear.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_clear_multi.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_cmp.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_cmp_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_cmp_mag.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_cnt_lsb.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_complement.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_copy.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_count_bits.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_div.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_div_2.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_div_2d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_div_3.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_div_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_dr_is_modulus.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_dr_reduce.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_dr_setup.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_exch.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_export.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_expt_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_expt_d_ex.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_exptmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_exptmod_fast.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_exteuclid.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_fread.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_fwrite.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_gcd.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_get_bit.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_get_double.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_get_int.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_get_long.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_get_long_long.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_grow.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_import.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_init.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_init_copy.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_init_multi.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_init_set.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_init_set_int.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_init_size.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_invmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_invmod_slow.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_is_square.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_jacobi.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_karatsuba_mul.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_karatsuba_sqr.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_kronecker.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_lcm.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_lshd.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mod_2d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mod_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_montgomery_calc_normalization.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_montgomery_reduce.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_montgomery_setup.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mul.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mul_2.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mul_2d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mul_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_mulmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_n_root.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_n_root_ex.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_neg.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_or.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_fermat.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_frobenius_underwood.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_is_divisible.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_is_prime.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_miller_rabin.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_next_prime.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_rabin_miller_trials.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_random_ex.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_prime_strong_lucas_selfridge.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_radix_size.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_radix_smap.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_rand.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_read_radix.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_read_signed_bin.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_read_unsigned_bin.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_2k.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_2k_l.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_2k_setup.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_2k_setup_l.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_is_2k.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_is_2k_l.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_reduce_setup.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_rshd.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_set.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_set_double.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_set_int.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_set_long.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_set_long_long.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_shrink.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_signed_bin_size.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_sqr.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_sqrmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_sqrt.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_sqrtmod_prime.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_sub.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_sub_d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_submod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_tc_and.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_tc_div_2d.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_tc_or.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_tc_xor.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_to_signed_bin.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_to_signed_bin_n.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_to_unsigned_bin.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_to_unsigned_bin_n.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_toom_mul.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_toom_sqr.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_toradix.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_toradix_n.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_unsigned_bin_size.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_xor.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_mp_zero.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_prime_tab.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_reverse.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_s_mp_add.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_s_mp_exptmod.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_s_mp_mul_digs.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_s_mp_mul_high_digs.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_s_mp_sqr.c"
+ >
+ </File>
+ <File
+ RelativePath="bn_s_mp_sub.c"
+ >
+ </File>
+ <File
+ RelativePath="bncore.c"
+ >
+ </File>
+ <File
+ RelativePath="tommath.h"
+ >
+ </File>
+ <File
+ RelativePath="tommath_class.h"
+ >
+ </File>
+ <File
+ RelativePath="tommath_private.h"
+ >
+ </File>
+ <File
+ RelativePath="tommath_superclass.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libtommath/makefile b/libtommath/makefile
index 4e5f0f1..a07c274 100644
--- a/libtommath/makefile
+++ b/libtommath/makefile
@@ -141,6 +141,8 @@ zipup: clean astyle new_file manual poster docs
$(MAKE) -C libtommath-$(VERSION)/ pre_gen
tar -c libtommath-$(VERSION)/ | xz -6e -c - > ltm-$(VERSION).tar.xz
zip -9rq ltm-$(VERSION).zip libtommath-$(VERSION)
+ cp doc/bn.pdf bn-$(VERSION).pdf
+ cp doc/tommath.pdf tommath-$(VERSION).pdf
rm -rf libtommath-$(VERSION)
gpg -b -a ltm-$(VERSION).tar.xz
gpg -b -a ltm-$(VERSION).zip
diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared
index d5d1818..3955f83 100644
--- a/libtommath/makefile.shared
+++ b/libtommath/makefile.shared
@@ -83,6 +83,7 @@ test_standalone: $(LIBNAME) demo/demo.o
$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)
+.PHONY: mtest
mtest:
cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest
diff --git a/libtommath/makefile.unix b/libtommath/makefile.unix
index a51b973..b89cf47 100644
--- a/libtommath/makefile.unix
+++ b/libtommath/makefile.unix
@@ -21,7 +21,7 @@ RANLIB = ranlib
CFLAGS = -O2
LDFLAGS =
-VERSION = 1.0.1
+VERSION = 1.1.0
#Compilation flags
LTM_CFLAGS = -I. $(CFLAGS)
diff --git a/libtommath/makefile_include.mk b/libtommath/makefile_include.mk
index 4814593..ec2205b 100644
--- a/libtommath/makefile_include.mk
+++ b/libtommath/makefile_include.mk
@@ -3,9 +3,9 @@
#
#version of library
-VERSION=1.0.1
-VERSION_PC=1.0.1
-VERSION_SO=1:1
+VERSION=1.1.0
+VERSION_PC=1.1.0
+VERSION_SO=2:0:1
PLATFORM := $(shell uname | sed -e 's/_.*//')
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index 6469edf..ee5da86 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -283,9 +283,10 @@ int mp_rand(mp_int *a, int digits);
int mp_rand_digit(mp_digit *r);
#ifdef MP_PRNG_ENABLE_LTM_RNG
-/* as last resort we will fall back to libtomcrypt's rng_get_bytes()
- * in case you don't use libtomcrypt or use it w/o rng_get_bytes()
- * you have to implement it somewhere else, as it's required */
+/* A last resort to provide random data on systems without any of the other
+ * implemented ways to gather entropy.
+ * It is compatible with `rng_get_bytes()` from libtomcrypt so you could
+ * provide that one and then set `ltm_rng = rng_get_bytes;` */
extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
extern void (*ltm_rng_callback)(void);
#endif
diff --git a/libtommath/tommath_class.h b/libtommath/tommath_class.h
index 6363042..46f9996 100644
--- a/libtommath/tommath_class.h
+++ b/libtommath/tommath_class.h
@@ -9,6 +9,7 @@
*
* SPDX-License-Identifier: Unlicense
*/
+
#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
#if defined(LTM2)
# define LTM3