Skip to content

Commit d70bab1

Browse files
committed
FEAT: fine-tunning what crypto features are included in base/core/bulk builds
1 parent 125fcec commit d70bab1

File tree

2 files changed

+45
-32
lines changed

2 files changed

+45
-32
lines changed

make/rebol3.nest

+45-19
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,25 @@ include-cryptography: [
552552
; so far cca 183kB uncompressed (basic AES, all ellyptic curves, rsa, rc4, bignum, entropy )
553553
config: INCLUDE_CRYPTOGRAPHY
554554

555+
define: MBEDTLS_ASN1_PARSE_C ; The generic ASN1 parser.
556+
define: MBEDTLS_ASN1_WRITE_C ; The generic ASN1 writer.
557+
558+
define: MBEDTLS_CTR_DRBG_C ; The CTR_DRBG AES-based random generator.
559+
560+
define: MBEDTLS_AES_C ; The AES block cipher.
561+
define: MBEDTLS_DHM_C ; The Diffie-Hellman-Merkle module.
562+
define: MBEDTLS_ECDSA_C ; The elliptic curve DSA library.
563+
define: MBEDTLS_ECP_C ; The elliptic curve over GF(p) library.
564+
define: MBEDTLS_ECDH_C ; The elliptic curve Diffie-Hellman library.
565+
define: MBEDTLS_BIGNUM_C ; The multi-precision integer library. Required for: RSA, ECDSA, ECP, DHM
566+
define: MBEDTLS_ENTROPY_C ; The platform-specific entropy code.
567+
define: MBEDTLS_OID_C
568+
define: MBEDTLS_PKCS1_V15
569+
555570
core-files: [
556571
%core/n-crypt.c
557-
558-
;%core/deprecated/u-bigint.c ;needed for RSA abd DH which is needed in TLS protocol (HTTPS)
559-
;%core/deprecated/u-dh.c
560-
;%core/u-poly1305.c
561-
562-
;%core/deprecated/u-rsa.c
563-
;%core/deprecated/u-uECC.c
564-
565572
%core/p-crypt.c
573+
566574
%core/mbedtls/aes.c
567575
%core/mbedtls/asn1parse.c
568576
%core/mbedtls/asn1write.c
@@ -582,29 +590,44 @@ include-cryptography: [
582590
]
583591

584592
:include-curves-sec1
593+
594+
:include-rsa
595+
596+
:include-cipher-mode-gcm ; By default just GCM as it is the most secure.
597+
598+
:include-codec-crt
599+
:include-codec-der
600+
:include-codec-pkix
601+
:include-codec-ppk
602+
:include-codec-ssh-key
603+
]
604+
605+
include-cryptography-bulk: [
585606
:include-curves-koblitz
586607
:include-curves-brainpool
587608
:include-curves-x
588609

589-
:include-rsa
610+
:include-cipher-mode-ccm
611+
:include-cipher-mode-cbc
612+
590613
:include-rc4
591614

592615
:include-cipher-aria
593616
:include-cipher-camelia
594617
:include-cipher-chacha20
595618
:include-cipher-chachapoly
596-
:include-cipher-mode-cbc
597-
:include-cipher-mode-ccm
598-
:include-cipher-mode-gcm
619+
]
599620

600-
;:include-deprecated-cipher-chacha20
601-
;:include-deprecated-cipher-aes
621+
include-cryptography-deprecated: [
622+
;@@ This should not be used anymore, but keeping it here just in case...
623+
%core/deprecated/u-bigint.c ;needed for RSA abd DH which is needed in TLS protocol (HTTPS)
624+
%core/deprecated/u-dh.c
625+
%core/deprecated/u-poly1305.c
626+
%core/deprecated/u-rsa.c
627+
%core/deprecated/u-uECC.c
602628

603-
:include-codec-crt
604-
:include-codec-der
605-
:include-codec-pkix
606-
:include-codec-ppk
607-
:include-codec-ssh-key
629+
:include-deprecated-cipher-chacha20
630+
:include-deprecated-cipher-aes
608631
]
609632

610633
;- native additional checksums:
@@ -763,6 +786,9 @@ include-rebol-bulk: [
763786
:include-view
764787
:include-midi
765788

789+
; Extended crypto features
790+
:include-cryptography-bulk
791+
766792
:include-codec-pdf
767793
:include-codec-swf
768794
:include-codec-gzip

src/include/opt-dependencies.h

-13
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@
4949
#ifdef INCLUDE_RSA
5050
#define MBEDTLS_RSA_C
5151
#endif
52-
#define MBEDTLS_BIGNUM_C
53-
#define MBEDTLS_PKCS1_V15
54-
#define MBEDTLS_OID_C
55-
#define MBEDTLS_ENTROPY_C
56-
#define MBEDTLS_AES_C
57-
#define MBEDTLS_DHM_C
58-
#define MBEDTLS_CTR_DRBG_C
59-
#define MBEDTLS_ECDH_C
60-
#define MBEDTLS_ECP_C
61-
#define MBEDTLS_ECDSA_C
62-
#define MBEDTLS_ASN1_PARSE_C
63-
#define MBEDTLS_ASN1_WRITE_C
64-
6552

6653
#define MBEDTLS_CIPHER_C
6754

0 commit comments

Comments
 (0)