I2C toy code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 6.0 KiB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # libtomcrypt
  2. See `doc/crypt.pdf` for a detailed documentation
  3. ## Project Status
  4. master: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=master)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=master)](https://coveralls.io/r/libtom/libtomcrypt)
  5. develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=develop)](https://coveralls.io/r/libtom/libtomcrypt)
  6. [![Coverity Scan Build Status](https://scan.coverity.com/projects/487/badge.svg)](https://scan.coverity.com/projects/487)
  7. ## Submitting patches
  8. Please branch off from develop if you want to submit a patch.
  9. Patch integration will be faster if tests and documentation are included.
  10. Please update the makefiles in a separate commit. To update them simply run the `updatemakes.sh` script.
  11. ## Branches
  12. Please be aware, that all branches besides _master_ and _develop_ __can__ and __will be__ force-pushed, rebased and/or removed!
  13. If you want to rely on such an _unstable_ branch, create your own fork of this repository to make sure nothing breaks for you.
  14. ## Configuration options
  15. By default the library builds its entire feature set (besides `katja`) in a (depending on your needs more or less) optimal way.
  16. There are numerous configuration options available if you want to trim down the functionality of the library.
  17. Please have a look at `src/headers/tomcrypt_custom.h` for all available configuration options.
  18. The following list is a small part of the available, but the most often required, configuration switches.
  19. | Flag | Behavior |
  20. | ---- | -------- |
  21. | `LTC_NO_TEST` | Remove all algorithm self-tests from the library |
  22. | `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) |
  23. | `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for importing or generating bigger RSA keys, change this at compile-time. |
  24. | `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* |
  25. | `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* |
  26. | `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* |
  27. | `USE_GMP` | use `gmp` as MPI provider when building the binaries *\*3* |
  28. | `USE_LTM` | use `libtommath` as MPI provider when building the binaries *\*3* |
  29. | `USE_TFM` | use `tomsfastmath` as MPI provider when building the binaries *\*3* |
  30. *\*1* It is possible to build the library against all MPI providers in parallel and choose at startup-time which math library should be used.
  31. *\*2* Please be aware that `tomsfastmath` has the limitation of a fixed max size of MPI's.
  32. *\*3* Only one is supported at the time & this is only required when building the binaries, not when building the library itself.
  33. ## Building the library
  34. There are several `makefile`s provided. Please choose the one that fits best for you.
  35. | makefile | use-case |
  36. | -------- | -------- |
  37. | `makefile` | builds a static library (GNU Make required, broken on Mac OSX - use `makefile.unix` instead) |
  38. | `makefile.shared` | builds a shared (and static) library (GNU Make required) |
  39. | `makefile.unix` | for unusual UNIX platforms, or if you do not have GNU Make |
  40. | `makefile.mingw` | for usage with the mingw compiler on MS Windows |
  41. | `makefile.msvc` | for usage with the MSVC compiler on MS Windows |
  42. | `libtomcrypt_VS2008.sln` | A VisualStudio 2008 project for MS Windows |
  43. ### Make targets
  44. The `makefile`s provide several targets to build (VS project excluded).
  45. The following list does not claim to be complete resp. to be available across all `makefile` variants.
  46. | target | application |
  47. | ------ | ----------- |
  48. | *empty target*/none given | c.f. `library`
  49. | `library` | builds only the library |
  50. | `hashsum` | builds the `hashsum` binary, similar to [`shasum`](https://linux.die.net/man/1/shasum), but with support for all hash-algorithms included in the library *\*4* |
  51. | `ltcrypt` | builds the `ltcrypt` binary, implementing something similar to [`crypt`](https://linux.die.net/man/3/crypt) *\*4* |
  52. | `sizes` | builds the `sizes` binary, printing all internal data sizes on invocation *\*4* |
  53. | `constants` | builds the `constants` binary, printing all internal constants on invocation *\*4* |
  54. | `openssl-enc` | builds the `openssl-enc` binary, which is more or less compatible to [`openssl enc`](https://linux.die.net/man/1/enc) *\*4* *\*5* |
  55. | `test` | builds the `test` binary, which runs all algorithm self-tests + some extended tests *\*4* *\*6* |
  56. | `timing` | builds the `timing` binary, which can be used to measure timings for algorithms and modes *\*4* *\*6* |
  57. | `bins` | builds `hashsum` *\*4* |
  58. | `all_test` | builds `test`, `hashsum`, `ltcrypt`, `small`, `tv_gen`, `sizes` & `constants` *\*4* |
  59. *\*4* also builds `library`
  60. *\*5* broken build in some configurations, therefore not built by default
  61. *\*6* requires define of one of `USE_GMP`, `USE_LTM` or `USE_TFM` (+ the appropriate MPI provider)
  62. ### Examples
  63. You want to build the library as static library
  64. make
  65. You want to build the library as shared library
  66. make -f makefile.shared
  67. You have `libtommath` installed on your system and want to build a static library and the `test` binary to run the self-tests.
  68. make CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" test
  69. You have `tomsfastmath` installed on your system and want to build a shared library and all binaries
  70. make -f makefile.shared CFLAGS="-DUSE_TFM -DTFM_DESC" EXTRALIBS="-ltfm" all demos
  71. You have `gmp`, `libtommath` and `tomsfastmath` installed on your system and want to build a static library and the `timing` binary to measure timings against `gmp`.
  72. make CFLAGS="-DUSE_GMP -DGMP_DESC -DLTM_DESC -DTFM_DESC" EXTRALIBS="-lgmp" timing
  73. If you have `libtommath` in a non-standard location:
  74. make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all