Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apisupport: add & use LIBCRYPTO-LOW_LEVEL_AES #386

Merged
merged 1 commit into from
May 9, 2024
Merged
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
7 changes: 6 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ scrypt_SOURCES= main.c \
lib/util/passphrase_entry.c \
lib/util/passphrase_entry.h \
lib-platform/util/memlimit.h \
libcperciva/crypto/crypto_aes.c \
libcperciva/crypto/crypto_aes.h \
libcperciva/crypto/crypto_aes_aesni.h \
libcperciva/crypto/crypto_aes_aesni_m128i.h \
Expand Down Expand Up @@ -101,6 +100,7 @@ AM_CPPFLAGS= -I$(srcdir)/lib \
scrypt_LDADD= libcperciva_aesni.la libcperciva_rdrand.la \
libcperciva_shani.la libscrypt_sse2.la \
libscrypt_memlimit.la \
libscrypt_crypto_aes.la \
libcperciva_arm_sha256.la \
libcperciva_arm_aes.la \
${LDADD_POSIX}
Expand Down Expand Up @@ -159,6 +159,11 @@ libscrypt_memlimit_la_SOURCES= lib-platform/util/memlimit.c \
lib-platform/util/memlimit.h
libscrypt_memlimit_la_CFLAGS=`. ./apisupport-config.h; echo $${CFLAGS_NONPOSIX_MEMLIMIT}`

noinst_LTLIBRARIES+= libscrypt_crypto_aes.la
libscrypt_crypto_aes_la_SOURCES= libcperciva/crypto/crypto_aes.c \
libcperciva/crypto/crypto_aes.h
libscrypt_crypto_aes_la_CFLAGS=`. ./apisupport-config.h; echo $${CFLAGS_LIBCRYPTO_LOW_LEVEL_AES}`

# Install libscrypt-kdf?
if LIBSCRYPT_KDF
lib_LTLIBRARIES= libscrypt-kdf.la
Expand Down
15 changes: 15 additions & 0 deletions libcperciva/apisupport/Build/apisupport-LIBCRYPTO-LOW_LEVEL_AES.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <stdint.h>

#include <openssl/aes.h>

int
main(void)
{
AES_KEY kexp_actual;
const uint8_t key_unexpanded[16] = { 0 };

AES_set_encrypt_key(key_unexpanded, 128, &kexp_actual);

/* Success! */
return (0);
}
4 changes: 4 additions & 0 deletions libcperciva/crypto/crypto_aes.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* APISUPPORT CFLAGS: LIBCRYPTO_LOW_LEVEL_AES
*/

#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
Loading