Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PKEv3.php seal/unseal using pk as hex string, not binary #12

Closed
kennt opened this issue Oct 10, 2022 · 2 comments
Closed

PKEv3.php seal/unseal using pk as hex string, not binary #12

kennt opened this issue Oct 10, 2022 · 2 comments

Comments

@kennt
Copy link

kennt commented Oct 10, 2022

I've been trying to implement the paserk sealing code for C++ and have noticed that the paserk-php v3 seal/unseal code is using $pk_compressed as a hex string (rather than binary). In the code from PKEv3.php (around line 171) below, shouldn't
$pk_compressed = $pk_obj->toString();
be
$pk_compressed = Hex::decode($pk_obj->toString());

 
        $pk_compressed = $pk_obj->toString();

        // Step 2:
        $Ak = hash(
            'sha384',
            PKE::DOMAIN_SEPARATION_AUTH . $header . $xk . $eph_pk_compressed . $pk_compressed,
            true
        );
@kennt
Copy link
Author

kennt commented Oct 10, 2022

I've changed my code to use the hex string, and all of the k3.seal.json test-vectors now pass. At this point, it may be easier to update the spec rather than the code/tests.

@paragonie-security
Copy link
Contributor

At this point, it may be easier to update the spec rather than the code/tests.

Nope. We'll fix the code and test vectors.

paragonie-security added a commit to paseto-standard/test-vectors that referenced this issue Oct 11, 2022
paragonie-security added a commit that referenced this issue Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants