this is maybe a basic question but I'm trying to better understand elliptic curve cryptography at a fundamental level.
I understand that a finite field is required in order to define a boundary for an elliptic curve.
Then, x,y values that satisfy the curve over this field represent the ec group of the curve.
My question is simple, how are the finite fields defined? They seem so arbitrary...
Example,
The finite fields for secp256k1
and curve25519
are
2^256 - 2^32 - 977
and
2^255 - 19
respectively...
My naive question is, how are these fields defined? The seem to be arbitrary bounds on the size of the ec group for the curves defined inside them.
I'm not asking why they are prime, but more why these numbers are chosen, and how the right size group is selected?
I did consider it was something to do with all of the elements satisfying some criteria, but really the values seem too large and arbitrary for that.