summaryrefslogtreecommitdiff
path: root/auto_tests/crypto_test.c
diff options
context:
space:
mode:
authorDiadlo <polsha3@gmail.com>2017-01-07 11:28:53 +0300
committerDiadlo <polsha3@gmail.com>2017-02-26 23:16:16 +0300
commitb19a9e54643eceaa52e71c0f38fa2ecae5a6809e (patch)
tree4c6fff0a086988ab21636e88dbf65c2e40a76a67 /auto_tests/crypto_test.c
parentb2d04eae9d9b76523b877a9e5efd5989f83b143d (diff)
Add part of platform-independent network API implementation
socket -> net_socket htons -> net_htons htonl -> net_htonl connect -> net_connect sendto -> net_sendto_ip4 getaddrinfo -> net_getipport sa_family_t -> Family
Diffstat (limited to 'auto_tests/crypto_test.c')
-rw-r--r--auto_tests/crypto_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index 7c5338e2..952b0312 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -276,7 +276,7 @@ static void increment_nonce_number_cmp(uint8_t *nonce, uint32_t num)
276{ 276{
277 uint32_t num1, num2; 277 uint32_t num1, num2;
278 memcpy(&num1, nonce + (CRYPTO_NONCE_SIZE - sizeof(num1)), sizeof(num1)); 278 memcpy(&num1, nonce + (CRYPTO_NONCE_SIZE - sizeof(num1)), sizeof(num1));
279 num1 = ntohl(num1); 279 num1 = net_ntohl(num1);
280 num2 = num + num1; 280 num2 = num + num1;
281 281
282 if (num2 < num1) { 282 if (num2 < num1) {
@@ -291,7 +291,7 @@ static void increment_nonce_number_cmp(uint8_t *nonce, uint32_t num)
291 } 291 }
292 } 292 }
293 293
294 num2 = htonl(num2); 294 num2 = net_htonl(num2);
295 memcpy(nonce + (CRYPTO_NONCE_SIZE - sizeof(num2)), &num2, sizeof(num2)); 295 memcpy(nonce + (CRYPTO_NONCE_SIZE - sizeof(num2)), &num2, sizeof(num2));
296} 296}
297 297