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

feat(wasm): expose presentation verifying key #617

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

sinui0
Copy link
Member

@sinui0 sinui0 commented Oct 2, 2024

This PR exposes the verifying key for a presentation so that it can be checked prior to performing verification.

Copy link
Collaborator

@0xtsukino 0xtsukino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error[E0599]: no method named `verifying_key` found for struct `tlsn_core::presentation::Presentation` in the current scope
   --> crates/wasm/src/types.rs:248:16
    |
248 |         self.0.verifying_key().into()
    |                ^^^^^^^^^^^^^ method not found in `Presentation`

Actually got a compilation error, I tried to change it to self.0.attestation.body.verifying_key() but then attestation is a private field:

error[E0616]: field `attestation` of struct `tlsn_core::presentation::Presentation` is private
   --> crates/wasm/src/types.rs:248:16
    |
248 |         self.0.attestation.body.verifying_key().into()
    |                ^^^^^^^^^^^ private field

@0xtsukino 0xtsukino self-requested a review October 2, 2024 11:35
@sinui0
Copy link
Member Author

sinui0 commented Oct 2, 2024

error[E0599]: no method named `verifying_key` found for struct `tlsn_core::presentation::Presentation` in the current scope
   --> crates/wasm/src/types.rs:248:16
    |
248 |         self.0.verifying_key().into()
    |                ^^^^^^^^^^^^^ method not found in `Presentation`

Actually got a compilation error, I tried to change it to self.0.attestation.body.verifying_key() but then attestation is a private field:

error[E0616]: field `attestation` of struct `tlsn_core::presentation::Presentation` is private
   --> crates/wasm/src/types.rs:248:16
    |
248 |         self.0.attestation.body.verifying_key().into()
    |                ^^^^^^^^^^^ private field

Was this build caching or something?

@sinui0
Copy link
Member Author

sinui0 commented Oct 2, 2024

/// Returns the verifying key.
pub fn verifying_key(&self) -> &VerifyingKey {
self.attestation.verifying_key()
}

@0xtsukino
Copy link
Collaborator

Was this build caching or something?

Ahh i guess it was. i nuked everything and now it builds. Also verified the wasm module locally that it works.

@heeckhau heeckhau merged commit b724d6a into dev Oct 3, 2024
5 checks passed
@heeckhau heeckhau deleted the feat/wasm-presentation-verifying-key branch October 3, 2024 06:44
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

Successfully merging this pull request may close these issues.

3 participants