Commit 3d882457

3d882457de02Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 5 files · +4 added · ~1 modified

Description

Merge pull request #514 from OriPekelman/add-sp-crypto

Add sp_crypto.{c,h} -- compact SHA-256 / HMAC / PBKDF2 / B64URL / CSPRNG

Resolved against master changes (cls_ivar_nil_checked from #497, sp_re_rindex and string-runtime tweaks from #504/#505/#510/#511). Merge commit is clean; only sp_crypto.{c,h} and the test fixture land. CSPRNG path on Windows MinGW was extended in 417fb08 to use BCryptGenRandom via runtime LoadLibrary -- the PR's original fallback returned identical bytes across calls within the same second and tripped the test's "two random outputs must differ" invariant on the windows-mingw CI job.

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
3d882457de02
Parent
f968c231f600
Merge parent
bbd20e3e498d

MakefilemodifiedView file

@@ -204,9 +204,13 @@
204204 @mkdir -p build
205205 $(CC) -c -O2 -Wno-all $(SEC_FLAGS) -Ilib lib/sp_bigint.c -o build/sp_bigint.o
206206
207+build/sp_crypto.o: lib/sp_crypto.c lib/sp_crypto.h
208+ @mkdir -p build
209+ $(CC) -c -O2 -Wno-all $(SEC_FLAGS) -Ilib lib/sp_crypto.c -o build/sp_crypto.o
210+
207211 SP_RT_LIB = lib/libspinel_rt.a
208212
209-$(SP_RT_LIB): $(RE_OBJ) build/sp_bigint.o
213+$(SP_RT_LIB): $(RE_OBJ) build/sp_bigint.o build/sp_crypto.o
210214 ar rcs $@ $^
211215
212216 regexp: $(SP_RT_LIB)