GMEllipticCurveCrypto icon indicating copy to clipboard operation
GMEllipticCurveCrypto copied to clipboard

Don't create sharedSecretForPublicKey

Open jerry770311 opened this issue 6 years ago • 0 comments

This is my EC publicKey: cardOrganization.publicKey = [[NSData alloc]initWithBase64EncodedString:@"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYktbLuAv0v52erE5LPscomKaOmQsvevxzOyn9k4sF1hqpBc5kUygzxA9Jl0R/2dTuk8ka7UCujk36xeUsLVpWA==" options:0 ] (bytes length:91) NSData *sharedSecretKey = [privateCrypto sharedSecretForPublicKey:cardOrganization.publicKey];

  • (NSData*)sharedSecretForPublicKey: (NSData*)otherPublicKey { if ([otherPublicKey length] != _bytes + 1) { [NSException raise:@"Invalid Key" format:@"Public key %@ is invalid", otherPublicKey];<< run this crash } } help!
<img width="897" alt="2019-03-07 5 26 28" src="https://user-images.githubusercontent.com/48314736/53946164-29e11b00-40fe-11e9-9cf0-facfef961397.png">

jerry770311 avatar Mar 07 '19 09:03 jerry770311