From c11f9d214acfeaf775e1eeb70488b4ad6338ce17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 15 May 2018 13:28:13 +0200 Subject: [PATCH] pkg/tweetnacl: Use RIOT random_bytes instead of randombytes --- pkg/tweetnacl/Makefile | 5 ++--- pkg/tweetnacl/Makefile.riot | 3 +++ ...random_bytes-function-instead-of-rando.patch | Bin 0 -> 1161 bytes pkg/tweetnacl/src/Makefile | 3 --- pkg/tweetnacl/src/randombytes.c | 16 ---------------- 5 files changed, 5 insertions(+), 22 deletions(-) create mode 100644 pkg/tweetnacl/Makefile.riot create mode 100644 pkg/tweetnacl/patches/0001-RIOT-Use-RIOT-random_bytes-function-instead-of-rando.patch delete mode 100644 pkg/tweetnacl/src/Makefile delete mode 100644 pkg/tweetnacl/src/randombytes.c diff --git a/pkg/tweetnacl/Makefile b/pkg/tweetnacl/Makefile index b30d17ed36..c2d1bff57c 100644 --- a/pkg/tweetnacl/Makefile +++ b/pkg/tweetnacl/Makefile @@ -6,7 +6,6 @@ PKG_LICENSE=PD .PHONY: all all: git-download - @cp $(RIOTBASE)/pkg/tweetnacl/src/* $(PKG_BUILDDIR) - "$(MAKE)" -C $(PKG_BUILDDIR) + $(Q)"$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.riot -include $(RIOTBASE)/pkg/pkg.mk \ No newline at end of file +include $(RIOTBASE)/pkg/pkg.mk diff --git a/pkg/tweetnacl/Makefile.riot b/pkg/tweetnacl/Makefile.riot new file mode 100644 index 0000000000..23ba5ad3e2 --- /dev/null +++ b/pkg/tweetnacl/Makefile.riot @@ -0,0 +1,3 @@ +MODULE=tweetnacl + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/tweetnacl/patches/0001-RIOT-Use-RIOT-random_bytes-function-instead-of-rando.patch b/pkg/tweetnacl/patches/0001-RIOT-Use-RIOT-random_bytes-function-instead-of-rando.patch new file mode 100644 index 0000000000000000000000000000000000000000..ac6a91d2161badf16e638a48b560087aa16be101 GIT binary patch literal 1161 zcmZ{jZBN@U6otS0R~&&fwIu1B=Cy^6A||v=Vobbzs!-+FPHQMmNgUQ{+kc;v!e|kb zq9i`|`rPMUCue2x0G@{-4bmtNn9L(Nkb^J@20X~Q$RaoYGsemwqGuzU3|>eKJVd@&oH2BVXx6vrbR-L;XPZgf_Pu~e0j zyjRIj_`#5-!-&G6widanvpdPn5R)G#*QZ}@aryP)dWf4! zwr?nz7RAFfTN_y+uQfNyQY&rCFo7a}PH5wVc%DaKeoARH>&00( z$owQ196qIS7&c(L9>h{%*JnJ2=er>s-;FRH6YML^7qyVsdo4cSBhIV7nNH7&*cUQa zTH@^DvZGwxMP8KXD2zZ46^@_}9Y=Lv^QtFQh8e~2R473}n(~R8z)9WMmWNp{rS(Lu zD>c(nU{UB9>Y#sUNBnMVlMshn39Z!L)Q)afnB@~czC9$KTp3yFmSg)kJ9UZ!w~oWE zH6$;z+@6*}oe}_3+Bmo^dKl3Le)F*SN*nNUy)?zN;%vdnhk9YA8LMRL`{=$H;XvE5 zknIgwv6|k?^^&QwOnoO)Mv&9jAS7dRNWR-oRFN%e%P$0(SE=>6}&b kj{QrvLt;X2@nM91n6`DqB=B3o?`~Uy| literal 0 HcmV?d00001 diff --git a/pkg/tweetnacl/src/Makefile b/pkg/tweetnacl/src/Makefile deleted file mode 100644 index 2af2531e48..0000000000 --- a/pkg/tweetnacl/src/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MODULE=tweetnacl - -include $(RIOTBASE)/Makefile.base \ No newline at end of file diff --git a/pkg/tweetnacl/src/randombytes.c b/pkg/tweetnacl/src/randombytes.c deleted file mode 100644 index ce3f938566..0000000000 --- a/pkg/tweetnacl/src/randombytes.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2016 Kaspar Schleiser - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -#include -#include "random.h" - -void randombytes(uint8_t *target, uint64_t n) -{ - /* tweetnacl needs uint64_t as "n" parameter, random provides uint32 */ - random_bytes(target, n); -}