Skip to content

Commit 0de57f4

Browse files
committed
Merge pull request #14 from iosdevzone/0.7.0-development
Fix for #13
2 parents 3bafae9 + 5138462 commit 0de57f4

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

IDZSwiftCommonCrypto.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "IDZSwiftCommonCrypto"
4-
s.version = "0.7.0"
4+
s.version = "0.7.1"
55
s.summary = "A wrapper for Apple's Common Crypto library written in Swift."
66

77
s.homepage = "https://github.com/iosdevzone/IDZSwiftCommonCrypto"

IDZSwiftCommonCrypto/HMAC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public class HMAC : Updateable
129129
/// - parameter algorithm: selects the algorithm
130130
/// - parameter key: specifies the key
131131
///
132-
init(algorithm : Algorithm, key : String)
132+
public init(algorithm : Algorithm, key : String)
133133
{
134134
self.algorithm = algorithm
135135
CCHmacInit(context, algorithm.nativeValue(), key, size_t(key.lengthOfBytesUsingEncoding(NSUTF8StringEncoding)))

IDZSwiftCommonCryptoTestApp/AppDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ func test_StreamCryptor_AES_ECB() {
2626
//assert(byteCount == 0, "Final byte count is 0")
2727
assert(expectedCipherText.count == cipherText.count , "Counts are as expected")
2828
assert(expectedCipherText == cipherText, "Obtained expected cipher text")
29+
30+
// Probing https://github.com/iosdevzone/IDZSwiftCommonCrypto/issues/13
31+
let hmac = HMAC(algorithm: .SHA256, key: "secret_key").update("content")?.final() ?? []
32+
print(hexStringFromArray(hmac))
2933
}
3034

3135
@UIApplicationMain

0 commit comments

Comments
 (0)