Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaeckel committed Jan 28, 2019
2 parents 5953f62 + 4330991 commit 08549ad
Show file tree
Hide file tree
Showing 206 changed files with 23,351 additions and 27,592 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore

/** export-subst
29 changes: 25 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
*.gcno
*.gcov
*.lib
Debug/
Release/
[Dd]ebug/
[Rr]elease/
/MSVC_*
.libs/
.coveralls.yml
coverage*/
coverage.info
pre_gen/*

# suppress output of build process and *nix/windows test executables
ltmtest
ltmtest.exe
timing
timing.exe
test
test.exe
mtest
Expand All @@ -31,6 +33,25 @@ mtest.exe
# ignore user specific settings
*.user
*.suo
*.userosscache
*.sln.docstates
*.userprefs
# cache/options directory
.vs/
# Backup & report files from converting an old project file to a newer Visual Studio version
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# Visual Studio 6 build log + workspace options file
*.plg
*.opt
# visual studio profiler
*.psess
*.vsp
*.vspx
*.sap


# ignore stuff generated by "make manual" and "make poster"
*.aux
Expand Down
31 changes: 24 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
language: c
compiler:
- gcc

script:
- make travis_mtest
- head -n 5 test.log
- tail -n 2 test.log
- ./testme.sh --with-cc=gcc --with-low-mp
install:
- sudo apt-get update -qq
- sudo apt-get install gcc-multilib

matrix:
fast_finish: true
branches:
only:
- master
- develop
- /^release\/.*$/

compiler:
- gcc
- clang
script:
- ./testme.sh --with-cc=$CC ${BUILDOPTIONS}
env:
- |
BUILDOPTIONS="--test-vs-mtest=333333"
- |
BUILDOPTIONS="--test-vs-mtest=333333 --mtest-real-rand"
- |
BUILDOPTIONS="--with-low-mp"
- |
BUILDOPTIONS="--with-m64 --with-m32 --with-mx32"
after_failure:
- cat test_*.log
- cat gcc_errors_*.log

notifications:
irc: "chat.freenode.net#libtom-notifications"
55 changes: 26 additions & 29 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
LibTomMath is licensed under DUAL licensing terms.

Choose and use the license of your needs.

[LICENSE #1]

LibTomMath is public domain. As should all quality software be.

Tom St Denis

[/LICENSE #1]

[LICENSE #2]

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

[/LICENSE #2]
The LibTom license

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
[![Build Status - master](https://travis-ci.org/libtom/libtommath.png?branch=master)](https://travis-ci.org/libtom/libtommath)
# libtommath

[![Build Status - develop](https://travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath)
This is the git repository for [LibTomMath](http://www.libtom.net/LibTomMath/), a free open source portable number theoretic multiple-precision integer (MPI) library written entirely in C.

This is the git repository for [LibTomMath](http://www.libtom.org/), a free open source portable number theoretic multiple-precision integer (MPI) library written entirely in C.
## Build Status

master: [![Build Status](https://api.travis-ci.org/libtom/libtommath.png?branch=master)](https://travis-ci.org/libtom/libtommath)

develop: [![Build Status](https://api.travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath)

API/ABI changes: [check here](https://abi-laboratory.pro/tracker/timeline/libtommath/)

## Summary

The `develop` branch contains the in-development version. Stable releases are tagged.

Documentation is built from the LaTeX file `bn.tex`. There is also limited documentation in `tommath.h`. There is also a document, `tommath.pdf`, which describes the goals of the project and many of the algorithms used.

The project can be build by using `make`. Along with the usual `make`, `make clean` and `make install`, there are several other build targets, see the makefile for details. There are also makefiles for certain specific platforms.

## Testing

Tests are located in `demo/` and can be built in two flavors.
* `make test` creates a test binary that is intended to be run against `mtest`. `mtest` can be built with `make mtest` and test execution is done like `./mtest/mtest | ./test`. `mtest` is creating test vectors using an alternative MPI library and `test` is consuming these vectors to verify correct behavior of ltm
* `make test_standalone` creates a stand-alone test binary that executes several test routines.
27 changes: 27 additions & 0 deletions astylerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Artistic Style, see http://astyle.sourceforge.net/
# full documentation, see: http://astyle.sourceforge.net/astyle.html
#
# usage:
# astyle --options=astylerc *.[ch]

## Bracket Style Options
style=kr

## Tab Options
indent=spaces=3

## Bracket Modify Options

## Indentation Options
min-conditional-indent=0

## Padding Options
pad-header
unpad-paren
align-pointer=name

## Formatting Options
break-after-logical
max-code-length=120
convert-tabs
mode=c
27 changes: 12 additions & 15 deletions bn_error.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_ERROR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
Expand All @@ -9,31 +9,28 @@
* Michael Fromberger but has been written from scratch with
* additional optimizations in place.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, [email protected], http://libtom.org
* SPDX-License-Identifier: Unlicense
*/

static const struct {
int code;
const char *msg;
int code;
const char *msg;
} msgs[] = {
{ MP_OKAY, "Successful" },
{ MP_MEM, "Out of heap" },
{ MP_VAL, "Value out of range" }
{ MP_OKAY, "Successful" },
{ MP_MEM, "Out of heap" },
{ MP_VAL, "Value out of range" }
};

/* return a char * string for a given code */
const char *mp_error_to_string(int code)
{
int x;
size_t x;

/* scan the lookup table for the given message */
for (x = 0; x < (int)(sizeof(msgs) / sizeof(msgs[0])); x++) {
if (msgs[x].code == code) {
return msgs[x].msg;
}
for (x = 0; x < (sizeof(msgs) / sizeof(msgs[0])); x++) {
if (msgs[x].code == code) {
return msgs[x].msg;
}
}

/* generic reply for invalid code */
Expand Down
Loading

0 comments on commit 08549ad

Please sign in to comment.