+ struct pollfd pfd[2] = {{fd[0], POLLIN}, {fd[1], POLLIN}};
+
+ sptps_params_t params1 = {
+ .handle = fd + 0,
+ .initiator = true,
+ .datagram = false,
+ .mykey = key1,
+ .hiskey = key2,
+ .label = "sptps_speed",
+ .send_data = send_data,
+ .receive_record = receive_record,
+ };
+
+ sptps_params_t params2 = {
+ .handle = fd + 1,
+ .initiator = false,
+ .datagram = false,
+ .mykey = key2,
+ .hiskey = key1,
+ .label = "sptps_speed",
+ .send_data = send_data,
+ .receive_record = receive_record,
+ };
+
+ static const char *suite_names[] = {
+ "Chacha20-Poly1305",
+ "AES-256-GCM",
+ };
+
+ for(uint8_t suite = 0; suite < 2; suite++) {
+ fprintf(stderr, "\nCipher suite %u (%s):\n", suite, suite_names[suite]);
+ params1.preferred_suite = params2.preferred_suite = suite;
+
+ // SPTPS authentication phase
+
+ fprintf(stderr, "SPTPS/TCP authenticate for %lg seconds: ", duration);
+
+ if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) {
+ fprintf(stderr, "Could not create a UNIX socket pair: %s\n", sockstrerror(sockerrno));
+ return 1;
+ }