Home | History | Annotate | Download | only in integer

Lines Matching refs:num

24   @param num      The first mp_int to encode
29 int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen)
34 LTC_ARGCHK(num != NULL);
39 if ((err = der_length_integer(num, &tmplen)) != CRYPT_OK) {
48 if (mp_cmp_d(num, 0) != LTC_MP_LT) {
50 if ((mp_count_bits(num) & 7) == 0 || mp_iszero(num) == LTC_MP_YES) {
56 /* get length of num in bytes (plus 1 since we force the msbyte to zero) */
57 y = mp_unsigned_bin_size(num) + leading_zero;
60 y = mp_count_bits(num);
63 if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) --y;
87 /* now store msbyte of zero if num is non-zero */
93 if (mp_cmp_d(num, 0) == LTC_MP_GT) {
95 if ((err = mp_to_unsigned_bin(num, out)) != CRYPT_OK) {
98 } else if (mp_iszero(num) != LTC_MP_YES) {
107 y = mp_count_bits(num);
109 if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) y -= 8;
110 if (mp_2expt(tmp, y) != CRYPT_OK || mp_add(tmp, num, tmp) != CRYPT_OK) {