Libraries and vanity, as always
Juniper Beatitudes [email protected]
Thu, 01 Jan 2026 13:24:58 -0600
4 files changed,
25 insertions(+),
14 deletions(-)
M
.gitignore
→
.gitignore
@@ -52,6 +52,7 @@ Module.symvers
Mkfile.old dkms.conf -build/test-main +test-main .cache/ -compile_commands.json+compile_commands.json +lib/
M
Makefile
→
Makefile
@@ -1,13 +1,25 @@
-CC ?= gcc +CC ?= clang +AR ?= ar INCLUDE_PATH := . -SOURCE_FILES := tinycrypt/*.c +SOURCE_FILES := $(wildcard tinycrypt/*.c) +SOURCE_OBJECTS := $(SOURCE_FILES:tinycrypt/%.c=lib/%.o) TEST_SOURCE_FILES := tinycrypt/tests/*.c +COMPILER_OPTS := -O3 -ffreestanding -std=c99 -build/test-main: $(SOURCE_FILES) $(TEST_SOURCE_FILES) - @ $(CC) -o build/test-main -I$(INCLUDE_PATH) $(SOURCE_FILES) $(TEST_SOURCE_FILES) +test-main: $(SOURCE_OBJECTS) $(TEST_SOURCE_FILES) + @ $(CC) -o test-main -O3 -I$(INCLUDE_PATH) $(SOURCE_FILES) $(TEST_SOURCE_FILES) -tests: build/test-main - @ ./build/test-main +tests: test-main + @ ./test-main + +memcheck: test-main + @ valgrind ./test-main -memcheck: build/test-main - @ valgrind ./build/test-main+lib/%.o: tinycrypt/%.c + @ $(CC) -c $(COMPILER_OPTS) -I$(INCLUDE_PATH) $< -o $@ + +lib: $(SOURCE_OBJECTS) + @ $(AR) rcs lib/libtinycrypt.a lib/*.o + +clean: + rm lib/*.o test-main
M
tinycrypt/ed25519.c
→
tinycrypt/ed25519.c
@@ -1,6 +1,5 @@
#include <stdbool.h> #include <stdint.h> -#include <string.h> #include "tinycrypt/sha2.h" #include "tinycrypt/ed25519.h"@@ -150,8 +149,6 @@ h[i] = 255 - (acc & 0xFF);
acc >>= 8; } } - -#include <stdio.h> static bool greater264 (const uint8_t *a, const uint8_t *b)