[][openwrt][mt7988][fips][Develop gcm ccm tools]

[Description]
Add gcm ccm tools based on openssl api.
This tools is for CAVP test.

[Release-log]
N/A

Change-Id: I4363fa7a2f2d1a75c4c3ee4f445912b0551dc81d
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7512445
diff --git a/feed/openssl-fips-ext/Makefile b/feed/openssl-fips-ext/Makefile
new file mode 100644
index 0000000..8a5b558
--- /dev/null
+++ b/feed/openssl-fips-ext/Makefile
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2021 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openssl-fips-ext
+PKG_RELEASE:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/openssl-fips-ext
+	CATEGORY:=MTK Properties
+	SECTION:=MTK Properties
+	SUBMENU:=Applications
+	TITLE:=openssl-fips-ext -- simple tool for gcm and ccm based on openssl api
+	DEPENDS:= libopenssl
+endef
+
+define Package/openssl-fips-ext/description
+	Simple tool for gcm and ccm
+endef
+
+define Build/Prepare
+	mkdir -p $(PKG_BUILD_DIR)
+	mkdir -p $(PKG_BUILD_DIR)/src
+	$(CP) ./src/* $(PKG_BUILD_DIR)/src
+endef
+
+define Build/Compile
+	make -C ./src \
+		CC="$(TARGET_CC)" \
+		OPENSSL_INCS_LOCATION=-I$(STAGING_DIR)/usr/include/openssl \
+		OPENSSL_LIBS_LOCATION=-L$(STAGING_DIR)/usr/lib
+endef
+
+define Package/openssl-fips-ext/install
+	$(INSTALL_DIR) $(1)/bin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/openssl-fips-ext $(1)/bin/
+endef
+
+$(eval $(call BuildPackage,openssl-fips-ext))
+