Skip to content

Commit 8cee9e3

Browse files
committed
curve25519: rely on utils.h
Signed-off-by: Felix Fietkau <[email protected]>
1 parent 6e1898f commit 8cee9e3

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

curve25519.c

+1-21
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <stdint.h>
99
#include <string.h>
10+
#include "utils.h"
1011

1112
#ifndef __BYTE_ORDER__
1213
#include <sys/param.h>
@@ -30,15 +31,6 @@ typedef uint32_t u32, __le32;
3031
typedef uint8_t u8;
3132
typedef int64_t s64;
3233
#endif
33-
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
34-
#define le64_to_cpup(a) __builtin_bswap64(*(a))
35-
#define le32_to_cpup(a) __builtin_bswap32(*(a))
36-
#define cpu_to_le64(a) __builtin_bswap64(a)
37-
#else
38-
#define le64_to_cpup(a) (*(a))
39-
#define le32_to_cpup(a) (*(a))
40-
#define cpu_to_le64(a) (a)
41-
#endif
4234
#ifndef __unused
4335
#define __unused __attribute__((unused))
4436
#endif
@@ -55,18 +47,6 @@ typedef int64_t s64;
5547
#define __force
5648
#endif
5749

58-
static __always_inline __unused __le32 get_unaligned_le32(const u8 *a)
59-
{
60-
__le32 l;
61-
__builtin_memcpy(&l, a, sizeof(l));
62-
return le32_to_cpup(&l);
63-
}
64-
static __always_inline __unused __le64 get_unaligned_le64(const u8 *a)
65-
{
66-
__le64 l;
67-
__builtin_memcpy(&l, a, sizeof(l));
68-
return le64_to_cpup(&l);
69-
}
7050
static __always_inline __unused void put_unaligned_le64(u64 s, u8 *d)
7151
{
7252
__le64 l = cpu_to_le64(s);

0 commit comments

Comments
 (0)