···2121 - 13-byte nonce for messages, 12-byte for CASE *)
22222323module Aes_ccm = struct
2424- module AES_CCM = Crypto.AES.CCM16
2424+ module AES_CCM = Mirage_crypto.AES.CCM16
25252626 (** Encrypt with AES-128-CCM-128 (16-byte tag) *)
2727 let encrypt ~key ~nonce ~adata plaintext =
lib/matter_crypto.mli
lib/crypto.mli
+2-2
lib/pase.ml
···110110111111 These are re-exports from {!Crypto} for convenience. *)
112112113113-let sha256 = Matter_crypto.sha256
114114-let hmac_sha256 = Matter_crypto.hmac_sha256
113113+let sha256 = Crypto.sha256
114114+let hmac_sha256 = Crypto.hmac_sha256
115115116116let hkdf ~salt ~ikm ~info ~length =
117117 let prk = Hkdf.extract ~hash:`SHA256 ~salt ikm in
+2-2
lib/session.ml
···208208let establish_pase ~net ~sw ~clock ~ip ~port ~passcode =
209209 let conn = connect ~net ~sw ~ip ~port in
210210211211- let initiator_random = Crypto_rng.generate 32 in
211211+ let initiator_random = Mirage_crypto_rng.generate 32 in
212212 (* Use secure random for session ID *)
213213- let session_id_bytes = Crypto_rng.generate 2 in
213213+ let session_id_bytes = Mirage_crypto_rng.generate 2 in
214214 let session_id =
215215 (Char.code session_id_bytes.[0] lsl 8) lor Char.code session_id_bytes.[1]
216216 in