Lines Matching refs:keypair
572 zend_string *keypair; in PHP_FUNCTION() local
579 keypair = zend_string_alloc(keypair_len, 0); in PHP_FUNCTION()
580 if (crypto_box_keypair((unsigned char *) ZSTR_VAL(keypair) + in PHP_FUNCTION()
582 (unsigned char *) ZSTR_VAL(keypair)) != 0) { in PHP_FUNCTION()
583 zend_string_efree(keypair); in PHP_FUNCTION()
587 ZSTR_VAL(keypair)[keypair_len] = 0; in PHP_FUNCTION() local
589 RETURN_NEW_STR(keypair); in PHP_FUNCTION()
594 zend_string *keypair; in PHP_FUNCTION() local
609 keypair = zend_string_alloc(keypair_len, 0); in PHP_FUNCTION()
610 if (crypto_box_seed_keypair((unsigned char *) ZSTR_VAL(keypair) + in PHP_FUNCTION()
612 (unsigned char *) ZSTR_VAL(keypair), in PHP_FUNCTION()
614 zend_string_efree(keypair); in PHP_FUNCTION()
618 ZSTR_VAL(keypair)[keypair_len] = 0; in PHP_FUNCTION() local
620 RETURN_NEW_STR(keypair); in PHP_FUNCTION()
625 zend_string *keypair; in PHP_FUNCTION() local
647 keypair = zend_string_alloc(keypair_len, 0); in PHP_FUNCTION()
648 memcpy(ZSTR_VAL(keypair), secretkey, crypto_box_SECRETKEYBYTES); in PHP_FUNCTION()
649 memcpy(ZSTR_VAL(keypair) + crypto_box_SECRETKEYBYTES, publickey, in PHP_FUNCTION()
651 ZSTR_VAL(keypair)[keypair_len] = 0; in PHP_FUNCTION() local
653 RETURN_STR(keypair); in PHP_FUNCTION()
659 unsigned char *keypair; in PHP_FUNCTION() local
663 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
673 memcpy(ZSTR_VAL(secretkey), keypair, crypto_box_SECRETKEYBYTES); in PHP_FUNCTION()
682 unsigned char *keypair; in PHP_FUNCTION() local
686 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
696 memcpy(ZSTR_VAL(publickey), keypair + crypto_box_SECRETKEYBYTES, in PHP_FUNCTION()
732 unsigned char *keypair; in PHP_FUNCTION() local
744 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
756 secretkey = keypair; in PHP_FUNCTION()
757 publickey = keypair + crypto_box_SECRETKEYBYTES; in PHP_FUNCTION()
779 unsigned char *keypair; in PHP_FUNCTION() local
790 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
802 secretkey = keypair; in PHP_FUNCTION()
803 publickey = keypair + crypto_box_SECRETKEYBYTES; in PHP_FUNCTION()
857 unsigned char *keypair; in PHP_FUNCTION() local
865 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
873 secretkey = keypair; in PHP_FUNCTION()
874 publickey = keypair + crypto_box_SECRETKEYBYTES; in PHP_FUNCTION()
892 zend_string *keypair; in PHP_FUNCTION() local
899 keypair = zend_string_alloc(keypair_len, 0); in PHP_FUNCTION()
900 if (crypto_sign_keypair((unsigned char *) ZSTR_VAL(keypair) + in PHP_FUNCTION()
902 (unsigned char *) ZSTR_VAL(keypair)) != 0) { in PHP_FUNCTION()
903 zend_string_efree(keypair); in PHP_FUNCTION()
907 ZSTR_VAL(keypair)[keypair_len] = 0; in PHP_FUNCTION() local
909 RETURN_NEW_STR(keypair); in PHP_FUNCTION()
914 zend_string *keypair; in PHP_FUNCTION() local
929 keypair = zend_string_alloc(keypair_len, 0); in PHP_FUNCTION()
930 if (crypto_sign_seed_keypair((unsigned char *) ZSTR_VAL(keypair) + in PHP_FUNCTION()
932 (unsigned char *) ZSTR_VAL(keypair), in PHP_FUNCTION()
934 zend_string_efree(keypair); in PHP_FUNCTION()
938 ZSTR_VAL(keypair)[keypair_len] = 0; in PHP_FUNCTION() local
940 RETURN_NEW_STR(keypair); in PHP_FUNCTION()
945 zend_string *keypair; in PHP_FUNCTION() local
967 keypair = zend_string_alloc(keypair_len, 0); in PHP_FUNCTION()
968 memcpy(ZSTR_VAL(keypair), secretkey, crypto_sign_SECRETKEYBYTES); in PHP_FUNCTION()
969 memcpy(ZSTR_VAL(keypair) + crypto_sign_SECRETKEYBYTES, publickey, in PHP_FUNCTION()
971 ZSTR_VAL(keypair)[keypair_len] = 0; in PHP_FUNCTION() local
973 RETURN_STR(keypair); in PHP_FUNCTION()
1008 unsigned char *keypair; in PHP_FUNCTION() local
1012 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
1022 memcpy(ZSTR_VAL(secretkey), keypair, crypto_sign_SECRETKEYBYTES); in PHP_FUNCTION()
1031 unsigned char *keypair; in PHP_FUNCTION() local
1035 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
1045 memcpy(ZSTR_VAL(publickey), keypair + crypto_sign_SECRETKEYBYTES, in PHP_FUNCTION()
2460 zend_string *keypair; in PHP_FUNCTION() local
2473 keypair = zend_string_alloc(crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES, 0); in PHP_FUNCTION()
2474 sk = (unsigned char *) ZSTR_VAL(keypair); in PHP_FUNCTION()
2479 zend_string_efree(keypair); in PHP_FUNCTION()
2483 ZSTR_VAL(keypair)[crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES] = 0; in PHP_FUNCTION() local
2484 RETURN_STR(keypair); in PHP_FUNCTION()
2491 zend_string *keypair; in PHP_FUNCTION() local
2496 keypair = zend_string_alloc(crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES, 0); in PHP_FUNCTION()
2497 sk = (unsigned char *) ZSTR_VAL(keypair); in PHP_FUNCTION()
2501 zend_string_efree(keypair); in PHP_FUNCTION()
2505 ZSTR_VAL(keypair)[crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES] = 0; in PHP_FUNCTION() local
2506 RETURN_STR(keypair); in PHP_FUNCTION()
2512 unsigned char *keypair; in PHP_FUNCTION() local
2516 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
2526 memcpy(ZSTR_VAL(secretkey), keypair, crypto_kx_SECRETKEYBYTES); in PHP_FUNCTION()
2535 unsigned char *keypair; in PHP_FUNCTION() local
2539 &keypair, &keypair_len) == FAILURE) { in PHP_FUNCTION()
2549 memcpy(ZSTR_VAL(publickey), keypair + crypto_kx_SECRETKEYBYTES, in PHP_FUNCTION()
2560 unsigned char *keypair; in PHP_FUNCTION() local
2569 &keypair, &keypair_len, in PHP_FUNCTION()
2582 client_sk = &keypair[0]; in PHP_FUNCTION()
2583 client_pk = &keypair[crypto_kx_SECRETKEYBYTES]; in PHP_FUNCTION()
2610 unsigned char *keypair; in PHP_FUNCTION() local
2619 &keypair, &keypair_len, in PHP_FUNCTION()
2632 server_sk = &keypair[0]; in PHP_FUNCTION()
2633 server_pk = &keypair[crypto_kx_SECRETKEYBYTES]; in PHP_FUNCTION()