|
@@ -15,6 +15,8 @@ use crate::sigma_proofs::{
|
|
|
pubkey_validity::PubkeyValidityProof,
|
|
pubkey_validity::PubkeyValidityProof,
|
|
|
zero_ciphertext::ZeroCiphertextProof,
|
|
zero_ciphertext::ZeroCiphertextProof,
|
|
|
};
|
|
};
|
|
|
|
|
+#[cfg(target_arch = "wasm32")]
|
|
|
|
|
+use wasm_bindgen::prelude::*;
|
|
|
use {
|
|
use {
|
|
|
crate::{
|
|
crate::{
|
|
|
pod::{impl_from_bytes, impl_from_str},
|
|
pod::{impl_from_bytes, impl_from_str},
|
|
@@ -26,6 +28,7 @@ use {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/// The `CiphertextCommitmentEqualityProof` type as a `Pod`.
|
|
/// The `CiphertextCommitmentEqualityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodCiphertextCommitmentEqualityProof(
|
|
pub struct PodCiphertextCommitmentEqualityProof(
|
|
@@ -68,6 +71,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `CiphertextCiphertextEqualityProof` type as a `Pod`.
|
|
/// The `CiphertextCiphertextEqualityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodCiphertextCiphertextEqualityProof(
|
|
pub struct PodCiphertextCiphertextEqualityProof(
|
|
@@ -110,6 +114,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `GroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
/// The `GroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodGroupedCiphertext2HandlesValidityProof(
|
|
pub struct PodGroupedCiphertext2HandlesValidityProof(
|
|
@@ -152,6 +157,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `GroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
/// The `GroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodGroupedCiphertext3HandlesValidityProof(
|
|
pub struct PodGroupedCiphertext3HandlesValidityProof(
|
|
@@ -194,6 +200,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `BatchedGroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
/// The `BatchedGroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodBatchedGroupedCiphertext2HandlesValidityProof(
|
|
pub struct PodBatchedGroupedCiphertext2HandlesValidityProof(
|
|
@@ -242,6 +249,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `BatchedGroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
/// The `BatchedGroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodBatchedGroupedCiphertext3HandlesValidityProof(
|
|
pub struct PodBatchedGroupedCiphertext3HandlesValidityProof(
|
|
@@ -290,6 +298,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `ZeroCiphertextProof` type as a `Pod`.
|
|
/// The `ZeroCiphertextProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy)]
|
|
#[derive(Clone, Copy)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodZeroCiphertextProof(pub(crate) [u8; ZERO_CIPHERTEXT_PROOF_LEN]);
|
|
pub struct PodZeroCiphertextProof(pub(crate) [u8; ZERO_CIPHERTEXT_PROOF_LEN]);
|
|
@@ -330,6 +339,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `PercentageWithCapProof` type as a `Pod`.
|
|
/// The `PercentageWithCapProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy, bytemuck_derive::Pod, bytemuck_derive::Zeroable)]
|
|
#[derive(Clone, Copy, bytemuck_derive::Pod, bytemuck_derive::Zeroable)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodPercentageWithCapProof(pub(crate) [u8; PERCENTAGE_WITH_CAP_PROOF_LEN]);
|
|
pub struct PodPercentageWithCapProof(pub(crate) [u8; PERCENTAGE_WITH_CAP_PROOF_LEN]);
|
|
@@ -370,6 +380,7 @@ impl_from_bytes!(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
/// The `PubkeyValidityProof` type as a `Pod`.
|
|
/// The `PubkeyValidityProof` type as a `Pod`.
|
|
|
|
|
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
|
|
|
#[derive(Clone, Copy, bytemuck_derive::Pod, bytemuck_derive::Zeroable)]
|
|
#[derive(Clone, Copy, bytemuck_derive::Pod, bytemuck_derive::Zeroable)]
|
|
|
#[repr(transparent)]
|
|
#[repr(transparent)]
|
|
|
pub struct PodPubkeyValidityProof(pub(crate) [u8; PUBKEY_VALIDITY_PROOF_LEN]);
|
|
pub struct PodPubkeyValidityProof(pub(crate) [u8; PUBKEY_VALIDITY_PROOF_LEN]);
|