Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1581,8 +1581,8 @@ $(LIBHACL_BLAKE2_LIB_STATIC): $(LIBHACL_BLAKE2_OBJS)

Modules/_hacl/Hacl_HMAC.o: $(srcdir)/Modules/_hacl/Hacl_HMAC.c $(LIBHACL_HMAC_HEADERS)
$(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_HMAC.c
Modules/_hacl/Hacl_Streaming_HMAC.o: $(srcdir)/Modules/_hacl/Hacl_Streaming_HMAC.c $(LIBHACL_HMAC_HEADERS)
$(CC) -Wno-unused-variable -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Streaming_HMAC.c
Modules/_hacl/Hacl_Streaming_HMAC.o: $(srcdir)/Modules/_hacl/_hmac_hacl.c $(srcdir)/Modules/_hacl/Hacl_Streaming_HMAC.c $(LIBHACL_HMAC_HEADERS)
$(CC) -Wno-unused-variable -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/_hmac_hacl.c
$(LIBHACL_HMAC_LIB_STATIC): $(LIBHACL_HMAC_OBJS)
-rm -f $@
$(AR) $(ARFLAGS) $@ $(LIBHACL_HMAC_OBJS)
Expand Down
1 change: 1 addition & 0 deletions Modules/_hacl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ changes needed, work with the upstream repository.

## Local files

* [_hmac_hacl.c](_hmac_hacl.c)
* [python_hacl_namespaces.h](python_hacl_namespaces.h)
* [README.md](README.md)
* [refresh.sh](refresh.sh)
Expand Down
11 changes: 11 additions & 0 deletions Modules/_hacl/_hmac_hacl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Compile the HACL* streaming HMAC implementation with explicit SIMD defaults. */
#include "internal/Hacl_Streaming_HMAC.h"

#ifndef HACL_CAN_COMPILE_VEC128
# define HACL_CAN_COMPILE_VEC128 0
#endif
#ifndef HACL_CAN_COMPILE_VEC256
# define HACL_CAN_COMPILE_VEC256 0
#endif

#include "Hacl_Streaming_HMAC.c"
2 changes: 1 addition & 1 deletion PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
<ClCompile Include="..\Modules\_hacl\Hacl_Hash_SHA2.c" />
<ClCompile Include="..\Modules\_hacl\Hacl_Hash_SHA3.c" />
<ClCompile Include="..\Modules\_hacl\Hacl_HMAC.c" />
<ClCompile Include="..\Modules\_hacl\Hacl_Streaming_HMAC.c" />
<ClCompile Include="..\Modules\_hacl\_hmac_hacl.c" />
<ClCompile Include="..\Modules\_hacl\Lib_Memzero0.c" />
<ClCompile Include="..\Modules\_hacl\Hacl_Hash_Blake2b.c" />
<ClCompile Include="..\Modules\_hacl\Hacl_Hash_Blake2s.c" />
Expand Down
2 changes: 1 addition & 1 deletion PCbuild/pythoncore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@
<ClCompile Include="..\Modules\_hacl\Hacl_HMAC.c">
<Filter>Modules</Filter>
</ClCompile>
<ClCompile Include="..\Modules\_hacl\Hacl_Streaming_HMAC.c">
<ClCompile Include="..\Modules\_hacl\_hmac_hacl.c">
<Filter>Modules</Filter>
</ClCompile>
<ClCompile Include="..\Modules\_heapqmodule.c">
Expand Down
1 change: 1 addition & 0 deletions Tools/build/generate_sbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class PackageFiles(typing.NamedTuple):
exclude=[
"Modules/_hacl/refresh.sh",
"Modules/_hacl/README.md",
"Modules/_hacl/_hmac_hacl.c",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can name it hmac_defines.c I guess. But i wonder if this is the right solution eventually. Why not changing the non-vendored sources to specify explicitly the values of the defines and ignore the -Wundef flag for _hacl sources?

If necessary, we can also add some .h file instead of a .c file which defines the macros and is included by .c files in hacl. I think it is cleaner than creating this fake .c file (I alao think the approach is wrong actually; the .c files looks like a ugly hack)

"Modules/_hacl/python_hacl_namespace.h",
]
),
Expand Down
Loading