Skip to content

Commit 2f24e6d

Browse files
authored
Merge pull request #371 from tmael/file_enc
Add AES GCM file encryptions
2 parents 1dc3eaf + 1913b94 commit 2f24e6d

5 files changed

Lines changed: 1150 additions & 4 deletions

File tree

crypto/aes/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CC=gcc
22
CFLAGS=-Wall
3-
LIBS= -lwolfssl
3+
LIBS= -lwolfssl -lm
44

5-
all: aes-file-encrypt aescfb-file-encrypt aesctr-file-encrypt
5+
all: aes-file-encrypt aescfb-file-encrypt aesctr-file-encrypt aesgcm-file-encrypt
66

77
aes-file-encrypt: aes-file-encrypt.o
88
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
@@ -13,7 +13,10 @@ aescfb-file-encrypt: aescfb-file-encrypt.o
1313
aesctr-file-encrypt: aesctr-file-encrypt.o
1414
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
1515

16+
aesgcm-file-encrypt: aesgcm-file-encrypt.o
17+
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
18+
1619
.PHONY: clean
1720

1821
clean:
19-
rm -f *.o aes-file-encrypt aescfb-file-encrypt aesctr-file-encrypt
22+
rm -f *.o aes-file-encrypt aescfb-file-encrypt aesctr-file-encrypt aesgcm-file-encrypt text*

crypto/aes/aes-file-encrypt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@
2222
#include <stdio.h>
2323
#include <unistd.h>
2424
#include <termios.h>
25-
#include <wolfssl/options.h>
25+
26+
#ifndef WOLFSSL_USER_SETTINGS
27+
#include <wolfssl/options.h>
28+
#endif
29+
#include <wolfssl/wolfcrypt/settings.h>
2630
#include <wolfssl/wolfcrypt/aes.h>
2731
#include <wolfssl/wolfcrypt/sha256.h>
2832
#include <wolfssl/wolfcrypt/random.h>
2933
#include <wolfssl/wolfcrypt/pwdbased.h>
3034

3135
#if defined(HAVE_PBKDF2) && !defined(NO_PWDBASED)
36+
3237
#define SALT_SIZE 8
3338

3439
/*

0 commit comments

Comments
 (0)