It’s a fancy name for something that basically lets us sign and verify digital documents. But what if we want to do it efficiently? Well, you’re in luck because I’m here to teach you how!
First things first the math behind ECDSA. If you don’t care about the details, feel free to skip ahead.
Essentially, we start with a big ol’ elliptic curve (hence “elliptic”) and some points on it. We choose one of those points as our private key, which is kept secret by us. To sign something, we first hash the document to get a fixed-size number called a message digest or simply hash value. Then, using our private key, we calculate another point on the curve that’s related to both the hash and our private key. This new point is called the signature.
To verify the signature, someone else can do the same thing but with our public key instead of our private key. If they get the same result as the original signer, then it’s a valid signature!
Now that we understand how ECDSA works, efficiency. The most expensive part of signing and verifying is calculating those points on the curve using math operations like addition and multiplication. But did you know that there are ways to make this process faster?
One trick is called “precomputation”. Basically, we do some extra work upfront to save time later. For example, instead of computing a point for every hash value, we can compute it once for each possible input and store the results in a table. Then, when someone wants to sign or verify something, we just look up the result from our precomputed table!
Another trick is called “batching”. Instead of signing one document at a time, we can group multiple documents together and sign them all at once. This saves us some overhead because we only have to do the expensive math operations once for each set of inputs. Plus, it’s more efficient to store precomputed results in larger batches!
Who needs fancy algorithms when we can just be lazy?