asciilifeform: and if mircea_popescu writes one -- i dun care if in fortran, cobol, malbolge, whichever, so long as it's something resembling a proggy -- i promise to read.
asciilifeform: what we do not have -- and don't have because it doesn't actually work -- is the karatsuba cut for modular mult.
asciilifeform: that one -- we already ahve (see the paste, and the old pastes)
asciilifeform: i was speaking specifically of the division algo
asciilifeform: but modulus only is distributive over multiplications, not additions.
asciilifeform: and yes it'd be 133337 if it worked, we would have a direct modular equivalent of karatsuba
asciilifeform: 1) mircea_popescu describes algo for mod. 2) turns out exactly knuths's, that is in existing ffa 3) describes 'do it to each term of a+b+c in karatsuba' 4) this dun work, if it worked we would be bragging about the new 133337 recursive modular mult algo we've got
asciilifeform: i think we missed a step in the thread
asciilifeform: ( and worth keeping in mind that in ffaworld adding two B-bit integers does NOT give a B-bit integer, it gives a B+W bit one. where W is our word width. )
asciilifeform: so i'd say it yes would be worth cycles. if anybody knew of an algo.
asciilifeform: well we are talking about a O(NlogN) rsa vs a O(N^5) one
asciilifeform: xy = (a+b+c), but xy mod n != (a mod n)+(b mod n)+(c mod n)
asciilifeform: ( nao if only modulus were a distributive operation ! then could take mod for each of the 3 addition arguments inside karatsuba, and we'd be golden )
asciilifeform: rothbart: where did you get your existing one ?
asciilifeform: ( because if you are doing anything other than karatsuba for mult of whatever variety, you're sunk )
asciilifeform: the approach i've been (futile, so far) taking is, to find a way to interleave modularization into karatsuba
asciilifeform: and oh did i mention 3) idiot specialforms (e.g. barrett's) , because if mother dropped you as a child specialform constraints on moduli seem like ok idea
asciilifeform: ( EVERYBODY, without exception, 1) did something intrinsically nonconstanttime 2) lied about it in print )
asciilifeform: the literature has been screamingly, frothing-at-the-mouth antihelpful
asciilifeform: i've been fighting with the modular mult thing since july
asciilifeform: and it is not only O(N^3), but when you modularly exponentiate it actually gets done B times, and not to B-sized inputs, but 2B ( because we have a multiply and then also a square, in each step of the B-step modular exponentiation bitwise )
asciilifeform: ^ you just described knuth division lol
asciilifeform: i am referring, of course, to the standard shift-and-substract knuth division, which is in the previously posted ffa