Skip to content

Commit b7a03fa

Browse files
committed
Remove requirement to link libm
1 parent 8d10e89 commit b7a03fa

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
if(BUILD_SHARED_LIBS AND NOT MSVC)
2-
find_library(M_LIB m)
3-
endif()
41
if(BUILD_SHARED_LIBS)
52
find_library(PBC_LIB protobuf-c)
63
endif()
@@ -65,9 +62,6 @@ add_library(omemo-c
6562
)
6663

6764
if(BUILD_SHARED_LIBS)
68-
if(NOT MSVC)
69-
target_link_libraries(omemo-c ${M_LIB})
70-
endif()
7165
target_link_libraries(omemo-c ${PBC_LIB})
7266
set_target_properties(omemo-c PROPERTIES
7367
VERSION ${OMEMO_C_VERSION}

src/hkdf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <stdio.h>
44
#include <stdlib.h>
55
#include <string.h>
6-
#include <math.h>
76
#include <assert.h>
87

98
#include "signal_protocol_internal.h"
@@ -106,7 +105,8 @@ ssize_t hkdf_expand(hkdf_context *context,
106105
const uint8_t *info, size_t info_len,
107106
size_t output_len)
108107
{
109-
int iterations = (int)ceil((double)output_len / (double)HASH_OUTPUT_SIZE);
108+
int iterations = (int)output_len / HASH_OUTPUT_SIZE;
109+
if (output_len % HASH_OUTPUT_SIZE > 0) iterations++;
110110
size_t remaining_len = output_len;
111111
signal_buffer *step_buffer = 0;
112112
size_t step_size = 0;

0 commit comments

Comments
 (0)