Closed zhenwenc closed 1 year ago
At the moment, when generating a BbsBls12381Sha256KeyPair or BbsBls12381Shake256KeyPair keypair, the ikm argument must be specified:
BbsBls12381Sha256KeyPair
BbsBls12381Shake256KeyPair
ikm
https://github.com/mattrglobal/pairing_crypto/blob/1b92ff562f85b31507d5fca45fb273c6ffcf6eef/wrappers/obj-c/pairing_crypto/bbs_bls12381_shake256_key_pair.m#L20-L22
However, the React Native wrapper is expected to support nullable ikm and/or keyInfo. As a workaround, it generates random bytes to be the value when ikm is absent:
keyInfo
https://github.com/mattrglobal/pairing_crypto/blob/09386deae1ba8d62b22cd1cd6049cc74abe6cbf9/wrappers/react-native/ios/PairingCryptoRn.m#L37-L44
This needs to be implemented in the C or Obj-c wrapper instead, and use secure random properly.
At the moment, when generating a
BbsBls12381Sha256KeyPair
orBbsBls12381Shake256KeyPair
keypair, theikm
argument must be specified:https://github.com/mattrglobal/pairing_crypto/blob/1b92ff562f85b31507d5fca45fb273c6ffcf6eef/wrappers/obj-c/pairing_crypto/bbs_bls12381_shake256_key_pair.m#L20-L22
However, the React Native wrapper is expected to support nullable
ikm
and/orkeyInfo
. As a workaround, it generates random bytes to be the value whenikm
is absent:https://github.com/mattrglobal/pairing_crypto/blob/09386deae1ba8d62b22cd1cd6049cc74abe6cbf9/wrappers/react-native/ios/PairingCryptoRn.m#L37-L44
This needs to be implemented in the C or Obj-c wrapper instead, and use secure random properly.