News for hackers. Stuff that matters.
Re:Engineers' Billing Nightmares by dijit on Monday November 28, 2022 @07:30AM (#33772787)
> Why not javascript specifically?

Javascript has one number type; float.

Re:Engineers' Billing Nightmares by onion2k on Monday November 28, 2022 @09:23AM (#33773931)
It's fair to say most JS code is only handling floats especially if you're just relying on JS's automatic casting but JS does have BigInt as well, and it has a whole bunch of numerical typed arrays that only accept specifically typed numbers like Uint8 or Int32 etc. You can do math in JS quite safely if you delve into the less well-known types a bit.
Re:Engineers' Billing Nightmares by eurasiantiger on Monday November 28, 2022 @12:27PM (#33776456)
Re:Engineers' Billing Nightmares by dijit on Monday November 28, 2022 @12:54PM (#33776904)
1) Wow, I didn't know that existed.

2) Wow, those downsides are insane. It's not constant time, thus can't be used in cryptography...? Has huge performance impacts and can't be casted to a "number"- how is this implemented? it can't be native INTs on the CPU?

Re:Engineers' Billing Nightmares by eurasiantiger on Monday November 28, 2022 @04:14PM (#33779781)
Any cryptography is surely using Uint8Array.
Re:Engineers' Billing Nightmares by SgtBastard on Monday November 28, 2022 @04:32PM (#33780041)
>Any cryptography is surely using Uint8Array.

Is this to optimise memory operations over a large plaintext/cipher text or is there some other advantage to it that is less obvious (e.g. more resistant to timing attacks?)

Re:Engineers' Billing Nightmares by eurasiantiger on Monday November 28, 2022 @05:32PM (#33780825)
No, it’s because Number is internally floating point and cannot represent all integers.