Added stand-alone RSA/PSS implementation.
[BearSSL] / mk / mkrules.sh
index 26f8546..71ce676 100755 (executable)
@@ -49,6 +49,9 @@ set -e
 
 # Source files. Please keep in alphabetical order.
 coresrc=" \
 
 # Source files. Please keep in alphabetical order.
 coresrc=" \
+       src/settings.c \
+       src/aead/ccm.c \
+       src/aead/eax.c \
        src/aead/gcm.c \
        src/codec/ccopy.c \
        src/codec/dec16be.c \
        src/aead/gcm.c \
        src/codec/ccopy.c \
        src/codec/dec16be.c \
@@ -64,6 +67,7 @@ coresrc=" \
        src/codec/enc64be.c \
        src/codec/enc64le.c \
        src/codec/pemdec.c \
        src/codec/enc64be.c \
        src/codec/enc64le.c \
        src/codec/pemdec.c \
+       src/codec/pemenc.c \
        src/ec/ec_all_m15.c \
        src/ec/ec_all_m31.c \
        src/ec/ec_c25519_i15.c \
        src/ec/ec_all_m15.c \
        src/ec/ec_all_m31.c \
        src/ec/ec_c25519_i15.c \
@@ -72,10 +76,12 @@ coresrc=" \
        src/ec/ec_c25519_m31.c \
        src/ec/ec_curve25519.c \
        src/ec/ec_default.c \
        src/ec/ec_c25519_m31.c \
        src/ec/ec_curve25519.c \
        src/ec/ec_default.c \
+       src/ec/ec_keygen.c \
        src/ec/ec_p256_m15.c \
        src/ec/ec_p256_m31.c \
        src/ec/ec_prime_i15.c \
        src/ec/ec_prime_i31.c \
        src/ec/ec_p256_m15.c \
        src/ec/ec_p256_m31.c \
        src/ec/ec_prime_i15.c \
        src/ec/ec_prime_i31.c \
+       src/ec/ec_pubkey.c \
        src/ec/ec_secp256r1.c \
        src/ec/ec_secp384r1.c \
        src/ec/ec_secp521r1.c \
        src/ec/ec_secp256r1.c \
        src/ec/ec_secp384r1.c \
        src/ec/ec_secp521r1.c \
@@ -104,6 +110,7 @@ coresrc=" \
        src/hash/ghash_pwr8.c \
        src/hash/md5.c \
        src/hash/md5sha1.c \
        src/hash/ghash_pwr8.c \
        src/hash/md5.c \
        src/hash/md5sha1.c \
+       src/hash/mgf1.c \
        src/hash/multihash.c \
        src/hash/sha1.c \
        src/hash/sha2big.c \
        src/hash/multihash.c \
        src/hash/sha1.c \
        src/hash/sha2big.c \
@@ -116,6 +123,7 @@ coresrc=" \
        src/int/i15_encode.c \
        src/int/i15_fmont.c \
        src/int/i15_iszero.c \
        src/int/i15_encode.c \
        src/int/i15_fmont.c \
        src/int/i15_iszero.c \
+       src/int/i15_moddiv.c \
        src/int/i15_modpow.c \
        src/int/i15_modpow2.c \
        src/int/i15_montmul.c \
        src/int/i15_modpow.c \
        src/int/i15_modpow2.c \
        src/int/i15_montmul.c \
@@ -134,6 +142,7 @@ coresrc=" \
        src/int/i31_encode.c \
        src/int/i31_fmont.c \
        src/int/i31_iszero.c \
        src/int/i31_encode.c \
        src/int/i31_fmont.c \
        src/int/i31_iszero.c \
+       src/int/i31_moddiv.c \
        src/int/i31_modpow.c \
        src/int/i31_modpow2.c \
        src/int/i31_montmul.c \
        src/int/i31_modpow.c \
        src/int/i31_modpow2.c \
        src/int/i31_montmul.c \
@@ -162,31 +171,73 @@ coresrc=" \
        src/int/i32_sub.c \
        src/int/i32_tmont.c \
        src/int/i62_modpow2.c \
        src/int/i32_sub.c \
        src/int/i32_tmont.c \
        src/int/i62_modpow2.c \
+       src/kdf/hkdf.c \
+       src/kdf/shake.c \
        src/mac/hmac.c \
        src/mac/hmac_ct.c \
        src/mac/hmac.c \
        src/mac/hmac_ct.c \
+       src/rand/aesctr_drbg.c \
        src/rand/hmac_drbg.c \
        src/rand/hmac_drbg.c \
+       src/rand/sysrng.c \
+       src/rsa/rsa_default_keygen.c \
+       src/rsa/rsa_default_modulus.c \
+       src/rsa/rsa_default_oaep_decrypt.c \
+       src/rsa/rsa_default_oaep_encrypt.c \
        src/rsa/rsa_default_pkcs1_sign.c \
        src/rsa/rsa_default_pkcs1_vrfy.c \
        src/rsa/rsa_default_priv.c \
        src/rsa/rsa_default_pkcs1_sign.c \
        src/rsa/rsa_default_pkcs1_vrfy.c \
        src/rsa/rsa_default_priv.c \
+       src/rsa/rsa_default_privexp.c \
+       src/rsa/rsa_default_pss_sign.c \
+       src/rsa/rsa_default_pss_vrfy.c \
        src/rsa/rsa_default_pub.c \
        src/rsa/rsa_default_pub.c \
+       src/rsa/rsa_default_pubexp.c \
+       src/rsa/rsa_i15_keygen.c \
+       src/rsa/rsa_i15_modulus.c \
+       src/rsa/rsa_i15_oaep_decrypt.c \
+       src/rsa/rsa_i15_oaep_encrypt.c \
        src/rsa/rsa_i15_pkcs1_sign.c \
        src/rsa/rsa_i15_pkcs1_vrfy.c \
        src/rsa/rsa_i15_priv.c \
        src/rsa/rsa_i15_pkcs1_sign.c \
        src/rsa/rsa_i15_pkcs1_vrfy.c \
        src/rsa/rsa_i15_priv.c \
+       src/rsa/rsa_i15_privexp.c \
+       src/rsa/rsa_i15_pss_sign.c \
+       src/rsa/rsa_i15_pss_vrfy.c \
        src/rsa/rsa_i15_pub.c \
        src/rsa/rsa_i15_pub.c \
+       src/rsa/rsa_i15_pubexp.c \
+       src/rsa/rsa_i31_keygen.c \
+       src/rsa/rsa_i31_keygen_inner.c \
+       src/rsa/rsa_i31_modulus.c \
+       src/rsa/rsa_i31_oaep_decrypt.c \
+       src/rsa/rsa_i31_oaep_encrypt.c \
        src/rsa/rsa_i31_pkcs1_sign.c \
        src/rsa/rsa_i31_pkcs1_vrfy.c \
        src/rsa/rsa_i31_priv.c \
        src/rsa/rsa_i31_pkcs1_sign.c \
        src/rsa/rsa_i31_pkcs1_vrfy.c \
        src/rsa/rsa_i31_priv.c \
+       src/rsa/rsa_i31_privexp.c \
+       src/rsa/rsa_i31_pss_sign.c \
+       src/rsa/rsa_i31_pss_vrfy.c \
        src/rsa/rsa_i31_pub.c \
        src/rsa/rsa_i31_pub.c \
+       src/rsa/rsa_i31_pubexp.c \
+       src/rsa/rsa_i32_oaep_decrypt.c \
+       src/rsa/rsa_i32_oaep_encrypt.c \
        src/rsa/rsa_i32_pkcs1_sign.c \
        src/rsa/rsa_i32_pkcs1_vrfy.c \
        src/rsa/rsa_i32_priv.c \
        src/rsa/rsa_i32_pkcs1_sign.c \
        src/rsa/rsa_i32_pkcs1_vrfy.c \
        src/rsa/rsa_i32_priv.c \
+       src/rsa/rsa_i32_pss_sign.c \
+       src/rsa/rsa_i32_pss_vrfy.c \
        src/rsa/rsa_i32_pub.c \
        src/rsa/rsa_i32_pub.c \
+       src/rsa/rsa_i62_keygen.c \
+       src/rsa/rsa_i62_oaep_decrypt.c \
+       src/rsa/rsa_i62_oaep_encrypt.c \
        src/rsa/rsa_i62_pkcs1_sign.c \
        src/rsa/rsa_i62_pkcs1_vrfy.c \
        src/rsa/rsa_i62_priv.c \
        src/rsa/rsa_i62_pkcs1_sign.c \
        src/rsa/rsa_i62_pkcs1_vrfy.c \
        src/rsa/rsa_i62_priv.c \
+       src/rsa/rsa_i62_pss_sign.c \
+       src/rsa/rsa_i62_pss_vrfy.c \
        src/rsa/rsa_i62_pub.c \
        src/rsa/rsa_i62_pub.c \
+       src/rsa/rsa_oaep_pad.c \
+       src/rsa/rsa_oaep_unpad.c \
        src/rsa/rsa_pkcs1_sig_pad.c \
        src/rsa/rsa_pkcs1_sig_unpad.c \
        src/rsa/rsa_pkcs1_sig_pad.c \
        src/rsa/rsa_pkcs1_sig_unpad.c \
+       src/rsa/rsa_pss_sig_pad.c \
+       src/rsa/rsa_pss_sig_unpad.c \
        src/rsa/rsa_ssl_decrypt.c \
        src/ssl/prf.c \
        src/ssl/prf_md5sha1.c \
        src/rsa/rsa_ssl_decrypt.c \
        src/ssl/prf.c \
        src/ssl/prf_md5sha1.c \
@@ -199,6 +250,7 @@ coresrc=" \
        src/ssl/ssl_client_full.c \
        src/ssl/ssl_engine.c \
        src/ssl/ssl_engine_default_aescbc.c \
        src/ssl/ssl_client_full.c \
        src/ssl/ssl_engine.c \
        src/ssl/ssl_engine_default_aescbc.c \
+       src/ssl/ssl_engine_default_aesccm.c \
        src/ssl/ssl_engine_default_aesgcm.c \
        src/ssl/ssl_engine_default_chapol.c \
        src/ssl/ssl_engine_default_descbc.c \
        src/ssl/ssl_engine_default_aesgcm.c \
        src/ssl/ssl_engine_default_chapol.c \
        src/ssl/ssl_engine_default_descbc.c \
@@ -212,6 +264,7 @@ coresrc=" \
        src/ssl/ssl_keyexport.c \
        src/ssl/ssl_lru.c \
        src/ssl/ssl_rec_cbc.c \
        src/ssl/ssl_keyexport.c \
        src/ssl/ssl_lru.c \
        src/ssl/ssl_rec_cbc.c \
+       src/ssl/ssl_rec_ccm.c \
        src/ssl/ssl_rec_chapol.c \
        src/ssl/ssl_rec_gcm.c \
        src/ssl/ssl_scert_single_ec.c \
        src/ssl/ssl_rec_chapol.c \
        src/ssl/ssl_rec_gcm.c \
        src/ssl/ssl_scert_single_ec.c \
@@ -229,6 +282,7 @@ coresrc=" \
        src/symcipher/aes_big_cbcdec.c \
        src/symcipher/aes_big_cbcenc.c \
        src/symcipher/aes_big_ctr.c \
        src/symcipher/aes_big_cbcdec.c \
        src/symcipher/aes_big_cbcenc.c \
        src/symcipher/aes_big_ctr.c \
+       src/symcipher/aes_big_ctrcbc.c \
        src/symcipher/aes_big_dec.c \
        src/symcipher/aes_big_enc.c \
        src/symcipher/aes_common.c \
        src/symcipher/aes_big_dec.c \
        src/symcipher/aes_big_enc.c \
        src/symcipher/aes_common.c \
@@ -237,26 +291,31 @@ coresrc=" \
        src/symcipher/aes_ct64_cbcdec.c \
        src/symcipher/aes_ct64_cbcenc.c \
        src/symcipher/aes_ct64_ctr.c \
        src/symcipher/aes_ct64_cbcdec.c \
        src/symcipher/aes_ct64_cbcenc.c \
        src/symcipher/aes_ct64_ctr.c \
+       src/symcipher/aes_ct64_ctrcbc.c \
        src/symcipher/aes_ct64_dec.c \
        src/symcipher/aes_ct64_enc.c \
        src/symcipher/aes_ct_cbcdec.c \
        src/symcipher/aes_ct_cbcenc.c \
        src/symcipher/aes_ct_ctr.c \
        src/symcipher/aes_ct64_dec.c \
        src/symcipher/aes_ct64_enc.c \
        src/symcipher/aes_ct_cbcdec.c \
        src/symcipher/aes_ct_cbcenc.c \
        src/symcipher/aes_ct_ctr.c \
+       src/symcipher/aes_ct_ctrcbc.c \
        src/symcipher/aes_ct_dec.c \
        src/symcipher/aes_ct_enc.c \
        src/symcipher/aes_pwr8.c \
        src/symcipher/aes_pwr8_cbcdec.c \
        src/symcipher/aes_pwr8_cbcenc.c \
        src/symcipher/aes_pwr8_ctr.c \
        src/symcipher/aes_ct_dec.c \
        src/symcipher/aes_ct_enc.c \
        src/symcipher/aes_pwr8.c \
        src/symcipher/aes_pwr8_cbcdec.c \
        src/symcipher/aes_pwr8_cbcenc.c \
        src/symcipher/aes_pwr8_ctr.c \
+       src/symcipher/aes_pwr8_ctrcbc.c \
        src/symcipher/aes_small_cbcdec.c \
        src/symcipher/aes_small_cbcenc.c \
        src/symcipher/aes_small_ctr.c \
        src/symcipher/aes_small_cbcdec.c \
        src/symcipher/aes_small_cbcenc.c \
        src/symcipher/aes_small_ctr.c \
+       src/symcipher/aes_small_ctrcbc.c \
        src/symcipher/aes_small_dec.c \
        src/symcipher/aes_small_enc.c \
        src/symcipher/aes_x86ni.c \
        src/symcipher/aes_x86ni_cbcdec.c \
        src/symcipher/aes_x86ni_cbcenc.c \
        src/symcipher/aes_x86ni_ctr.c \
        src/symcipher/aes_small_dec.c \
        src/symcipher/aes_small_enc.c \
        src/symcipher/aes_x86ni.c \
        src/symcipher/aes_x86ni_cbcdec.c \
        src/symcipher/aes_x86ni_cbcenc.c \
        src/symcipher/aes_x86ni_ctr.c \
+       src/symcipher/aes_x86ni_ctrcbc.c \
        src/symcipher/chacha20_ct.c \
        src/symcipher/chacha20_sse2.c \
        src/symcipher/des_ct.c \
        src/symcipher/chacha20_ct.c \
        src/symcipher/chacha20_sse2.c \
        src/symcipher/des_ct.c \
@@ -270,6 +329,11 @@ coresrc=" \
        src/symcipher/poly1305_ctmul32.c \
        src/symcipher/poly1305_ctmulq.c \
        src/symcipher/poly1305_i15.c \
        src/symcipher/poly1305_ctmul32.c \
        src/symcipher/poly1305_ctmulq.c \
        src/symcipher/poly1305_i15.c \
+       src/x509/asn1enc.c \
+       src/x509/encode_ec_pk8der.c \
+       src/x509/encode_ec_rawder.c \
+       src/x509/encode_rsa_pk8der.c \
+       src/x509/encode_rsa_rawder.c \
        src/x509/skey_decoder.c \
        src/x509/x509_decoder.c \
        src/x509/x509_knownkey.c \
        src/x509/skey_decoder.c \
        src/x509/x509_decoder.c \
        src/x509/x509_knownkey.c \
@@ -284,6 +348,7 @@ toolssrc=" \
        tools/client.c \
        tools/errors.c \
        tools/files.c \
        tools/client.c \
        tools/errors.c \
        tools/files.c \
+       tools/impl.c \
        tools/keys.c \
        tools/names.c \
        tools/server.c \
        tools/keys.c \
        tools/names.c \
        tools/server.c \
@@ -315,6 +380,7 @@ headerspub=" \
        inc/bearssl_ec.h \
        inc/bearssl_hash.h \
        inc/bearssl_hmac.h \
        inc/bearssl_ec.h \
        inc/bearssl_hash.h \
        inc/bearssl_hmac.h \
+       inc/bearssl_kdf.h \
        inc/bearssl_pem.h \
        inc/bearssl_prf.h \
        inc/bearssl_rand.h \
        inc/bearssl_pem.h \
        inc/bearssl_prf.h \
        inc/bearssl_rand.h \
@@ -382,23 +448,23 @@ EOF
 
 (printf "\nOBJ ="
 for f in $coresrc ; do
 
 (printf "\nOBJ ="
 for f in $coresrc ; do
-       printf ' $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
+       printf ' \\\n $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
 done
 printf "\nOBJBRSSL ="
 for f in $toolssrc ; do
 done
 printf "\nOBJBRSSL ="
 for f in $toolssrc ; do
-       printf ' $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
+       printf ' \\\n $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
 done
 printf "\nOBJTESTCRYPTO ="
 for f in $testcryptosrc ; do
 done
 printf "\nOBJTESTCRYPTO ="
 for f in $testcryptosrc ; do
-       printf ' $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
+       printf ' \\\n $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
 done
 printf "\nOBJTESTSPEED ="
 for f in $testspeedsrc ; do
 done
 printf "\nOBJTESTSPEED ="
 for f in $testspeedsrc ; do
-       printf ' $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
+       printf ' \\\n $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
 done
 printf "\nOBJTESTX509 ="
 for f in $testx509src ; do
 done
 printf "\nOBJTESTX509 ="
 for f in $testx509src ; do
-       printf ' $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
+       printf ' \\\n $(OBJDIR)$P%s' "$(basename "$f" .c)\$O"
 done
 printf "\nHEADERSPUB ="
 for f in $headerspub ; do
 done
 printf "\nHEADERSPUB ="
 for f in $headerspub ; do