Merge pull request #357 from daira/prepare-epks-and-ivks

Dummy implementation of Domain API change for prepared ivk and epk
This commit is contained in:
Daira Hopwood 2022-09-15 03:35:10 +01:00 committed by GitHub
commit 33f1c1141e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -84,3 +84,7 @@ debug = true
[profile.bench]
debug = true
[patch.crates-io]
zcash_note_encryption = { git = "https://github.com/daira/librustzcash.git", rev = "515b0a40ec06eb640fffa65b745166511bf56ecc" }
group = { git = "https://github.com/zkcrypto/group.git", rev = "a7f3ceb2373e9fe536996f7b4d55c797f3e667f0" }

View File

@ -102,6 +102,7 @@ impl OrchardDomain {
impl Domain for OrchardDomain {
type EphemeralSecretKey = EphemeralSecretKey;
type EphemeralPublicKey = EphemeralPublicKey;
type PreparedEphemeralPublicKey = EphemeralPublicKey;
type SharedSecret = SharedSecret;
type SymmetricKey = Hash;
type Note = Note;
@ -122,6 +123,10 @@ impl Domain for OrchardDomain {
*note.recipient().pk_d()
}
fn prepare_epk(epk: Self::EphemeralPublicKey) -> Self::PreparedEphemeralPublicKey {
epk
}
fn ka_derive_public(
note: &Self::Note,
esk: &Self::EphemeralSecretKey,
@ -138,7 +143,7 @@ impl Domain for OrchardDomain {
fn ka_agree_dec(
ivk: &Self::IncomingViewingKey,
epk: &Self::EphemeralPublicKey,
epk: &Self::PreparedEphemeralPublicKey,
) -> Self::SharedSecret {
epk.agree(ivk)
}