Revisions
-
sjaeckel revised this gist
Jan 2, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ void show_mp_int(mp_int *a){ int main() { const char* test="ABC"; mp_int a, b, c; mp_init(&a); show_mp_int_fullinfo(&a); @@ -48,7 +48,7 @@ int main() show_mp_int_fullinfo(&c); if( getch() == 'q' ) exit(0); **/ mp_read_unsigned_bin(&a, (unsigned char*)test, 1); show_mp_int_fullinfo(&a); getch(); return 0; -
sjaeckel revised this gist
Jan 2, 2012 . No changes.There are no files selected for viewing
-
sjaeckel renamed this gist
Jan 2, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ #include <stdio.h> #include <stdlib.h> #include<conio.h> #include"tommath.h" /* int mp_int_loader(mp_int *a){ } */ void show_mp_int_fullinfo(mp_int *a){ int i; printf("\na.used = %d\n", a->used); printf("a.alloc = %d\n", a->alloc); printf("a.sign = %d\n", a->sign); i = a->used - 1; for(;i>=0;i--) printf("dp[%d] = %d\n", i, a->dp[i] ); } void show_mp_int(mp_int *a){ int i; for(i = (a->used) - 1; i>=0; i--){ printf("dp[%d] = %d\n", i, a->dp[i] ); } } int main() { const unsigned char test="ABC"; mp_int a, b, c; mp_init(&a); show_mp_int_fullinfo(&a); mp_init(&b); show_mp_int_fullinfo(&b); mp_init(&c); show_mp_int_fullinfo(&c); /** mp_set_int(&a, 1073741824); // 268435456 // 10425 show_mp_int_fullinfo(&a); if( getch() == 'q' ) exit(0); mp_set(&b, 268435455); // 268435458 (prev val + 2) // 22483 show_mp_int_fullinfo(&b); if( getch() == 'q' ) exit(0); mp_add(&a, &b, &c); show_mp_int_fullinfo(&c); if( getch() == 'q' ) exit(0); **/ mp_read_unsigned_bin(&a, test, 1); show_mp_int_fullinfo(&a); getch(); return 0; }