Skip to content

Commit

Permalink
CHANGE: replaced the old ECDH and `ECDSA implementation with code f…
Browse files Browse the repository at this point in the history
…rom `mbedTLS`
  • Loading branch information
Oldes committed Jan 18, 2022
1 parent d6db6f5 commit f46f9ba
Show file tree
Hide file tree
Showing 28 changed files with 15,086 additions and 156 deletions.
13 changes: 10 additions & 3 deletions make/rebol3.nest
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,19 @@ include-cryptography: [
core-files: [
%core/n-crypt.c
%core/u-aes.c
%core/u-bigint.c ;needed for RSA abd DH which is needed in TLS protocol (HTTPS)
;%core/deprecated/u-bigint.c ;needed for RSA abd DH which is needed in TLS protocol (HTTPS)
%core/u-chacha20.c
%core/u-dh.c
;%core/deprecated/u-dh.c
%core/u-poly1305.c
%core/u-rc4.c
;%core/deprecated/u-rsa.c
%core/u-uECC.c
;%core/deprecated/u-uECC.c

%core/p-crypt.c
%core/mbedtls/aes.c
%core/mbedtls/asn1parse.c
%core/mbedtls/asn1write.c
%core/mbedtls/dhm.c
%core/mbedtls/md.c
%core/mbedtls/oid.c
%core/mbedtls/bignum.c
Expand All @@ -477,6 +480,10 @@ include-cryptography: [
%core/mbedtls/ctr_drbg.c
%core/mbedtls/entropy.c
%core/mbedtls/entropy_poll.c
%core/mbedtls/ecdh.c
%core/mbedtls/ecdsa.c
%core/mbedtls/ecp.c
%core/mbedtls/ecp_curves.c
]
:include-codec-crt
:include-codec-der
Expand Down
21 changes: 21 additions & 0 deletions src/boot/sysobj.reb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ catalog: object [
]
checksums: [adler32 crc24 crc32 tcp md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd160]
compressions: [gzip deflate zlib lzma crush]
elliptic-curves: [
secp192r1 ; 192-bit curve defined by FIPS 186-4 and SEC1
secp224r1 ; 224-bit curve defined by FIPS 186-4 and SEC1
secp256r1 ; 256-bit curve defined by FIPS 186-4 and SEC1
secp384r1 ; 384-bit curve defined by FIPS 186-4 and SEC1
secp521r1 ; 521-bit curve defined by FIPS 186-4 and SEC1
bp256r1 ; 256-bit Brainpool curve
bp384r1 ; 384-bit Brainpool curve
bp512r1 ; 512-bit Brainpool curve
curve25519 ; Curve25519
secp192k1 ; 192-bit "Koblitz" curve
secp224k1 ; 224-bit "Koblitz" curve
secp256k1 ; 256-bit "Koblitz" curve
curve448 ; Curve448
]
]

contexts: construct [
Expand Down Expand Up @@ -267,6 +282,12 @@ standard: object [
method: none
]

port-spec-crypt: make port-spec-head [
scheme: 'crypt
algorithm: 'aes
direction: 'encrypt
]

port-spec-midi: make port-spec-head [
scheme: 'midi
device-in:
Expand Down
18 changes: 17 additions & 1 deletion src/boot/words.reb
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,20 @@ msdos-datetime
msdos-date
msdos-time
octal-bytes
string-bytes
string-bytes

; group IDs for Elliptic Curves over GF(P) (ECP)
; (in the same order as mbedTLS's `mbedtls_ecp_group_id` enumeration)
secp192r1 ; 192-bit curve defined by FIPS 186-4 and SEC1
secp224r1 ; 224-bit curve defined by FIPS 186-4 and SEC1
secp256r1 ; 256-bit curve defined by FIPS 186-4 and SEC1
secp384r1 ; 384-bit curve defined by FIPS 186-4 and SEC1
secp521r1 ; 521-bit curve defined by FIPS 186-4 and SEC1
bp256r1 ; 256-bit Brainpool curve
bp384r1 ; 384-bit Brainpool curve
bp512r1 ; 512-bit Brainpool curve
curve25519 ; Curve25519
secp192k1 ; 192-bit "Koblitz" curve
secp224k1 ; 224-bit "Koblitz" curve
secp256k1 ; 256-bit "Koblitz" curve
curve448 ; Curve448
File renamed without changes.
Loading

0 comments on commit f46f9ba

Please sign in to comment.