From e3fffc19232087498d56ab4a3133b67f8a323be4 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 10 Apr 2017 11:43:55 -0400 Subject: [PATCH] Migrate from Tarsnap's scrypt to libsodium. --- .gitmodules | 3 + .travis.yml | 1 + core/c/mpw-util.c | 2 +- platform-darwin/External/Pearl | 2 +- platform-darwin/External/libsodium | 1 + .../project.pbxproj | 214 +++++++++++++----- .../project.pbxproj | 213 ++++++++++++++--- .../MasterPassword.xcscmblueprint | 11 +- platform-darwin/Source/MPAlgorithmV0.m | 145 ++++++------ 9 files changed, 421 insertions(+), 171 deletions(-) create mode 160000 platform-darwin/External/libsodium diff --git a/.gitmodules b/.gitmodules index 19b69f37..eef51baa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "MasterPassword/Web/js/mpw-js"] path = platform-independent/web-js/js/mpw-js url = https://github.com/tmthrgd/mpw-js.git +[submodule "platform-darwin/External/libsodium"] + path = platform-darwin/External/libsodium + url = https://github.com/jedisct1/libsodium.git diff --git a/.travis.yml b/.travis.yml index c7487b81..5734568f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ env: TERM=dumb SHLVL=0 git: submodules: true script: + - "( brew install libsodium )" - "( cd ./platform-independent/cli-c && ./clean && ./build && ./mpw-tests )" - "( xcodebuild -workspace platform-darwin/MasterPassword.xcworkspace -configuration 'Test' -scheme 'MasterPassword iOS' -sdk iphonesimulator )" - "( xcodebuild -workspace platform-darwin/MasterPassword.xcworkspace -configuration 'Test' -scheme 'MasterPassword macOS' )" diff --git a/core/c/mpw-util.c b/core/c/mpw-util.c index 3e82d766..52dc059d 100644 --- a/core/c/mpw-util.c +++ b/core/c/mpw-util.c @@ -30,7 +30,7 @@ #include #include #elif HAS_SODIUM -#include +#include "sodium.h" #endif #ifndef trc diff --git a/platform-darwin/External/Pearl b/platform-darwin/External/Pearl index 789d5c80..6dc768f6 160000 --- a/platform-darwin/External/Pearl +++ b/platform-darwin/External/Pearl @@ -1 +1 @@ -Subproject commit 789d5c80dc2d3432ab73b61f9d380d190e0189a1 +Subproject commit 6dc768f629339f45f0a287b80ba49c257d8c8205 diff --git a/platform-darwin/External/libsodium b/platform-darwin/External/libsodium new file mode 160000 index 00000000..4809639a --- /dev/null +++ b/platform-darwin/External/libsodium @@ -0,0 +1 @@ +Subproject commit 4809639ae183779536d76d0d800776931b39d794 diff --git a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj index 395eb4a6..7011eb4a 100644 --- a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -64,6 +64,7 @@ DA071BF3190187FE00179766 /* empty@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA071BF1190187FE00179766 /* empty@2x.png */; }; DA071BF4190187FE00179766 /* empty.png in Resources */ = {isa = PBXBuildFile; fileRef = DA071BF2190187FE00179766 /* empty.png */; }; DA095E75172F4CD8001C948B /* MPLogsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3979190DACEBD1F6AE9F4 /* MPLogsViewController.m */; }; + DA0979171E9A81EE00F0BFE8 /* libsodium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA0979161E9A81EE00F0BFE8 /* libsodium.a */; }; DA24EBAE19DAD08900FF010B /* tip_basic_black_top.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38941711E29700CF925C /* tip_basic_black_top.png */; }; DA24EBAF19DAD08C00FF010B /* tip_basic_black_top@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38951711E29700CF925C /* tip_basic_black_top@2x.png */; }; DA24EBE819DAD6DE00FF010B /* Icon-320.png in Resources */ = {isa = PBXBuildFile; fileRef = DA24EBE619DAD6DE00FF010B /* Icon-320.png */; }; @@ -86,7 +87,6 @@ DA25C600197DBF260046CDCF /* icon_trash.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38501711E29700CF925C /* icon_trash.png */; }; DA25C601197DBF260046CDCF /* icon_trash@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38511711E29700CF925C /* icon_trash@2x.png */; }; DA25C6B41980D3C50046CDCF /* openssl in Headers */ = {isa = PBXBuildFile; fileRef = DA25C6B31980D3C10046CDCF /* openssl */; settings = {ATTRIBUTES = (Public, ); }; }; - DA25C6B61980D3DF0046CDCF /* scrypt in Headers */ = {isa = PBXBuildFile; fileRef = DA25C6B51980D3DD0046CDCF /* scrypt */; settings = {ATTRIBUTES = (Public, ); }; }; DA29992F19C86F5700AF7DF1 /* thumb_generated_login@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA29992D19C86F5700AF7DF1 /* thumb_generated_login@2x.png */; }; DA29993019C86F5700AF7DF1 /* thumb_generated_login.png in Resources */ = {isa = PBXBuildFile; fileRef = DA29992E19C86F5700AF7DF1 /* thumb_generated_login.png */; }; DA29993219C9132F00AF7DF1 /* thumb_generated_login@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA29993119C9132F00AF7DF1 /* thumb_generated_login@3x.png */; }; @@ -391,8 +391,6 @@ DAFE4A3715039824003ABA7C /* PearlKeyChain.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE460115039823003ABA7C /* PearlKeyChain.m */; }; DAFE4A3815039824003ABA7C /* PearlRSAKey.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460215039823003ABA7C /* PearlRSAKey.h */; }; DAFE4A3915039824003ABA7C /* PearlRSAKey.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE460315039823003ABA7C /* PearlRSAKey.m */; }; - DAFE4A3A15039824003ABA7C /* PearlSCrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460415039823003ABA7C /* PearlSCrypt.h */; }; - DAFE4A3B15039824003ABA7C /* PearlSCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE460515039823003ABA7C /* PearlSCrypt.m */; }; DAFE4A3C15039824003ABA7C /* Pearl-UIKit-Dependencies.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460815039823003ABA7C /* Pearl-UIKit-Dependencies.h */; }; DAFE4A3D15039824003ABA7C /* Pearl-UIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460915039823003ABA7C /* Pearl-UIKit.h */; }; DAFE4A3E15039824003ABA7C /* PearlAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460A15039823003ABA7C /* PearlAlert.h */; }; @@ -548,6 +546,65 @@ DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; DA071BF1190187FE00179766 /* empty@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "empty@2x.png"; sourceTree = ""; }; DA071BF2190187FE00179766 /* empty.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = empty.png; sourceTree = ""; }; + DA0978DB1E9A81EE00F0BFE8 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = ""; }; + DA0978DC1E9A81EE00F0BFE8 /* crypto_aead_aes256gcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aead_aes256gcm.h; sourceTree = ""; }; + DA0978DD1E9A81EE00F0BFE8 /* crypto_aead_chacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aead_chacha20poly1305.h; sourceTree = ""; }; + DA0978DE1E9A81EE00F0BFE8 /* crypto_aead_xchacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aead_xchacha20poly1305.h; sourceTree = ""; }; + DA0978DF1E9A81EE00F0BFE8 /* crypto_auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth.h; sourceTree = ""; }; + DA0978E01E9A81EE00F0BFE8 /* crypto_auth_hmacsha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth_hmacsha256.h; sourceTree = ""; }; + DA0978E11E9A81EE00F0BFE8 /* crypto_auth_hmacsha512.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth_hmacsha512.h; sourceTree = ""; }; + DA0978E21E9A81EE00F0BFE8 /* crypto_auth_hmacsha512256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth_hmacsha512256.h; sourceTree = ""; }; + DA0978E31E9A81EE00F0BFE8 /* crypto_box.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_box.h; sourceTree = ""; }; + DA0978E41E9A81EE00F0BFE8 /* crypto_box_curve25519xchacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_box_curve25519xchacha20poly1305.h; sourceTree = ""; }; + DA0978E51E9A81EE00F0BFE8 /* crypto_box_curve25519xsalsa20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_box_curve25519xsalsa20poly1305.h; sourceTree = ""; }; + DA0978E61E9A81EE00F0BFE8 /* crypto_core_hchacha20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_hchacha20.h; sourceTree = ""; }; + DA0978E71E9A81EE00F0BFE8 /* crypto_core_hsalsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_hsalsa20.h; sourceTree = ""; }; + DA0978E81E9A81EE00F0BFE8 /* crypto_core_salsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_salsa20.h; sourceTree = ""; }; + DA0978E91E9A81EE00F0BFE8 /* crypto_core_salsa2012.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_salsa2012.h; sourceTree = ""; }; + DA0978EA1E9A81EE00F0BFE8 /* crypto_core_salsa208.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_salsa208.h; sourceTree = ""; }; + DA0978EB1E9A81EE00F0BFE8 /* crypto_generichash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_generichash.h; sourceTree = ""; }; + DA0978EC1E9A81EE00F0BFE8 /* crypto_generichash_blake2b.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_generichash_blake2b.h; sourceTree = ""; }; + DA0978ED1E9A81EE00F0BFE8 /* crypto_hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_hash.h; sourceTree = ""; }; + DA0978EE1E9A81EE00F0BFE8 /* crypto_hash_sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_hash_sha256.h; sourceTree = ""; }; + DA0978EF1E9A81EE00F0BFE8 /* crypto_hash_sha512.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_hash_sha512.h; sourceTree = ""; }; + DA0978F01E9A81EE00F0BFE8 /* crypto_kdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_kdf.h; sourceTree = ""; }; + DA0978F11E9A81EE00F0BFE8 /* crypto_kdf_blake2b.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_kdf_blake2b.h; sourceTree = ""; }; + DA0978F21E9A81EE00F0BFE8 /* crypto_kx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_kx.h; sourceTree = ""; }; + DA0978F31E9A81EE00F0BFE8 /* crypto_onetimeauth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_onetimeauth.h; sourceTree = ""; }; + DA0978F41E9A81EE00F0BFE8 /* crypto_onetimeauth_poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_onetimeauth_poly1305.h; sourceTree = ""; }; + DA0978F51E9A81EE00F0BFE8 /* crypto_pwhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_pwhash.h; sourceTree = ""; }; + DA0978F61E9A81EE00F0BFE8 /* crypto_pwhash_argon2i.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_pwhash_argon2i.h; sourceTree = ""; }; + DA0978F71E9A81EE00F0BFE8 /* crypto_pwhash_scryptsalsa208sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_pwhash_scryptsalsa208sha256.h; sourceTree = ""; }; + DA0978F81E9A81EE00F0BFE8 /* crypto_scalarmult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_scalarmult.h; sourceTree = ""; }; + DA0978F91E9A81EE00F0BFE8 /* crypto_scalarmult_curve25519.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_scalarmult_curve25519.h; sourceTree = ""; }; + DA0978FA1E9A81EE00F0BFE8 /* crypto_secretbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_secretbox.h; sourceTree = ""; }; + DA0978FB1E9A81EE00F0BFE8 /* crypto_secretbox_xchacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_secretbox_xchacha20poly1305.h; sourceTree = ""; }; + DA0978FC1E9A81EE00F0BFE8 /* crypto_secretbox_xsalsa20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_secretbox_xsalsa20poly1305.h; sourceTree = ""; }; + DA0978FD1E9A81EE00F0BFE8 /* crypto_shorthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_shorthash.h; sourceTree = ""; }; + DA0978FE1E9A81EE00F0BFE8 /* crypto_shorthash_siphash24.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_shorthash_siphash24.h; sourceTree = ""; }; + DA0978FF1E9A81EE00F0BFE8 /* crypto_sign.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_sign.h; sourceTree = ""; }; + DA0979001E9A81EE00F0BFE8 /* crypto_sign_ed25519.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_sign_ed25519.h; sourceTree = ""; }; + DA0979011E9A81EE00F0BFE8 /* crypto_sign_edwards25519sha512batch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_sign_edwards25519sha512batch.h; sourceTree = ""; }; + DA0979021E9A81EE00F0BFE8 /* crypto_stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream.h; sourceTree = ""; }; + DA0979031E9A81EE00F0BFE8 /* crypto_stream_aes128ctr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_aes128ctr.h; sourceTree = ""; }; + DA0979041E9A81EE00F0BFE8 /* crypto_stream_chacha20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_chacha20.h; sourceTree = ""; }; + DA0979051E9A81EE00F0BFE8 /* crypto_stream_salsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_salsa20.h; sourceTree = ""; }; + DA0979061E9A81EE00F0BFE8 /* crypto_stream_salsa2012.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_salsa2012.h; sourceTree = ""; }; + DA0979071E9A81EE00F0BFE8 /* crypto_stream_salsa208.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_salsa208.h; sourceTree = ""; }; + DA0979081E9A81EE00F0BFE8 /* crypto_stream_xchacha20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_xchacha20.h; sourceTree = ""; }; + DA0979091E9A81EE00F0BFE8 /* crypto_stream_xsalsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_xsalsa20.h; sourceTree = ""; }; + DA09790A1E9A81EE00F0BFE8 /* crypto_verify_16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_verify_16.h; sourceTree = ""; }; + DA09790B1E9A81EE00F0BFE8 /* crypto_verify_32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_verify_32.h; sourceTree = ""; }; + DA09790C1E9A81EE00F0BFE8 /* crypto_verify_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_verify_64.h; sourceTree = ""; }; + DA09790D1E9A81EE00F0BFE8 /* export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = export.h; sourceTree = ""; }; + DA09790E1E9A81EE00F0BFE8 /* randombytes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = randombytes.h; sourceTree = ""; }; + DA09790F1E9A81EE00F0BFE8 /* randombytes_salsa20_random.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = randombytes_salsa20_random.h; sourceTree = ""; }; + DA0979101E9A81EE00F0BFE8 /* randombytes_sysrandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = randombytes_sysrandom.h; sourceTree = ""; }; + DA0979111E9A81EE00F0BFE8 /* runtime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runtime.h; sourceTree = ""; }; + DA0979121E9A81EE00F0BFE8 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utils.h; sourceTree = ""; }; + DA0979131E9A81EE00F0BFE8 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; + DA0979141E9A81EE00F0BFE8 /* sodium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sodium.h; sourceTree = ""; }; + DA0979161E9A81EE00F0BFE8 /* libsodium.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsodium.a; sourceTree = ""; }; DA24EBB219DAD4D000FF010B /* Icon-60.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-60.png"; sourceTree = ""; }; DA24EBB319DAD4D000FF010B /* Icon-60@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-60@2x.png"; sourceTree = ""; }; DA24EBB419DAD4D000FF010B /* Icon-60@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-60@3x.png"; sourceTree = ""; }; @@ -579,7 +636,6 @@ DA250A15195665A100AC23F1 /* UICollectionReusableView+PearlDequeue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UICollectionReusableView+PearlDequeue.m"; sourceTree = ""; }; DA250A16195665A100AC23F1 /* UICollectionReusableView+PearlDequeue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UICollectionReusableView+PearlDequeue.h"; sourceTree = ""; }; DA25C6B31980D3C10046CDCF /* openssl */ = {isa = PBXFileReference; lastKnownFileType = folder; path = openssl; sourceTree = ""; }; - DA25C6B51980D3DD0046CDCF /* scrypt */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scrypt; sourceTree = ""; }; DA29992D19C86F5700AF7DF1 /* thumb_generated_login@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "thumb_generated_login@2x.png"; sourceTree = ""; }; DA29992E19C86F5700AF7DF1 /* thumb_generated_login.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = thumb_generated_login.png; sourceTree = ""; }; DA29993119C9132F00AF7DF1 /* thumb_generated_login@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "thumb_generated_login@3x.png"; sourceTree = ""; }; @@ -649,7 +705,6 @@ DA70EC7F1811B13C00F65DB2 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; DA771FE41E6E1595004D7EDE /* MasterPassword-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MasterPassword-Prefix.pch"; sourceTree = ""; }; DA7F2C5E1C48B70D00404A26 /* libopensslcrypto-ios-sim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libopensslcrypto-ios-sim.a"; sourceTree = ""; }; - DA7F2C5F1C48B70D00404A26 /* libscryptenc-ios-sim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libscryptenc-ios-sim.a"; sourceTree = ""; }; DA854C8118D4CFBF00106317 /* avatar-add@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-add@2x.png"; sourceTree = ""; }; DA854C8218D4CFBF00106317 /* avatar-add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-add.png"; sourceTree = ""; }; DA92614C1BE1A57500369DE5 /* MPAppDelegate_InApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAppDelegate_InApp.h; sourceTree = ""; }; @@ -1475,8 +1530,6 @@ DAFE460115039823003ABA7C /* PearlKeyChain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlKeyChain.m; sourceTree = ""; }; DAFE460215039823003ABA7C /* PearlRSAKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlRSAKey.h; sourceTree = ""; }; DAFE460315039823003ABA7C /* PearlRSAKey.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlRSAKey.m; sourceTree = ""; }; - DAFE460415039823003ABA7C /* PearlSCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlSCrypt.h; sourceTree = ""; }; - DAFE460515039823003ABA7C /* PearlSCrypt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlSCrypt.m; sourceTree = ""; }; DAFE460615039823003ABA7C /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; DAFE460815039823003ABA7C /* Pearl-UIKit-Dependencies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Pearl-UIKit-Dependencies.h"; sourceTree = ""; }; DAFE460915039823003ABA7C /* Pearl-UIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Pearl-UIKit.h"; sourceTree = ""; }; @@ -1519,7 +1572,6 @@ DAFE4A63150399FF003ABA8F /* UIScrollView+PearlFlashingIndicators.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+PearlFlashingIndicators.h"; sourceTree = ""; }; DAFE4A63150399FF003ABA91 /* NSDateFormatter+RFC3339.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDateFormatter+RFC3339.m"; sourceTree = ""; }; DAFE4A63150399FF003ABA93 /* NSDateFormatter+RFC3339.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDateFormatter+RFC3339.h"; sourceTree = ""; }; - DAFFC63E17EDDA7C007BB020 /* libscryptenc-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libscryptenc-ios.a"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1552,6 +1604,7 @@ DA48856019A5A82E000C2D79 /* Crashlytics.framework in Frameworks */, DAC632891486D9690075AEA5 /* Security.framework in Frameworks */, DA5BFA49147E415C00F98B1E /* UIKit.framework in Frameworks */, + DA0979171E9A81EE00F0BFE8 /* libsodium.a in Frameworks */, DA5BFA4B147E415C00F98B1E /* Foundation.framework in Frameworks */, DA5BFA4D147E415C00F98B1E /* CoreGraphics.framework in Frameworks */, DA5BFA4F147E415C00F98B1E /* CoreData.framework in Frameworks */, @@ -1622,6 +1675,97 @@ path = ../core/c; sourceTree = ""; }; + DA0978D81E9A81EE00F0BFE8 /* libsodium-ios */ = { + isa = PBXGroup; + children = ( + DA0978D91E9A81EE00F0BFE8 /* include */, + DA0979151E9A81EE00F0BFE8 /* lib */, + ); + name = "libsodium-ios"; + path = "libsodium/libsodium-ios"; + sourceTree = ""; + }; + DA0978D91E9A81EE00F0BFE8 /* include */ = { + isa = PBXGroup; + children = ( + DA0978DA1E9A81EE00F0BFE8 /* sodium */, + DA0979141E9A81EE00F0BFE8 /* sodium.h */, + ); + path = include; + sourceTree = ""; + }; + DA0978DA1E9A81EE00F0BFE8 /* sodium */ = { + isa = PBXGroup; + children = ( + DA0978DB1E9A81EE00F0BFE8 /* core.h */, + DA0978DC1E9A81EE00F0BFE8 /* crypto_aead_aes256gcm.h */, + DA0978DD1E9A81EE00F0BFE8 /* crypto_aead_chacha20poly1305.h */, + DA0978DE1E9A81EE00F0BFE8 /* crypto_aead_xchacha20poly1305.h */, + DA0978DF1E9A81EE00F0BFE8 /* crypto_auth.h */, + DA0978E01E9A81EE00F0BFE8 /* crypto_auth_hmacsha256.h */, + DA0978E11E9A81EE00F0BFE8 /* crypto_auth_hmacsha512.h */, + DA0978E21E9A81EE00F0BFE8 /* crypto_auth_hmacsha512256.h */, + DA0978E31E9A81EE00F0BFE8 /* crypto_box.h */, + DA0978E41E9A81EE00F0BFE8 /* crypto_box_curve25519xchacha20poly1305.h */, + DA0978E51E9A81EE00F0BFE8 /* crypto_box_curve25519xsalsa20poly1305.h */, + DA0978E61E9A81EE00F0BFE8 /* crypto_core_hchacha20.h */, + DA0978E71E9A81EE00F0BFE8 /* crypto_core_hsalsa20.h */, + DA0978E81E9A81EE00F0BFE8 /* crypto_core_salsa20.h */, + DA0978E91E9A81EE00F0BFE8 /* crypto_core_salsa2012.h */, + DA0978EA1E9A81EE00F0BFE8 /* crypto_core_salsa208.h */, + DA0978EB1E9A81EE00F0BFE8 /* crypto_generichash.h */, + DA0978EC1E9A81EE00F0BFE8 /* crypto_generichash_blake2b.h */, + DA0978ED1E9A81EE00F0BFE8 /* crypto_hash.h */, + DA0978EE1E9A81EE00F0BFE8 /* crypto_hash_sha256.h */, + DA0978EF1E9A81EE00F0BFE8 /* crypto_hash_sha512.h */, + DA0978F01E9A81EE00F0BFE8 /* crypto_kdf.h */, + DA0978F11E9A81EE00F0BFE8 /* crypto_kdf_blake2b.h */, + DA0978F21E9A81EE00F0BFE8 /* crypto_kx.h */, + DA0978F31E9A81EE00F0BFE8 /* crypto_onetimeauth.h */, + DA0978F41E9A81EE00F0BFE8 /* crypto_onetimeauth_poly1305.h */, + DA0978F51E9A81EE00F0BFE8 /* crypto_pwhash.h */, + DA0978F61E9A81EE00F0BFE8 /* crypto_pwhash_argon2i.h */, + DA0978F71E9A81EE00F0BFE8 /* crypto_pwhash_scryptsalsa208sha256.h */, + DA0978F81E9A81EE00F0BFE8 /* crypto_scalarmult.h */, + DA0978F91E9A81EE00F0BFE8 /* crypto_scalarmult_curve25519.h */, + DA0978FA1E9A81EE00F0BFE8 /* crypto_secretbox.h */, + DA0978FB1E9A81EE00F0BFE8 /* crypto_secretbox_xchacha20poly1305.h */, + DA0978FC1E9A81EE00F0BFE8 /* crypto_secretbox_xsalsa20poly1305.h */, + DA0978FD1E9A81EE00F0BFE8 /* crypto_shorthash.h */, + DA0978FE1E9A81EE00F0BFE8 /* crypto_shorthash_siphash24.h */, + DA0978FF1E9A81EE00F0BFE8 /* crypto_sign.h */, + DA0979001E9A81EE00F0BFE8 /* crypto_sign_ed25519.h */, + DA0979011E9A81EE00F0BFE8 /* crypto_sign_edwards25519sha512batch.h */, + DA0979021E9A81EE00F0BFE8 /* crypto_stream.h */, + DA0979031E9A81EE00F0BFE8 /* crypto_stream_aes128ctr.h */, + DA0979041E9A81EE00F0BFE8 /* crypto_stream_chacha20.h */, + DA0979051E9A81EE00F0BFE8 /* crypto_stream_salsa20.h */, + DA0979061E9A81EE00F0BFE8 /* crypto_stream_salsa2012.h */, + DA0979071E9A81EE00F0BFE8 /* crypto_stream_salsa208.h */, + DA0979081E9A81EE00F0BFE8 /* crypto_stream_xchacha20.h */, + DA0979091E9A81EE00F0BFE8 /* crypto_stream_xsalsa20.h */, + DA09790A1E9A81EE00F0BFE8 /* crypto_verify_16.h */, + DA09790B1E9A81EE00F0BFE8 /* crypto_verify_32.h */, + DA09790C1E9A81EE00F0BFE8 /* crypto_verify_64.h */, + DA09790D1E9A81EE00F0BFE8 /* export.h */, + DA09790E1E9A81EE00F0BFE8 /* randombytes.h */, + DA09790F1E9A81EE00F0BFE8 /* randombytes_salsa20_random.h */, + DA0979101E9A81EE00F0BFE8 /* randombytes_sysrandom.h */, + DA0979111E9A81EE00F0BFE8 /* runtime.h */, + DA0979121E9A81EE00F0BFE8 /* utils.h */, + DA0979131E9A81EE00F0BFE8 /* version.h */, + ); + path = sodium; + sourceTree = ""; + }; + DA0979151E9A81EE00F0BFE8 /* lib */ = { + isa = PBXGroup; + children = ( + DA0979161E9A81EE00F0BFE8 /* libsodium.a */, + ); + path = lib; + sourceTree = ""; + }; DA24EBB019DAD4D000FF010B /* ios */ = { isa = PBXGroup; children = ( @@ -1768,8 +1912,6 @@ DA5E5C6417248959003798D8 /* include */, DA7F2C5E1C48B70D00404A26 /* libopensslcrypto-ios-sim.a */, DAE8E65119867AB500416A0F /* libopensslcrypto-ios.a */, - DA7F2C5F1C48B70D00404A26 /* libscryptenc-ios-sim.a */, - DAFFC63E17EDDA7C007BB020 /* libscryptenc-ios.a */, ); path = lib; sourceTree = ""; @@ -1778,7 +1920,6 @@ isa = PBXGroup; children = ( DA25C6B31980D3C10046CDCF /* openssl */, - DA25C6B51980D3DD0046CDCF /* scrypt */, ); path = include; sourceTree = ""; @@ -2657,6 +2798,7 @@ DACA22121705DDC5002C6C22 /* External */ = { isa = PBXGroup; children = ( + DA0978D81E9A81EE00F0BFE8 /* libsodium-ios */, DAA1759319D86C610044227B /* AttributedMarkdown */, DAFC5662172C57EC00CB5CC5 /* InAppSettingsKit */, DAA141181922FED80032B392 /* iOS */, @@ -2865,8 +3007,6 @@ DAFE460115039823003ABA7C /* PearlKeyChain.m */, DAFE460215039823003ABA7C /* PearlRSAKey.h */, DAFE460315039823003ABA7C /* PearlRSAKey.m */, - DAFE460415039823003ABA7C /* PearlSCrypt.h */, - DAFE460515039823003ABA7C /* PearlSCrypt.m */, DAFE460615039823003ABA7C /* README */, ); path = "Pearl-Crypto"; @@ -2987,7 +3127,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - DA25C6B61980D3DF0046CDCF /* scrypt in Headers */, DA25C6B41980D3C50046CDCF /* openssl in Headers */, DAFE4A1315039824003ABA7C /* NSObject+PearlExport.h in Headers */, DAFE4A1515039824003ABA7C /* NSString+PearlNSArrayFormat.h in Headers */, @@ -3014,7 +3153,6 @@ DAFE4A3615039824003ABA7C /* PearlKeyChain.h in Headers */, DAFE4A3815039824003ABA7C /* PearlRSAKey.h in Headers */, DAE2726419CE9CB3007C5262 /* UITableViewCell+PearlDeque.h in Headers */, - DAFE4A3A15039824003ABA7C /* PearlSCrypt.h in Headers */, DACE2F6E19BA6A2A0010F92E /* UIView+FontScale.h in Headers */, DA32D01B19D046E1004F3F0E /* PearlFixedTableView.h in Headers */, DAFE4A3C15039824003ABA7C /* Pearl-UIKit-Dependencies.h in Headers */, @@ -3701,7 +3839,6 @@ DA72BD7B19C1510C00E6ACFE /* UIView+FontScale.m in Sources */, DA250A17195665A100AC23F1 /* UITableView+PearlReloadFromArray.m in Sources */, DAFE4A3915039824003ABA7C /* PearlRSAKey.m in Sources */, - DAFE4A3B15039824003ABA7C /* PearlSCrypt.m in Sources */, DAFE4A3F15039824003ABA7C /* PearlAlert.m in Sources */, DAFE4A4115039824003ABA7C /* PearlArrayTVC.m in Sources */, DAFE4A4315039824003ABA7C /* PearlBoxView.m in Sources */, @@ -3913,21 +4050,10 @@ INFOPLIST_FILE = "Source/iOS/MasterPassword-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/External/Pearl/Pearl-Crypto/lib\"", "$(inherited)", + "$(PROJECT_DIR)/External/libsodium/libsodium-ios/lib", ); - OTHER_CFLAGS = "-DHAS_CPERCIVA=1"; - OTHER_LDFLAGS = "$(inherited)"; - "OTHER_LDFLAGS[sdk=iphoneos*]" = ( - "$(inherited)", - "-lscryptenc-ios", - "-lopensslcrypto-ios", - ); - "OTHER_LDFLAGS[sdk=iphonesimulator*]" = ( - "$(inherited)", - "-lscryptenc-ios-sim", - "-lopensslcrypto-ios-sim", - ); + OTHER_CFLAGS = "-DHAS_SODIUM=1"; PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword; SKIP_INSTALL = NO; STRIP_INSTALLED_PRODUCT = YES; @@ -4190,21 +4316,10 @@ INFOPLIST_FILE = "Source/iOS/MasterPassword-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/External/Pearl/Pearl-Crypto/lib\"", "$(inherited)", + "$(PROJECT_DIR)/External/libsodium/libsodium-ios/lib", ); - OTHER_CFLAGS = "-DHAS_CPERCIVA=1"; - OTHER_LDFLAGS = "$(inherited)"; - "OTHER_LDFLAGS[sdk=iphoneos*]" = ( - "$(inherited)", - "-lscryptenc-ios", - "-lopensslcrypto-ios", - ); - "OTHER_LDFLAGS[sdk=iphonesimulator*]" = ( - "$(inherited)", - "-lscryptenc-ios-sim", - "-lopensslcrypto-ios-sim", - ); + OTHER_CFLAGS = "-DHAS_SODIUM=1"; PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = 1; @@ -4229,21 +4344,10 @@ INFOPLIST_FILE = "Source/iOS/MasterPassword-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/External/Pearl/Pearl-Crypto/lib\"", "$(inherited)", + "$(PROJECT_DIR)/External/libsodium/libsodium-ios/lib", ); - OTHER_CFLAGS = "-DHAS_CPERCIVA=1"; - OTHER_LDFLAGS = "$(inherited)"; - "OTHER_LDFLAGS[sdk=iphoneos*]" = ( - "$(inherited)", - "-lscryptenc-ios", - "-lopensslcrypto-ios", - ); - "OTHER_LDFLAGS[sdk=iphonesimulator*]" = ( - "$(inherited)", - "-lscryptenc-ios-sim", - "-lopensslcrypto-ios-sim", - ); + OTHER_CFLAGS = "-DHAS_SODIUM=1"; PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword; SKIP_INSTALL = NO; STRIP_INSTALLED_PRODUCT = YES; diff --git a/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj b/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj index 788ff671..b24f02a0 100644 --- a/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj +++ b/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj @@ -23,13 +23,11 @@ 93D39F833DEC1C89B2F795AC /* MPPasswordWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39A57A7823DE98A0FF83C /* MPPasswordWindowController.m */; }; DA0933CC1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0933CB1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png */; }; DA0933D01747B91B00DE1CEF /* appstore.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0933CF1747B91B00DE1CEF /* appstore.png */; }; - DA0974541E9957F300F0BFE8 /* libopensslcrypto-osx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE8E65319867ADA00416A0F /* libopensslcrypto-osx.a */; }; - DA0974551E9957F300F0BFE8 /* libscryptenc-osx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */; }; DA09745A1E99582900F0BFE8 /* mpw-tests-util.c in Sources */ = {isa = PBXBuildFile; fileRef = DA0974561E99582200F0BFE8 /* mpw-tests-util.c */; }; DA09745B1E99582900F0BFE8 /* mpw-tests.c in Sources */ = {isa = PBXBuildFile; fileRef = DA0974571E99582200F0BFE8 /* mpw-tests.c */; }; DA09745E1E99586600F0BFE8 /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = DA09745D1E99586600F0BFE8 /* libxml2.tbd */; }; - DA0974621E9961F100F0BFE8 /* libsodium.18.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DA0974611E9961F100F0BFE8 /* libsodium.18.dylib */; }; - DA10007F1998A4C6002B873F /* scrypt in Headers */ = {isa = PBXBuildFile; fileRef = DAE8E65619867AF500416A0F /* scrypt */; settings = {ATTRIBUTES = (Public, ); }; }; + DA09795D1E9A824700F0BFE8 /* libsodium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA0979571E9A824700F0BFE8 /* libsodium.a */; }; + DA0979681E9A834C00F0BFE8 /* libsodium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA0979571E9A824700F0BFE8 /* libsodium.a */; }; DA1000801998A4C6002B873F /* openssl in Headers */ = {isa = PBXBuildFile; fileRef = DAE8E65719867AF500416A0F /* openssl */; settings = {ATTRIBUTES = (Public, ); }; }; DA16B341170661DB000A0EAB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA16B340170661DB000A0EAB /* Carbon.framework */; }; DA16B342170661E0000A0EAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC632871486D95D0075AEA5 /* Security.framework */; }; @@ -66,7 +64,6 @@ DA4DAE951A7D8117003E5423 /* MPTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4DAE931A7D8117003E5423 /* MPTypes.m */; }; DA5180CA19FF2F9200A587E9 /* MPAlgorithmV2.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5180C719FF2F9200A587E9 /* MPAlgorithmV2.m */; }; DA5180CE19FF307E00A587E9 /* MPAppDelegate_Store.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5180CD19FF307E00A587E9 /* MPAppDelegate_Store.m */; }; - DA5E5C9417248AA1003798D8 /* libscryptenc-osx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */; }; DA5E5CF61724A667003798D8 /* MPAlgorithm.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5E5C981724A667003798D8 /* MPAlgorithm.m */; }; DA5E5CF71724A667003798D8 /* MPAlgorithmV0.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5E5C9A1724A667003798D8 /* MPAlgorithmV0.m */; }; DA5E5CF81724A667003798D8 /* MPAlgorithmV1.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5E5C9C1724A667003798D8 /* MPAlgorithmV1.m */; }; @@ -200,8 +197,6 @@ DAFE4A3715039824003ABA7C /* PearlKeyChain.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE460115039823003ABA7C /* PearlKeyChain.m */; }; DAFE4A3815039824003ABA7C /* PearlRSAKey.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460215039823003ABA7C /* PearlRSAKey.h */; }; DAFE4A3915039824003ABA7C /* PearlRSAKey.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE460315039823003ABA7C /* PearlRSAKey.m */; }; - DAFE4A3A15039824003ABA7C /* PearlSCrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE460415039823003ABA7C /* PearlSCrypt.h */; }; - DAFE4A3B15039824003ABA7C /* PearlSCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE460515039823003ABA7C /* PearlSCrypt.m */; }; DAFE4A5A1503982E003ABA7C /* Pearl.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAFE45FA15039823003ABA7C /* Pearl.strings */; }; DAFE4A63150399FF003ABA86 /* NSObject+PearlKVO.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE4A63150399FF003ABA85 /* NSObject+PearlKVO.m */; }; DAFE4A63150399FF003ABA88 /* NSObject+PearlKVO.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE4A63150399FF003ABA87 /* NSObject+PearlKVO.h */; }; @@ -297,7 +292,69 @@ DA09745D1E99586600F0BFE8 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; DA09745F1E995EB500F0BFE8 /* mpw_tests.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = mpw_tests.xml; path = ../../core/java/tests/src/main/resources/mpw_tests.xml; sourceTree = ""; }; DA0974611E9961F100F0BFE8 /* libsodium.18.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsodium.18.dylib; path = ../../../../../../../usr/local/Cellar/libsodium/1.0.12/lib/libsodium.18.dylib; sourceTree = ""; }; - DA0974631E99620400F0BFE8 /* libscrypt.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libscrypt.0.dylib; path = ../../../../../../../usr/local/Cellar/libscrypt/1.21/lib/libscrypt.0.dylib; sourceTree = ""; }; + DA09791B1E9A824700F0BFE8 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = ""; }; + DA09791C1E9A824700F0BFE8 /* crypto_aead_aes256gcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aead_aes256gcm.h; sourceTree = ""; }; + DA09791D1E9A824700F0BFE8 /* crypto_aead_chacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aead_chacha20poly1305.h; sourceTree = ""; }; + DA09791E1E9A824700F0BFE8 /* crypto_aead_xchacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aead_xchacha20poly1305.h; sourceTree = ""; }; + DA09791F1E9A824700F0BFE8 /* crypto_auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth.h; sourceTree = ""; }; + DA0979201E9A824700F0BFE8 /* crypto_auth_hmacsha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth_hmacsha256.h; sourceTree = ""; }; + DA0979211E9A824700F0BFE8 /* crypto_auth_hmacsha512.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth_hmacsha512.h; sourceTree = ""; }; + DA0979221E9A824700F0BFE8 /* crypto_auth_hmacsha512256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_auth_hmacsha512256.h; sourceTree = ""; }; + DA0979231E9A824700F0BFE8 /* crypto_box.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_box.h; sourceTree = ""; }; + DA0979241E9A824700F0BFE8 /* crypto_box_curve25519xchacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_box_curve25519xchacha20poly1305.h; sourceTree = ""; }; + DA0979251E9A824700F0BFE8 /* crypto_box_curve25519xsalsa20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_box_curve25519xsalsa20poly1305.h; sourceTree = ""; }; + DA0979261E9A824700F0BFE8 /* crypto_core_hchacha20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_hchacha20.h; sourceTree = ""; }; + DA0979271E9A824700F0BFE8 /* crypto_core_hsalsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_hsalsa20.h; sourceTree = ""; }; + DA0979281E9A824700F0BFE8 /* crypto_core_salsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_salsa20.h; sourceTree = ""; }; + DA0979291E9A824700F0BFE8 /* crypto_core_salsa2012.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_salsa2012.h; sourceTree = ""; }; + DA09792A1E9A824700F0BFE8 /* crypto_core_salsa208.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_core_salsa208.h; sourceTree = ""; }; + DA09792B1E9A824700F0BFE8 /* crypto_generichash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_generichash.h; sourceTree = ""; }; + DA09792C1E9A824700F0BFE8 /* crypto_generichash_blake2b.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_generichash_blake2b.h; sourceTree = ""; }; + DA09792D1E9A824700F0BFE8 /* crypto_hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_hash.h; sourceTree = ""; }; + DA09792E1E9A824700F0BFE8 /* crypto_hash_sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_hash_sha256.h; sourceTree = ""; }; + DA09792F1E9A824700F0BFE8 /* crypto_hash_sha512.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_hash_sha512.h; sourceTree = ""; }; + DA0979301E9A824700F0BFE8 /* crypto_kdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_kdf.h; sourceTree = ""; }; + DA0979311E9A824700F0BFE8 /* crypto_kdf_blake2b.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_kdf_blake2b.h; sourceTree = ""; }; + DA0979321E9A824700F0BFE8 /* crypto_kx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_kx.h; sourceTree = ""; }; + DA0979331E9A824700F0BFE8 /* crypto_onetimeauth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_onetimeauth.h; sourceTree = ""; }; + DA0979341E9A824700F0BFE8 /* crypto_onetimeauth_poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_onetimeauth_poly1305.h; sourceTree = ""; }; + DA0979351E9A824700F0BFE8 /* crypto_pwhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_pwhash.h; sourceTree = ""; }; + DA0979361E9A824700F0BFE8 /* crypto_pwhash_argon2i.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_pwhash_argon2i.h; sourceTree = ""; }; + DA0979371E9A824700F0BFE8 /* crypto_pwhash_scryptsalsa208sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_pwhash_scryptsalsa208sha256.h; sourceTree = ""; }; + DA0979381E9A824700F0BFE8 /* crypto_scalarmult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_scalarmult.h; sourceTree = ""; }; + DA0979391E9A824700F0BFE8 /* crypto_scalarmult_curve25519.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_scalarmult_curve25519.h; sourceTree = ""; }; + DA09793A1E9A824700F0BFE8 /* crypto_secretbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_secretbox.h; sourceTree = ""; }; + DA09793B1E9A824700F0BFE8 /* crypto_secretbox_xchacha20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_secretbox_xchacha20poly1305.h; sourceTree = ""; }; + DA09793C1E9A824700F0BFE8 /* crypto_secretbox_xsalsa20poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_secretbox_xsalsa20poly1305.h; sourceTree = ""; }; + DA09793D1E9A824700F0BFE8 /* crypto_shorthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_shorthash.h; sourceTree = ""; }; + DA09793E1E9A824700F0BFE8 /* crypto_shorthash_siphash24.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_shorthash_siphash24.h; sourceTree = ""; }; + DA09793F1E9A824700F0BFE8 /* crypto_sign.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_sign.h; sourceTree = ""; }; + DA0979401E9A824700F0BFE8 /* crypto_sign_ed25519.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_sign_ed25519.h; sourceTree = ""; }; + DA0979411E9A824700F0BFE8 /* crypto_sign_edwards25519sha512batch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_sign_edwards25519sha512batch.h; sourceTree = ""; }; + DA0979421E9A824700F0BFE8 /* crypto_stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream.h; sourceTree = ""; }; + DA0979431E9A824700F0BFE8 /* crypto_stream_aes128ctr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_aes128ctr.h; sourceTree = ""; }; + DA0979441E9A824700F0BFE8 /* crypto_stream_chacha20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_chacha20.h; sourceTree = ""; }; + DA0979451E9A824700F0BFE8 /* crypto_stream_salsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_salsa20.h; sourceTree = ""; }; + DA0979461E9A824700F0BFE8 /* crypto_stream_salsa2012.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_salsa2012.h; sourceTree = ""; }; + DA0979471E9A824700F0BFE8 /* crypto_stream_salsa208.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_salsa208.h; sourceTree = ""; }; + DA0979481E9A824700F0BFE8 /* crypto_stream_xchacha20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_xchacha20.h; sourceTree = ""; }; + DA0979491E9A824700F0BFE8 /* crypto_stream_xsalsa20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_stream_xsalsa20.h; sourceTree = ""; }; + DA09794A1E9A824700F0BFE8 /* crypto_verify_16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_verify_16.h; sourceTree = ""; }; + DA09794B1E9A824700F0BFE8 /* crypto_verify_32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_verify_32.h; sourceTree = ""; }; + DA09794C1E9A824700F0BFE8 /* crypto_verify_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_verify_64.h; sourceTree = ""; }; + DA09794D1E9A824700F0BFE8 /* export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = export.h; sourceTree = ""; }; + DA09794E1E9A824700F0BFE8 /* randombytes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = randombytes.h; sourceTree = ""; }; + DA09794F1E9A824700F0BFE8 /* randombytes_salsa20_random.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = randombytes_salsa20_random.h; sourceTree = ""; }; + DA0979501E9A824700F0BFE8 /* randombytes_sysrandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = randombytes_sysrandom.h; sourceTree = ""; }; + DA0979511E9A824700F0BFE8 /* runtime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runtime.h; sourceTree = ""; }; + DA0979521E9A824700F0BFE8 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utils.h; sourceTree = ""; }; + DA0979531E9A824700F0BFE8 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; + DA0979541E9A824700F0BFE8 /* sodium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sodium.h; sourceTree = ""; }; + DA0979561E9A824700F0BFE8 /* libsodium.18.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libsodium.18.dylib; sourceTree = ""; }; + DA0979571E9A824700F0BFE8 /* libsodium.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsodium.a; sourceTree = ""; }; + DA0979581E9A824700F0BFE8 /* libsodium.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libsodium.dylib; sourceTree = ""; }; + DA0979591E9A824700F0BFE8 /* libsodium.la */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libsodium.la; sourceTree = ""; }; + DA09795B1E9A824700F0BFE8 /* libsodium.pc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libsodium.pc; sourceTree = ""; }; DA16B340170661DB000A0EAB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; DA16B343170661EE000A0EAB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; DA2508F019511D3600AC23F1 /* MPPasswordWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MPPasswordWindowController.xib; sourceTree = ""; }; @@ -345,7 +402,6 @@ DA5BFA4A147E415C00F98B1E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; DA5BFA4C147E415C00F98B1E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; DA5BFA4E147E415C00F98B1E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; - DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libscryptenc-osx.a"; sourceTree = ""; }; DA5E5C971724A667003798D8 /* MPAlgorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithm.h; sourceTree = ""; }; DA5E5C981724A667003798D8 /* MPAlgorithm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAlgorithm.m; sourceTree = ""; }; DA5E5C991724A667003798D8 /* MPAlgorithmV0.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithmV0.h; sourceTree = ""; }; @@ -881,7 +937,6 @@ DAD9B5E1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MasterPassword-Mac-LoginHelper.xcodeproj"; path = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj"; sourceTree = ""; }; DAD9B5EF1762CAA4001835F9 /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; }; DAE8E65319867ADA00416A0F /* libopensslcrypto-osx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libopensslcrypto-osx.a"; sourceTree = ""; }; - DAE8E65619867AF500416A0F /* scrypt */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scrypt; sourceTree = ""; }; DAE8E65719867AF500416A0F /* openssl */ = {isa = PBXFileReference; lastKnownFileType = folder; path = openssl; sourceTree = ""; }; DAEBC45214F6364500987BF6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; DAF4EF52190A828100023C90 /* Exo2.0-Thin.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Thin.otf"; sourceTree = ""; }; @@ -925,8 +980,6 @@ DAFE460115039823003ABA7C /* PearlKeyChain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlKeyChain.m; sourceTree = ""; }; DAFE460215039823003ABA7C /* PearlRSAKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlRSAKey.h; sourceTree = ""; }; DAFE460315039823003ABA7C /* PearlRSAKey.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlRSAKey.m; sourceTree = ""; }; - DAFE460415039823003ABA7C /* PearlSCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlSCrypt.h; sourceTree = ""; }; - DAFE460515039823003ABA7C /* PearlSCrypt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlSCrypt.m; sourceTree = ""; }; DAFE460615039823003ABA7C /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; DAFE4A63150399FF003ABA85 /* NSObject+PearlKVO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+PearlKVO.m"; sourceTree = ""; }; DAFE4A63150399FF003ABA87 /* NSObject+PearlKVO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+PearlKVO.h"; sourceTree = ""; }; @@ -943,6 +996,7 @@ DA9261541BE1A88900369DE5 /* libc++.tbd in Frameworks */, DAADCC6A19FB00B500987B1D /* libKCOrderedAccessorFix.a in Frameworks */, DA9261521BE1A86700369DE5 /* Fabric.framework in Frameworks */, + DA09795D1E9A824700F0BFE8 /* libsodium.a in Frameworks */, DA9261511BE1A86700369DE5 /* SystemConfiguration.framework in Frameworks */, DA250925195148E200AC23F1 /* QuartzCore.framework in Frameworks */, DAD9B5F01762CAA4001835F9 /* ServiceManagement.framework in Frameworks */, @@ -958,10 +1012,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DA0974621E9961F100F0BFE8 /* libsodium.18.dylib in Frameworks */, + DA0979681E9A834C00F0BFE8 /* libsodium.a in Frameworks */, DA09745E1E99586600F0BFE8 /* libxml2.tbd in Frameworks */, - DA0974541E9957F300F0BFE8 /* libopensslcrypto-osx.a in Frameworks */, - DA0974551E9957F300F0BFE8 /* libscryptenc-osx.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -987,7 +1039,6 @@ DAADCC4B19FB000C00987B1D /* QuartzCore.framework in Frameworks */, DA4DA1D91564471A00F6F596 /* libjrswizzle.a in Frameworks */, DAC77CAE148291A600BCF976 /* Foundation.framework in Frameworks */, - DA5E5C9417248AA1003798D8 /* libscryptenc-osx.a in Frameworks */, DA92614B1BE1A4EA00369DE5 /* libopensslcrypto-osx.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -995,6 +1046,109 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + DA0979181E9A824700F0BFE8 /* libsodium-osx */ = { + isa = PBXGroup; + children = ( + DA0979191E9A824700F0BFE8 /* include */, + DA0979551E9A824700F0BFE8 /* lib */, + ); + name = "libsodium-osx"; + path = "libsodium/libsodium-osx"; + sourceTree = ""; + }; + DA0979191E9A824700F0BFE8 /* include */ = { + isa = PBXGroup; + children = ( + DA09791A1E9A824700F0BFE8 /* sodium */, + DA0979541E9A824700F0BFE8 /* sodium.h */, + ); + path = include; + sourceTree = ""; + }; + DA09791A1E9A824700F0BFE8 /* sodium */ = { + isa = PBXGroup; + children = ( + DA09791B1E9A824700F0BFE8 /* core.h */, + DA09791C1E9A824700F0BFE8 /* crypto_aead_aes256gcm.h */, + DA09791D1E9A824700F0BFE8 /* crypto_aead_chacha20poly1305.h */, + DA09791E1E9A824700F0BFE8 /* crypto_aead_xchacha20poly1305.h */, + DA09791F1E9A824700F0BFE8 /* crypto_auth.h */, + DA0979201E9A824700F0BFE8 /* crypto_auth_hmacsha256.h */, + DA0979211E9A824700F0BFE8 /* crypto_auth_hmacsha512.h */, + DA0979221E9A824700F0BFE8 /* crypto_auth_hmacsha512256.h */, + DA0979231E9A824700F0BFE8 /* crypto_box.h */, + DA0979241E9A824700F0BFE8 /* crypto_box_curve25519xchacha20poly1305.h */, + DA0979251E9A824700F0BFE8 /* crypto_box_curve25519xsalsa20poly1305.h */, + DA0979261E9A824700F0BFE8 /* crypto_core_hchacha20.h */, + DA0979271E9A824700F0BFE8 /* crypto_core_hsalsa20.h */, + DA0979281E9A824700F0BFE8 /* crypto_core_salsa20.h */, + DA0979291E9A824700F0BFE8 /* crypto_core_salsa2012.h */, + DA09792A1E9A824700F0BFE8 /* crypto_core_salsa208.h */, + DA09792B1E9A824700F0BFE8 /* crypto_generichash.h */, + DA09792C1E9A824700F0BFE8 /* crypto_generichash_blake2b.h */, + DA09792D1E9A824700F0BFE8 /* crypto_hash.h */, + DA09792E1E9A824700F0BFE8 /* crypto_hash_sha256.h */, + DA09792F1E9A824700F0BFE8 /* crypto_hash_sha512.h */, + DA0979301E9A824700F0BFE8 /* crypto_kdf.h */, + DA0979311E9A824700F0BFE8 /* crypto_kdf_blake2b.h */, + DA0979321E9A824700F0BFE8 /* crypto_kx.h */, + DA0979331E9A824700F0BFE8 /* crypto_onetimeauth.h */, + DA0979341E9A824700F0BFE8 /* crypto_onetimeauth_poly1305.h */, + DA0979351E9A824700F0BFE8 /* crypto_pwhash.h */, + DA0979361E9A824700F0BFE8 /* crypto_pwhash_argon2i.h */, + DA0979371E9A824700F0BFE8 /* crypto_pwhash_scryptsalsa208sha256.h */, + DA0979381E9A824700F0BFE8 /* crypto_scalarmult.h */, + DA0979391E9A824700F0BFE8 /* crypto_scalarmult_curve25519.h */, + DA09793A1E9A824700F0BFE8 /* crypto_secretbox.h */, + DA09793B1E9A824700F0BFE8 /* crypto_secretbox_xchacha20poly1305.h */, + DA09793C1E9A824700F0BFE8 /* crypto_secretbox_xsalsa20poly1305.h */, + DA09793D1E9A824700F0BFE8 /* crypto_shorthash.h */, + DA09793E1E9A824700F0BFE8 /* crypto_shorthash_siphash24.h */, + DA09793F1E9A824700F0BFE8 /* crypto_sign.h */, + DA0979401E9A824700F0BFE8 /* crypto_sign_ed25519.h */, + DA0979411E9A824700F0BFE8 /* crypto_sign_edwards25519sha512batch.h */, + DA0979421E9A824700F0BFE8 /* crypto_stream.h */, + DA0979431E9A824700F0BFE8 /* crypto_stream_aes128ctr.h */, + DA0979441E9A824700F0BFE8 /* crypto_stream_chacha20.h */, + DA0979451E9A824700F0BFE8 /* crypto_stream_salsa20.h */, + DA0979461E9A824700F0BFE8 /* crypto_stream_salsa2012.h */, + DA0979471E9A824700F0BFE8 /* crypto_stream_salsa208.h */, + DA0979481E9A824700F0BFE8 /* crypto_stream_xchacha20.h */, + DA0979491E9A824700F0BFE8 /* crypto_stream_xsalsa20.h */, + DA09794A1E9A824700F0BFE8 /* crypto_verify_16.h */, + DA09794B1E9A824700F0BFE8 /* crypto_verify_32.h */, + DA09794C1E9A824700F0BFE8 /* crypto_verify_64.h */, + DA09794D1E9A824700F0BFE8 /* export.h */, + DA09794E1E9A824700F0BFE8 /* randombytes.h */, + DA09794F1E9A824700F0BFE8 /* randombytes_salsa20_random.h */, + DA0979501E9A824700F0BFE8 /* randombytes_sysrandom.h */, + DA0979511E9A824700F0BFE8 /* runtime.h */, + DA0979521E9A824700F0BFE8 /* utils.h */, + DA0979531E9A824700F0BFE8 /* version.h */, + ); + path = sodium; + sourceTree = ""; + }; + DA0979551E9A824700F0BFE8 /* lib */ = { + isa = PBXGroup; + children = ( + DA0979561E9A824700F0BFE8 /* libsodium.18.dylib */, + DA0979571E9A824700F0BFE8 /* libsodium.a */, + DA0979581E9A824700F0BFE8 /* libsodium.dylib */, + DA0979591E9A824700F0BFE8 /* libsodium.la */, + DA09795A1E9A824700F0BFE8 /* pkgconfig */, + ); + path = lib; + sourceTree = ""; + }; + DA09795A1E9A824700F0BFE8 /* pkgconfig */ = { + isa = PBXGroup; + children = ( + DA09795B1E9A824700F0BFE8 /* libsodium.pc */, + ); + path = pkgconfig; + sourceTree = ""; + }; DA2508F819513C1400AC23F1 /* Other Frameworks */ = { isa = PBXGroup; children = ( @@ -1042,7 +1196,6 @@ DA5BFA47147E415C00F98B1E /* Frameworks */ = { isa = PBXGroup; children = ( - DA0974631E99620400F0BFE8 /* libscrypt.0.dylib */, DA0974611E9961F100F0BFE8 /* libsodium.18.dylib */, DA09745D1E99586600F0BFE8 /* libxml2.tbd */, DA6701B716406A4100B61001 /* Accounts.framework */, @@ -1068,7 +1221,6 @@ children = ( DAEB938518AB0FFD000490CC /* include */, DAE8E65319867ADA00416A0F /* libopensslcrypto-osx.a */, - DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */, ); path = lib; sourceTree = ""; @@ -1626,6 +1778,7 @@ DACA22121705DDC5002C6C22 /* External */ = { isa = PBXGroup; children = ( + DA0979181E9A824700F0BFE8 /* libsodium-osx */, DACA29751705E2BD002C6C22 /* jrswizzle */, DAADCC6819FB007F00987B1D /* KCOrderedAccessorFix */, DA3B8449190FC5A900246EEA /* Mac */, @@ -1785,7 +1938,6 @@ isa = PBXGroup; children = ( DAE8E65719867AF500416A0F /* openssl */, - DAE8E65619867AF500416A0F /* scrypt */, ); path = include; sourceTree = ""; @@ -1878,8 +2030,6 @@ DAFE460115039823003ABA7C /* PearlKeyChain.m */, DAFE460215039823003ABA7C /* PearlRSAKey.h */, DAFE460315039823003ABA7C /* PearlRSAKey.m */, - DAFE460415039823003ABA7C /* PearlSCrypt.h */, - DAFE460515039823003ABA7C /* PearlSCrypt.m */, DAFE460615039823003ABA7C /* README */, ); path = "Pearl-Crypto"; @@ -1900,7 +2050,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - DA10007F1998A4C6002B873F /* scrypt in Headers */, DA89D4EC1A51EABD00AC64D7 /* Pearl-Cocoa.h in Headers */, DA1000801998A4C6002B873F /* openssl in Headers */, DA2CA4F218D323D3007798F8 /* NSTimer+PearlBlock.h in Headers */, @@ -1927,7 +2076,6 @@ DAFE4A3415039824003ABA7C /* PearlCryptUtils.h in Headers */, DAFE4A3615039824003ABA7C /* PearlKeyChain.h in Headers */, DAFE4A3815039824003ABA7C /* PearlRSAKey.h in Headers */, - DAFE4A3A15039824003ABA7C /* PearlSCrypt.h in Headers */, DA30E9D715723E6900A68B4C /* PearlLazy.h in Headers */, DAADCC4719FAFFAD00987B1D /* NSNotificationCenter+PearlEasyCleanup.h in Headers */, DAFE4A63150399FF003ABA88 /* NSObject+PearlKVO.h in Headers */, @@ -2324,7 +2472,6 @@ DA89D4ED1A51EABD00AC64D7 /* Pearl-Cocoa.m in Sources */, DAFE4A3715039824003ABA7C /* PearlKeyChain.m in Sources */, DAFE4A3915039824003ABA7C /* PearlRSAKey.m in Sources */, - DAFE4A3B15039824003ABA7C /* PearlSCrypt.m in Sources */, DA8ED895192906920099B726 /* PearlTween.m in Sources */, DA2CA4F118D323D3007798F8 /* NSTimer+PearlBlock.m in Sources */, DA3B8452190FC86F00246EEA /* NSManagedObject+Pearl.m in Sources */, @@ -2494,10 +2641,10 @@ INFOPLIST_FILE = "Source/Mac/MasterPassword-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/External/Pearl/Pearl-Crypto/lib\"", "$(inherited)", + "$(PROJECT_DIR)/External/libsodium/libsodium-osx/lib", ); - OTHER_CFLAGS = "-DHAS_CPERCIVA=1"; + OTHER_CFLAGS = "-DHAS_SODIUM=1"; PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac; SKIP_INSTALL = NO; WRAPPER_NAME = "Master Password.${WRAPPER_EXTENSION}"; @@ -2553,6 +2700,8 @@ "$(PROJECT_DIR)/External/Pearl/Pearl-Crypto/lib", /usr/local/Cellar/libsodium/1.0.12/lib, /usr/local/Cellar/libscrypt/1.21/lib, + "$(PROJECT_DIR)/External/libsodium/libsodium-ios/lib", + "$(PROJECT_DIR)/External/libsodium/libsodium-osx/lib", ); OTHER_CFLAGS = ( "-DHAS_CPERCIVA=0", @@ -2762,10 +2911,10 @@ INFOPLIST_FILE = "Source/Mac/MasterPassword-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/External/Pearl/Pearl-Crypto/lib\"", "$(inherited)", + "$(PROJECT_DIR)/External/libsodium/libsodium-osx/lib", ); - OTHER_CFLAGS = "-DHAS_CPERCIVA=1"; + OTHER_CFLAGS = "-DHAS_SODIUM=1"; PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac; SKIP_INSTALL = NO; WRAPPER_NAME = "Master Password.${WRAPPER_EXTENSION}"; @@ -2790,10 +2939,10 @@ INFOPLIST_FILE = "Source/Mac/MasterPassword-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/External/Pearl/Pearl-Crypto/lib\"", "$(inherited)", + "$(PROJECT_DIR)/External/libsodium/libsodium-osx/lib", ); - OTHER_CFLAGS = "-DHAS_CPERCIVA=1"; + OTHER_CFLAGS = "-DHAS_SODIUM=1"; PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac; SKIP_INSTALL = NO; WRAPPER_NAME = "Master Password.${WRAPPER_EXTENSION}"; @@ -2815,6 +2964,8 @@ "$(PROJECT_DIR)/External/Pearl/Pearl-Crypto/lib", /usr/local/Cellar/libsodium/1.0.12/lib, /usr/local/Cellar/libscrypt/1.21/lib, + "$(PROJECT_DIR)/External/libsodium/libsodium-ios/lib", + "$(PROJECT_DIR)/External/libsodium/libsodium-osx/lib", ); OTHER_CFLAGS = ( "-DHAS_CPERCIVA=0", @@ -2838,6 +2989,8 @@ "$(PROJECT_DIR)/External/Pearl/Pearl-Crypto/lib", /usr/local/Cellar/libsodium/1.0.12/lib, /usr/local/Cellar/libscrypt/1.21/lib, + "$(PROJECT_DIR)/External/libsodium/libsodium-ios/lib", + "$(PROJECT_DIR)/External/libsodium/libsodium-osx/lib", ); OTHER_CFLAGS = ( "-DHAS_CPERCIVA=0", diff --git a/platform-darwin/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xcscmblueprint b/platform-darwin/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xcscmblueprint index 3f58cf9f..b1788479 100644 --- a/platform-darwin/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xcscmblueprint +++ b/platform-darwin/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xcscmblueprint @@ -9,8 +9,9 @@ "8A15A8EA0B3D0B497C4883425BC74DF995224BB3" : 9223372036854775807, "1712FC0BC3C9AABD8B7B5376E310E93FBDB3BCFA" : 9223372036854775807, "2FE140B36B7D26140DC8D5E5C639DC5900EFCF35" : 9223372036854775807, - "3ED8592497DB6A564366943C9AAD5A46341B5076" : 9223372036854775807, "4DDCFFD91B41F00326AD14553BD66CFD366ABD91" : 9223372036854775807, + "3ED8592497DB6A564366943C9AAD5A46341B5076" : 9223372036854775807, + "81A28796384A028E6C2D47C039DB8B3E5DD6D0FC" : 9223372036854775807, "F788B28042EDBEF29EFE34687DA79A778C2CC260" : 0 }, "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "1DC75A27-0030-4493-ACE8-E1D49AB9A549", @@ -20,8 +21,9 @@ "8A15A8EA0B3D0B497C4883425BC74DF995224BB3" : "MasterPassword\/platform-darwin\/External\/jrswizzle\/", "1712FC0BC3C9AABD8B7B5376E310E93FBDB3BCFA" : "MasterPassword\/platform-darwin\/External\/InAppSettingsKit\/", "2FE140B36B7D26140DC8D5E5C639DC5900EFCF35" : "MasterPassword\/platform-darwin\/External\/uicolor-utilities\/", - "3ED8592497DB6A564366943C9AAD5A46341B5076" : "MasterPassword\/platform-darwin\/External\/AttributedMarkdown\/", "4DDCFFD91B41F00326AD14553BD66CFD366ABD91" : "MasterPassword\/platform-darwin\/External\/Pearl\/", + "3ED8592497DB6A564366943C9AAD5A46341B5076" : "MasterPassword\/platform-darwin\/External\/AttributedMarkdown\/", + "81A28796384A028E6C2D47C039DB8B3E5DD6D0FC" : "MasterPassword\/platform-darwin\/External\/libsodium\/", "F788B28042EDBEF29EFE34687DA79A778C2CC260" : "MasterPassword\/" }, "DVTSourceControlWorkspaceBlueprintNameKey" : "MasterPassword", @@ -58,6 +60,11 @@ "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "4DDCFFD91B41F00326AD14553BD66CFD366ABD91" }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jedisct1\/libsodium.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "81A28796384A028E6C2D47C039DB8B3E5DD6D0FC" + }, { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/github.com\/jonmarimba\/jrswizzle.git", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", diff --git a/platform-darwin/Source/MPAlgorithmV0.m b/platform-darwin/Source/MPAlgorithmV0.m index bd99f90a..089c9f8c 100644 --- a/platform-darwin/Source/MPAlgorithmV0.m +++ b/platform-darwin/Source/MPAlgorithmV0.m @@ -24,8 +24,6 @@ #import "MPAppDelegate_Shared.h" #import "MPAppDelegate_InApp.h" #import "mpw-util.h" -#include -#include /* An AMD HD 7970 calculates 2495M SHA-1 hashes per second at a cost of ~350$ per GPU */ #define CRACKING_PER_SECOND 2495000000UL @@ -33,17 +31,13 @@ NSOperationQueue *_mpwQueue = nil; -@implementation MPAlgorithmV0 { - BN_CTX *_ctx; -} +@implementation MPAlgorithmV0 - (id)init { if (!(self = [super init])) return nil; - _ctx = BN_CTX_new(); - static dispatch_once_t once = 0; dispatch_once( &once, ^{ _mpwQueue = [NSOperationQueue new]; @@ -54,12 +48,6 @@ NSOperationQueue *_mpwQueue = nil; return self; } -- (void)dealloc { - - BN_CTX_free( _ctx ); - _ctx = NULL; -} - - (MPAlgorithmVersion)version { return MPAlgorithmVersion0; @@ -427,9 +415,9 @@ NSOperationQueue *_mpwQueue = nil; [PearlKeyChain deleteItemForQuery:siteQuery]; else [PearlKeyChain addOrUpdateItemForQuery:siteQuery withAttributes:@{ - (__bridge id)kSecValueData: encryptedContent, + (__bridge id)kSecValueData : encryptedContent, #if TARGET_OS_IPHONE - (__bridge id)kSecAttrAccessible : (__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly, + (__bridge id)kSecAttrAccessible: (__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly, #endif }]; ((MPStoredSiteEntity *)site).contentObject = nil; @@ -761,18 +749,17 @@ NSOperationQueue *_mpwQueue = nil; if (!templates) return NO; - BIGNUM *permutations = BN_new(), *templatePermutations = BN_new(); + NSDecimalNumber *permutations = [NSDecimalNumber zero], *templatePermutations; for (size_t t = 0; t < count; ++t) { const char *template = templates[t]; - BN_one( templatePermutations ); + templatePermutations = [NSDecimalNumber one]; for (NSUInteger c = 0; c < strlen( template ); ++c) - BN_mul_word( templatePermutations, - (BN_ULONG)strlen( mpw_charactersInClass( template[c] ) ) ); + templatePermutations = [templatePermutations decimalNumberByMultiplyingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:strlen( mpw_charactersInClass( template[c] ) )]]; - BN_add( permutations, permutations, templatePermutations ); + permutations = [permutations decimalNumberByAdding:templatePermutations]; } - BN_free( templatePermutations ); free( templates ); return [self timeToCrack:timeToCrack permutations:permutations forAttacker:attacker]; @@ -780,114 +767,108 @@ NSOperationQueue *_mpwQueue = nil; - (BOOL)timeToCrack:(out TimeToCrack *)timeToCrack passwordString:(NSString *)password byAttacker:(MPAttacker)attacker { - BIGNUM *permutations = BN_new(); - BN_one( permutations ); + NSDecimalNumber *permutations = [NSDecimalNumber one]; for (NSUInteger c = 0; c < [password length]; ++c) { const char passwordCharacter = [password substringWithRange:NSMakeRange( c, 1 )].UTF8String[0]; - unsigned int characterEntropy = 0; + unsigned long characterEntropy = 0; for (NSString *characterClass in @[ @"v", @"c", @"a", @"x" ]) { char const *charactersForClass = mpw_charactersInClass( characterClass.UTF8String[0] ); if (strchr( charactersForClass, passwordCharacter )) { // Found class for password character. - characterEntropy = (BN_ULONG)strlen( charactersForClass ); + characterEntropy = strlen( charactersForClass ); break; } } if (!characterEntropy) characterEntropy = 256 /* a byte */; - BN_mul_word( permutations, characterEntropy ); + permutations = [permutations decimalNumberByMultiplyingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:characterEntropy]]; } return [self timeToCrack:timeToCrack permutations:permutations forAttacker:attacker]; } -- (BOOL)timeToCrack:(out TimeToCrack *)timeToCrack permutations:(BIGNUM *)permutations forAttacker:(MPAttacker)attacker { +- (BOOL)timeToCrack:(out TimeToCrack *)timeToCrack permutations:(NSDecimalNumber *)permutations forAttacker:(MPAttacker)attacker { // Determine base seconds needed to calculate the permutations. - BIGNUM *secondsToCrack = BN_dup( permutations ); - BN_div_word( secondsToCrack, CRACKING_PER_SECOND ); + NSDecimalNumber *secondsToCrack = [permutations decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:CRACKING_PER_SECOND]]; // Modify seconds needed by applying our hardware budget. switch (attacker) { case MPAttacker1: break; case MPAttacker5K: - BN_mul_word( secondsToCrack, CRACKING_PRICE ); - BN_div_word( secondsToCrack, 5000 ); + secondsToCrack = [secondsToCrack decimalNumberByMultiplyingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:CRACKING_PRICE]]; + secondsToCrack = [secondsToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:5000]]; break; case MPAttacker20M: - BN_mul_word( secondsToCrack, CRACKING_PRICE ); - BN_div_word( secondsToCrack, 20000000 ); + secondsToCrack = [secondsToCrack decimalNumberByMultiplyingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:CRACKING_PRICE]]; + secondsToCrack = [secondsToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:20000000]]; break; case MPAttacker5B: - BN_mul_word( secondsToCrack, CRACKING_PRICE ); - BN_div_word( secondsToCrack, 5000 ); - BN_div_word( secondsToCrack, 1000000 ); + secondsToCrack = [secondsToCrack decimalNumberByMultiplyingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:CRACKING_PRICE]]; + secondsToCrack = [secondsToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:5000]]; + secondsToCrack = [secondsToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:1000000]]; break; } - BIGNUM *max = BN_new(); - BN_set_word( max, (BN_ULONG)-1 ); + NSDecimalNumber *ulong_max = (id)[[NSDecimalNumber alloc] initWithUnsignedLong:ULONG_MAX]; - BIGNUM *hoursToCrack = BN_dup( secondsToCrack ); - BN_div_word( hoursToCrack, 3600 ); - if (BN_cmp( hoursToCrack, max ) < 0) - timeToCrack->hours = BN_get_word( hoursToCrack ); + NSDecimalNumber *hoursToCrack = [secondsToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:3600L]]; + if ([hoursToCrack compare:ulong_max] == NSOrderedAscending) + timeToCrack->hours = (unsigned long long)[hoursToCrack doubleValue]; else - timeToCrack->hours = (BN_ULONG)-1; + timeToCrack->hours = ULONG_MAX; - BIGNUM *daysToCrack = BN_dup( hoursToCrack ); - BN_div_word( daysToCrack, 24 ); - if (BN_cmp( daysToCrack, max ) < 0) - timeToCrack->days = BN_get_word( daysToCrack ); + NSDecimalNumber *daysToCrack = [hoursToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:24L]]; + if ([daysToCrack compare:ulong_max] == NSOrderedAscending) + timeToCrack->days = (unsigned long long)[daysToCrack doubleValue]; else - timeToCrack->days = (BN_ULONG)-1; + timeToCrack->days = ULONG_MAX; - BIGNUM *weeksToCrack = BN_dup( daysToCrack ); - BN_div_word( weeksToCrack, 7 ); - if (BN_cmp( weeksToCrack, max ) < 0) - timeToCrack->weeks = BN_get_word( weeksToCrack ); + NSDecimalNumber *weeksToCrack = [daysToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:7L]]; + if ([weeksToCrack compare:ulong_max] == NSOrderedAscending) + timeToCrack->weeks = (unsigned long long)[weeksToCrack doubleValue]; else - timeToCrack->weeks = (BN_ULONG)-1; + timeToCrack->weeks = ULONG_MAX; - BIGNUM *monthsToCrack = BN_dup( daysToCrack ); - BN_div_word( monthsToCrack, 31 ); - if (BN_cmp( monthsToCrack, max ) < 0) - timeToCrack->months = BN_get_word( monthsToCrack ); + NSDecimalNumber *monthsToCrack = [daysToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:31L]]; + if ([monthsToCrack compare:ulong_max] == NSOrderedAscending) + timeToCrack->months = (unsigned long long)[monthsToCrack doubleValue]; else - timeToCrack->months = (BN_ULONG)-1; + timeToCrack->months = ULONG_MAX; - BIGNUM *yearsToCrack = BN_dup( daysToCrack ); - BN_div_word( yearsToCrack, 356 ); - if (BN_cmp( yearsToCrack, max ) < 0) - timeToCrack->years = BN_get_word( yearsToCrack ); + NSDecimalNumber *yearsToCrack = [daysToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:356L]]; + if ([yearsToCrack compare:ulong_max] == NSOrderedAscending) + timeToCrack->years = (unsigned long long)[yearsToCrack doubleValue]; else - timeToCrack->years = (BN_ULONG)-1; + timeToCrack->years = ULONG_MAX; - BIGNUM *universesToCrack = BN_dup( yearsToCrack ); - BN_div_word( universesToCrack, 14000 ); - BN_div_word( universesToCrack, 1000000 ); - if (BN_cmp( universesToCrack, max ) < 0) - timeToCrack->universes = BN_get_word( universesToCrack ); + NSDecimalNumber *universesToCrack = [yearsToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:14000L]]; + universesToCrack = [universesToCrack decimalNumberByDividingBy: + (id)[[NSDecimalNumber alloc] initWithUnsignedLong:1000000L]]; + if ([universesToCrack compare:ulong_max] == NSOrderedAscending) + timeToCrack->universes = (unsigned long long)[universesToCrack doubleValue]; else - timeToCrack->universes = (BN_ULONG)-1; - - for (unsigned long error = ERR_get_error(); error; error = ERR_get_error()) - err( @"bignum error: %lu", error ); - - BN_free( max ); - BN_free( permutations ); - BN_free( secondsToCrack ); - BN_free( hoursToCrack ); - BN_free( daysToCrack ); - BN_free( weeksToCrack ); - BN_free( monthsToCrack ); - BN_free( yearsToCrack ); - BN_free( universesToCrack ); + timeToCrack->universes = ULONG_MAX; return YES; }