diff options
author | Andres Erbsen <andreser@mit.edu> | 2017-07-01 01:01:49 -0400 |
---|---|---|
committer | Andres Erbsen <andreser@mit.edu> | 2017-07-01 01:01:49 -0400 |
commit | 54e403c650b9bc99056211d37580fa30780c2b34 (patch) | |
tree | 782ba7913e76db32caeb52d94c4ea76f33463b4d /third_party/openssl-nistp256c64/bench_madd.c | |
parent | 8ae1ab299804f2217f8852500cf7e56bc5c3c322 (diff) |
benchmark OpenSSL p256 C code
Diffstat (limited to 'third_party/openssl-nistp256c64/bench_madd.c')
-rw-r--r-- | third_party/openssl-nistp256c64/bench_madd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/third_party/openssl-nistp256c64/bench_madd.c b/third_party/openssl-nistp256c64/bench_madd.c new file mode 100644 index 000000000..e2dc8e880 --- /dev/null +++ b/third_party/openssl-nistp256c64/bench_madd.c @@ -0,0 +1,16 @@ +#include <stdint.h> +#include "ecp_nistp256.h" + +void bench_madd(unsigned char* buf) { + uint128_t* x3 = (uint128_t*) buf; + uint128_t* y3 = (uint128_t*) (buf + 1*sizeof(felem)); + uint128_t* z3 = (uint128_t*) (buf + 2*sizeof(felem)); + uint128_t* x1 = (uint128_t*) (buf + 3*sizeof(felem)); + uint128_t* y1 = (uint128_t*) (buf + 4*sizeof(felem)); + uint128_t* z1 = (uint128_t*) (buf + 5*sizeof(felem)); + int mixed = 1; + uint64_t* x2 = (uint64_t*) (buf + 6*sizeof(felem)); + uint64_t* y2 = (uint64_t*) (buf + 6*sizeof(felem) + sizeof(smallfelem)); + smallfelem z2 = {1, 0, 0, 0}; + point_add(x3, y3, z3, x1, y1, z1, mixed, x2, y2, z2); +} |