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.
Fork of MiniTLS-GPL by
fp_lshd.c
00001 /* TomsFastMath, a fast ISO C bignum library. 00002 * 00003 * This project is meant to fill in where LibTomMath 00004 * falls short. That is speed ;-) 00005 * 00006 * This project is public domain and free for all purposes. 00007 * 00008 * Tom St Denis, tomstdenis@gmail.com 00009 */ 00010 #include <tfm.h> 00011 00012 void fp_lshd(fp_int *a, int x) 00013 { 00014 int y; 00015 00016 /* move up and truncate as required */ 00017 y = MIN(a->used + x - 1, (int)(FP_SIZE-1)); 00018 00019 /* store new size */ 00020 a->used = y + 1; 00021 00022 /* move digits */ 00023 for (; y >= x; y--) { 00024 a->dp[y] = a->dp[y-x]; 00025 } 00026 00027 /* zero lower digits */ 00028 for (; y >= 0; y--) { 00029 a->dp[y] = 0; 00030 } 00031 00032 /* clamp digits */ 00033 fp_clamp(a); 00034 } 00035 00036 /* $Source: /cvs/libtom/tomsfastmath/src/bit/fp_lshd.c,v $ */ 00037 /* $Revision: 1.1 $ */ 00038 /* $Date: 2006/12/31 21:25:53 $ */
Generated on Tue Jul 12 2022 19:20:10 by
1.7.2
