Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MiniTLS-HTTPS-Example
math/bin/fp_read_signed_bin.c@4:cbaf466d717d, 2014-06-10 (annotated)
- Committer:
- MiniTLS
- Date:
- Tue Jun 10 14:23:09 2014 +0000
- Revision:
- 4:cbaf466d717d
- Parent:
- 0:35aa5be3b78d
Fixes for mbed
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| MiniTLS | 0:35aa5be3b78d | 1 | /* TomsFastMath, a fast ISO C bignum library. |
| MiniTLS | 0:35aa5be3b78d | 2 | * |
| MiniTLS | 0:35aa5be3b78d | 3 | * This project is meant to fill in where LibTomMath |
| MiniTLS | 0:35aa5be3b78d | 4 | * falls short. That is speed ;-) |
| MiniTLS | 0:35aa5be3b78d | 5 | * |
| MiniTLS | 0:35aa5be3b78d | 6 | * This project is public domain and free for all purposes. |
| MiniTLS | 0:35aa5be3b78d | 7 | * |
| MiniTLS | 0:35aa5be3b78d | 8 | * Tom St Denis, tomstdenis@gmail.com |
| MiniTLS | 0:35aa5be3b78d | 9 | */ |
| MiniTLS | 0:35aa5be3b78d | 10 | #include <tfm.h> |
| MiniTLS | 0:35aa5be3b78d | 11 | |
| MiniTLS | 0:35aa5be3b78d | 12 | void fp_read_signed_bin(fp_int *a, unsigned char *b, int c) |
| MiniTLS | 0:35aa5be3b78d | 13 | { |
| MiniTLS | 0:35aa5be3b78d | 14 | /* read magnitude */ |
| MiniTLS | 0:35aa5be3b78d | 15 | fp_read_unsigned_bin (a, b + 1, c - 1); |
| MiniTLS | 0:35aa5be3b78d | 16 | |
| MiniTLS | 0:35aa5be3b78d | 17 | /* first byte is 0 for positive, non-zero for negative */ |
| MiniTLS | 0:35aa5be3b78d | 18 | if (b[0] == 0) { |
| MiniTLS | 0:35aa5be3b78d | 19 | a->sign = FP_ZPOS; |
| MiniTLS | 0:35aa5be3b78d | 20 | } else { |
| MiniTLS | 0:35aa5be3b78d | 21 | a->sign = FP_NEG; |
| MiniTLS | 0:35aa5be3b78d | 22 | } |
| MiniTLS | 0:35aa5be3b78d | 23 | } |
| MiniTLS | 0:35aa5be3b78d | 24 | |
| MiniTLS | 0:35aa5be3b78d | 25 | /* $Source: /cvs/libtom/tomsfastmath/src/bin/fp_read_signed_bin.c,v $ */ |
| MiniTLS | 0:35aa5be3b78d | 26 | /* $Revision: 1.1 $ */ |
| MiniTLS | 0:35aa5be3b78d | 27 | /* $Date: 2006/12/31 21:25:53 $ */ |
