pkg: add libb2 (BLAKE2)
This commit is contained in:
parent
1ff945311b
commit
07c0ac81c7
12
pkg/libb2/Makefile
Normal file
12
pkg/libb2/Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
PKG_NAME = libb2
|
||||
PKG_URL = https://github.com/BLAKE2/libb2
|
||||
PKG_VERSION = 60ea749837362c226e8501718f505ab138e5c19d # v0.98
|
||||
PKG_LICENSE = CC0-1.0
|
||||
|
||||
.PHONY: all
|
||||
|
||||
all: git-download
|
||||
"$(MAKE)" -C $(PKG_BUILDDIR)/src \
|
||||
-f $(RIOTPKG)/libb2/Makefile.$(PKG_NAME)
|
||||
|
||||
include $(RIOTBASE)/pkg/pkg.mk
|
||||
2
pkg/libb2/Makefile.include
Normal file
2
pkg/libb2/Makefile.include
Normal file
@ -0,0 +1,2 @@
|
||||
INCLUDES += -I$(PKGDIRBASE)/libb2/src
|
||||
INCLUDES += -I$(RIOTPKG)/libb2/include
|
||||
11
pkg/libb2/Makefile.libb2
Normal file
11
pkg/libb2/Makefile.libb2
Normal file
@ -0,0 +1,11 @@
|
||||
MODULE = libb2
|
||||
|
||||
# Compiling for native triggers this warning
|
||||
CFLAGS += -Wno-unused-function
|
||||
|
||||
SRC := blake2s-ref.c \
|
||||
blake2b-ref.c \
|
||||
blake2sp.c \
|
||||
blake2bp.c
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
37
pkg/libb2/doc.txt
Normal file
37
pkg/libb2/doc.txt
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @defgroup pkg_libb2 BLAKE2 hashing library
|
||||
* @ingroup pkg
|
||||
* @brief C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp
|
||||
|
||||
*
|
||||
* # BLAKE2 RIOT package
|
||||
*
|
||||
* BLAKE2 is a cryptographic hash function specified in RFC 7693.
|
||||
* It claims to be faster than MD5, SHA-1, SHA-2, and SHA-3, yet at least as
|
||||
* secure as the latest standard SHA-3.
|
||||
*
|
||||
* BLAKE2 comes in two flavors:
|
||||
*
|
||||
* - BLAKE2b (or just BLAKE2) is optimized for 64-bit platforms—including NEON-enabled ARMs—and
|
||||
* produces digests of any size between 1 and 64 bytes
|
||||
* - BLAKE2s is optimized for 8- to 32-bit platforms and produces digests of
|
||||
* any size between 1 and 32 bytes
|
||||
*
|
||||
* For more information, see the [BLAKE2 website](https://blake2.net/).
|
||||
*
|
||||
* ## Usage
|
||||
*
|
||||
* Add it as a package in your application's Makefile:
|
||||
*
|
||||
* ```makefile
|
||||
* USEPKG += libb2
|
||||
* ```
|
||||
*
|
||||
* Include the BLAKE2 header in your code:
|
||||
*
|
||||
* ```c
|
||||
* #include "blake2.h"
|
||||
* ```
|
||||
*
|
||||
* @see https://github.com/BLAKE2/libb2
|
||||
*/
|
||||
19
pkg/libb2/include/config.h
Normal file
19
pkg/libb2/include/config.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Add no suffix to the functions */
|
||||
#define SUFFIX
|
||||
|
||||
/* Test for a little-endian machine */
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
#define NATIVE_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_H */
|
||||
Loading…
x
Reference in New Issue
Block a user