well, the libs were useful for a couple days anyway, lol im just super happy it was the first time i compiled a lib for all 3 OS! [✓ bucketlist]. Im guessing the download links will be dead in 30 days anyway, lol
With the tiny size of RC4 yet genuine cryptographic quality (DropN'd of course!) and ease of being a stream cipher i really like how it can be used in place of that Xor/Rot13 family (hey it's only a couple bytes more!) for those times when Top Secret AES block cipher encryption is overkill yet still want something better than 8bit/32bit key "weak scramble cipher". A great middleground i think! brilliant work again wilbert!
Keya wrote:im just super happy it was the first time i compiled a lib for all 3 OS! [✓ bucketlist].
That is a great achievement
There's lots of C code available and compiled with optimization on, it's fast and easy to use.
It has also been helpful to see the difference for the different optimization settings; good to know not to compile with O0
Keya wrote:With the tiny size of RC4 yet genuine cryptographic quality (DropN'd of course!) and ease of being a stream cipher i really like how it can be used in place of that Xor/Rot13 family (hey it's only a couple bytes more!)
wilbert wrote:There's lots of C code available and compiled with optimization on, it's fast and easy to use.
yeah! talk about doors -> OPEN!!! im discovering there are so many amazing libs out there, and Fred was awesome enough to add Import functionality to PB, i think he's empowered us with such a great capability there but I get the feeling most PB'ers don't take advantage of it unless there's precompiled libs simply because C compilers are such a {you know that long evergrowing list of expletives! yeah that one!}, and I can only speak for myself here but the C language itself I find a bit intimidating and weird ... basic syntax just makes sense to me and I'm so happy Purebasic is really all I need. But the way I see it is this: we don't really have to learn to write any C anyway, we just have to (to use libs) learn how to compile an existing .c to .o, so surely the C programmer has already done 99% of the hard work for us?!? so I refuse to be scared by C, i don't feel I have to learn it, so yes I'm up for that final 1%, and I will conquer my fear of C compilers!!!
One Lib At A Time™ ...
wilbert wrote:It has also been helpful to see the difference for the different optimization settings; good to know not to compile with O0
Yeah, also good to know GCC's highest level of optimization has got nothing on your asm game hey wilbert!?!? lol
btw I was just reading https://gcc.gnu.org/onlinedocs/gcc/Opti ... tions.html
and I just learned of the -Os optimize for SMALL SIZE option, which is basically a skinnier -O2.
Anyway that took its RC4 .o lib down from 920 to 875 bytes, and the resulting Rc4Xor is 95 bytes:
The disassembler is x64dbg. I had to do a check to make sure "dil" was an x64 register, lol ... don't think i've seen it used before, but maybe people like me should be using dil instead of rax
Keya wrote:so x64 dropped the .o file from 1220 to 1195 bytes with gcc -Os, and Rc4Xor() is 85 bytes.
The disassembler is x64dbg. I had to do a check to make sure "dil" was an x64 register, lol ... don't think i've seen it used before, but maybe people like me should be using dil instead of rax
Thank you very much Keya
Nice to see the 64 bit code is even smaller compared to the 32 bit code and makes optimal use of the additional registers.
It probably also explains why the 64 bit code outperforms the 32 bit code.
I also had never heard of 'dil'. I understand now it's a name for the lowest 8 bits from the rdi register.
wilbert wrote:I also had never heard of 'dil'. I understand now it's a name for the lowest 8 bits from the rdi register.
ahhh, that makes sense. So i take it there's also a DIH? please tell me there's no 16bit DIX
[update] well there's no DIH for those upper 8bits (only DIL for lowest), makes sense i guess, but just "DI" for the 16bit'er...
wilbert wrote:I also had never heard of 'dil'. I understand now it's a name for the lowest 8 bits from the rdi register.
ahhh, that makes sense. So i take it there's also a DIH? please tell me there's no 16bit DIX
[update] well there's no DIH for those upper 8bits (only DIL for lowest), makes sense i guess, but just "DI" for the 16bit'er...