Using golang.org/x/sys/cpu would be really great, but it makes it
hard to vendor the library with go 1.10.
This patch gets information about CPU capabilities directly from CPUID
* Makes it possible to use p503 in SIDH and SIKE
* Refactors tests so that unit tests in SIKE and SIDH are run for
each prime field. It adds test data array called 'tdata' which
describes test parameters for underlying prime field. When new field
is added, it's enough to simply add new test data to 'tdata' vector in
order to run all existing tests with new prime field.
* SIKE/p503 is now tested with official test vectors from NIST
submission
Private key generation can take advantage of the fact that keyspace for
secret key is (0, 2^x - 1), for some possitivite value of 'x' (see SIKE,
1.3.8). It means that all bytes in the secret key, but the last one, can
take any value between <0x00,0xFF>. Similarily for the last byte, but
generation needs to chop off some bits, to make sure generated value is
an element of a key-space.
Assuming uniform distribution of bytes generated by RNG, secret key is
still chosen uniformly at random, but there is no need to maintain field
specific assembly code.