Package list libcryptx-perl / 7b0902e
libtomcrypt update Karel Miko 2 years ago
2 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
8888 static int set_int(void *a, ltc_mp_digit b)
8989 {
9090 LTC_ARGCHK(a != NULL);
91 #ifdef BN_MP_SET_INT_C
9192 return mpi_to_ltc_error(mp_set_int(a, b));
93 #else
94 mp_set_u32(a, b);
95 return CRYPT_OK;
96 #endif
9297 }
9398
9499 static unsigned long get_int(void *a)
95100 {
96101 LTC_ARGCHK(a != NULL);
102 #ifdef BN_MP_GET_INT_C
97103 return mp_get_int(a);
104 #else
105 return mp_get_ul(a);
106 #endif
98107 }
99108
100109 static ltc_mp_digit get_digit(void *a, int n)
423432 return mpi_to_ltc_error(mp_rand(a, size));
424433 }
425434
435 #ifndef MP_DIGIT_BIT
436 #define MP_DIGIT_BIT DIGIT_BIT
437 #endif
438
426439 const ltc_math_descriptor ltm_desc = {
427440
428441 "LibTomMath",
429 (int)DIGIT_BIT,
442 (int)MP_DIGIT_BIT,
430443
431444 &init,
432445 &init_copy,
120120 size = strlen(sdata);
121121 STORE32H(size, out);
122122 out += 4;
123 XSTRNCPY((char *)out, sdata, size);
123 XMEMCPY(out, sdata, size);
124124 out += size;
125125 break;
126126 case LTC_SSHDATA_MPINT: