|
|
@ -19,6 +19,7 @@ extern void curve25519_donna(unsigned char *output, const unsigned char *a, cons
|
|
|
|
NSMutableData *publicKey = [NSMutableData dataWithLength:ECCKeyLength];
|
|
|
|
NSMutableData *publicKey = [NSMutableData dataWithLength:ECCKeyLength];
|
|
|
|
if (!publicKey) { OWSFail(@"Could not allocate buffer"); }
|
|
|
|
if (!publicKey) { OWSFail(@"Could not allocate buffer"); }
|
|
|
|
curve25519_donna(publicKey.mutableBytes, privateKey.mutableBytes, basepoint);
|
|
|
|
curve25519_donna(publicKey.mutableBytes, privateKey.mutableBytes, basepoint);
|
|
|
|
|
|
|
|
// Use KVC to access privateKey and publicKey even though they're private
|
|
|
|
ECKeyPair *result = [ECKeyPair new];
|
|
|
|
ECKeyPair *result = [ECKeyPair new];
|
|
|
|
[result setValue:[privateKey copy] forKey:@"privateKey"];
|
|
|
|
[result setValue:[privateKey copy] forKey:@"privateKey"];
|
|
|
|
[result setValue:[publicKey copy] forKey:@"publicKey"];
|
|
|
|
[result setValue:[publicKey copy] forKey:@"publicKey"];
|
|
|
|