Matter smart home protocol implementation for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

matter: Replace mirage-crypto with monorepo crypto packages

- Update dune-project: mirage-crypto -> crypto
- Update lib/dune: mirage-crypto -> crypto
- Rename lib/crypto.ml -> lib/aes_ccm.ml to avoid name shadowing
- Update module references: Crypto.* -> Aes_ccm.* in case.ml, pase.ml
- Module now uses Crypto.AES.CCM16 from crypto package

+9 -9
+1 -1
dune-project
··· 27 27 (kdf (>= 0.1)) 28 28 (mdns (>= 0.1)) 29 29 (spake2 (>= 0.1)) 30 - (mirage-crypto (>= 1.0)) 30 + crypto 31 31 (cstruct (>= 6.0)) 32 32 (ipaddr (>= 5.0)) 33 33 (domain-name (>= 0.4))
+1 -1
lib/aes_ccm.ml
··· 21 21 - 13-byte nonce for messages, 12-byte for CASE *) 22 22 23 23 module Aes_ccm = struct 24 - module AES_CCM = Mirage_crypto.AES.CCM16 24 + module AES_CCM = Crypto.AES.CCM16 25 25 26 26 (** Encrypt with AES-128-CCM-128 (16-byte tag) *) 27 27 let encrypt ~key ~nonce ~adata plaintext =
+2 -2
lib/case.ml
··· 148 148 149 149 (** Encrypt with AES-128-CCM *) 150 150 let aes_ccm_encrypt ~key ~nonce ~adata plaintext = 151 - Crypto.Aes_ccm.encrypt ~key ~nonce ~adata plaintext 151 + Aes_ccm.Aes_ccm.encrypt ~key ~nonce ~adata plaintext 152 152 153 153 (** Decrypt with AES-128-CCM *) 154 154 let aes_ccm_decrypt ~key ~nonce ~adata ciphertext = 155 - match Crypto.Aes_ccm.decrypt ~key ~nonce ~adata ciphertext with 155 + match Aes_ccm.Aes_ccm.decrypt ~key ~nonce ~adata ciphertext with 156 156 | Some pt -> Ok pt 157 157 | None -> Error "AES-CCM decryption/authentication failed" 158 158
+1 -1
lib/dune
··· 13 13 ipaddr 14 14 logs 15 15 mdns 16 - mirage-crypto 16 + crypto 17 17 spake2 18 18 x509))
+3 -3
lib/pase.ml
··· 107 107 108 108 (** {1 Cryptographic Helpers} 109 109 110 - These are re-exports from {!Crypto} for convenience. *) 110 + These are re-exports from {!Aes_ccm} for convenience. *) 111 111 112 - let sha256 = Crypto.sha256 113 - let hmac_sha256 = Crypto.hmac_sha256 112 + let sha256 = Aes_ccm.sha256 113 + let hmac_sha256 = Aes_ccm.hmac_sha256 114 114 115 115 let hkdf ~salt ~ikm ~info ~length = 116 116 let prk = Hkdf.extract ~hash:`SHA256 ~salt ikm in
+1 -1
matter.opam
··· 21 21 "kdf" {>= "0.1"} 22 22 "mdns" {>= "0.1"} 23 23 "spake2" {>= "0.1"} 24 - "mirage-crypto" {>= "1.0"} 24 + "crypto" 25 25 "cstruct" {>= "6.0"} 26 26 "ipaddr" {>= "5.0"} 27 27 "domain-name" {>= "0.4"}