39 if (excess_len < len)
return MP_RANGE;
78 int num_bytes = num_bits / CHAR_BIT;
83 return num_bytes - 11;
90 if (msg_len > (buf_len - 11))
return MP_RANGE;
92 int msg_start = buf_len - msg_len;
93 int pad_len = msg_start - 3;
97 memmove(buf + msg_start, buf, msg_len);
101 buf[1] = (
unsigned char)
tag;
106 (filler)(buf + 2, pad_len);
109 buf[msg_start - 1] = 0x00;
117 if (buf_len < 11 || buf[0] != 0x00 || buf[1] != (
unsigned char)
tag)
123 while (buf[i++] !=
'\0') ++pad_len;
126 int data_len = buf_len - data_start;
129 memmove(buf, buf + data_start, data_len);
132 memset(buf + data_len, 0, pad_len + 3);
static __isl_give isl_map * tag(__isl_take isl_map *Relation, __isl_take isl_id *TagId)
Tag the Relation domain with TagId.
mp_result rsa_pkcs1v15_encode(unsigned char *buf, int msg_len, int buf_len, int tag, random_f filler)
mp_result rsa_os2ip(mp_int z, unsigned char *in, int len)
mp_result rsa_i2osp(mp_int z, unsigned char *out, int len)
mp_result rsa_rsaep(mp_int msg, mp_int exp, mp_int mod, mp_int cipher)
mp_result rsa_rsadp(mp_int cipher, mp_int exp, mp_int mod, mp_int msg)
mp_result rsa_rsasp(mp_int msg, mp_int exp, mp_int mod, mp_int signature)
int rsa_max_message_len(mp_int mod)
mp_result rsa_pkcs1v15_decode(unsigned char *buf, int buf_len, int tag, int *msg_len)
mp_result rsa_rsavp(mp_int signature, mp_int exp, mp_int mod, mp_int msg)
static mp_result s_rsa_transform(mp_int msg, mp_int exp, mp_int mod, mp_int out)
void(* random_f)(unsigned char *, int)
#define mp_int_read_binary
#define mp_int_compare_zero
#define mp_int_count_bits
#define mp_int_binary_len