Skip to content

Instantly share code, notes, and snippets.

@trianglman
Created August 25, 2014 14:27
Show Gist options
  • Save trianglman/57d21e274bd3e7e987f9 to your computer and use it in GitHub Desktop.
Save trianglman/57d21e274bd3e7e987f9 to your computer and use it in GitHub Desktop.
extension snippet
typedef unsigned char ed25519_public_key[32];
typedef unsigned char ed25519_secret_key[32];
ZEND_FUNCTION(ec_generate_pk)
{
ed25519_secret_key sk;
int skLen;
int curveType = 1;//EC_ED25519
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &sk, &skLen, &curveType) == FAILURE) {
RETURN_NULL();
}
ed25519_public_key pk;
ed25519_publickey(sk,pk);
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment