-
Notifications
You must be signed in to change notification settings - Fork 1
/
DiffieHellman.h
34 lines (26 loc) · 970 Bytes
/
DiffieHellman.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// DiffieHellman.h
// ECDHTest
//
// Created by David Benko on 2/2/15.
// Copyright (c) 2015 David Benko. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonKeyDerivation.h>
@protocol DiffieHellmanDelegate <NSObject>
@required
- (NSURLRequest *)keyExchangeRequest:(NSString *)ourPublicKey;
- (NSString *)parseKeyExchangeResponse:(NSData *)data;
@optional
- (void)diffieHellmanHandleError:(NSError *)error;
@end
@interface DiffieHellman : NSObject
FOUNDATION_EXPORT CCPBKDFAlgorithm const KeyDerivationAlgorithm;
FOUNDATION_EXPORT CCPseudoRandomAlgorithm const HmacAlgorithm;
FOUNDATION_EXPORT size_t const KeyDerivationRounds;
FOUNDATION_EXPORT size_t const DHSecretLength;
FOUNDATION_EXPORT size_t const KeyLength;
FOUNDATION_EXPORT size_t const SaltLength;
@property (nonatomic, weak) id<DiffieHellmanDelegate> delegate;
- (void)keyExchange:(void (^)(NSString *ourPubKey, NSString *key, NSString *salt))callback;
@end