From 035bb6b28597f4fbde234fc37a559dc563a1396f Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 24 Mar 2018 15:14:00 -0400 Subject: [PATCH] Swift-compatible typing. --- core/c/mpw-types.c | 3 +++ core/c/mpw-types.h | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/c/mpw-types.c b/core/c/mpw-types.c index ad74b057..fd144bbb 100644 --- a/core/c/mpw-types.c +++ b/core/c/mpw-types.c @@ -22,6 +22,9 @@ #include "mpw-types.h" #include "mpw-util.h" +const size_t MPMasterKeySize = 64; +const size_t MPSiteKeySize = 256 / 8; // Size of HMAC-SHA-256 + const MPResultType mpw_typeWithName(const char *typeName) { // Find what password type is represented by the type letter. diff --git a/core/c/mpw-types.h b/core/c/mpw-types.h index fa56c819..95208040 100644 --- a/core/c/mpw-types.h +++ b/core/c/mpw-types.h @@ -35,10 +35,8 @@ //// Types. -#define MPMasterKeySize 64 /* bytes */ -typedef const uint8_t *MPMasterKey; -#define MPSiteKeySize (256 / 8) /* bytes */ // Size of HMAC-SHA-256 -typedef const uint8_t *MPSiteKey; +extern const size_t MPMasterKeySize, MPSiteKeySize; /* bytes */ +typedef const uint8_t *MPMasterKey, *MPSiteKey; typedef const char *MPKeyID; typedef mpw_enum( uint8_t, MPKeyPurpose ) {