[xmlsec] Mscrypto IS patch
Wouter
wsh at xs4all.nl
Mon Sep 22 12:57:43 PDT 2003
This code is wrong (I sent a message about that last night). I know how
to write a better code
(faster/less mallocs) than one you intialy wrote and I hope to do it
tonight. The basic idea is
to implement following operations:
- add int to bignum
- mul bignum by int
- div bignum by int
where bignum is a binary buffer that MSCrypto returns. After that
converting that buffer (bignum)
to and from dec string is a piece of cake:
bignum-->dec string
dec_str = "";
while(bignum != 0) {
dec _str += convert_to_char(bignum % 10);
bignum = bignum / 10;
}
dec string->bignum
bignum = 0;
for(i = 0; i < strlen(dec_string);i++) {
bignum = bignum * 10;
bignum = bignum + convert_to_int(dec_str[i]);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20030922/e502299a/attachment.htm
More information about the xmlsec
mailing list