#![allow(non_snake_case)]
#![deny(missing_docs)]
#![no_std]
mod encryption;
mod error;
mod keys;
mod note;
mod stealth_address;
#[cfg(feature = "alloc")]
mod transaction;
pub const OUTPUT_NOTES: usize = 2;
pub use encryption::{aes, elgamal};
pub use error::Error;
pub use keys::hash;
pub use keys::public::PublicKey;
pub use keys::secret::SecretKey;
pub use keys::view::ViewKey;
pub use note::{
encrypt_sender, Note, NoteType, VALUE_ENC_SIZE as NOTE_VAL_ENC_SIZE,
};
pub use stealth_address::StealthAddress;
#[cfg(feature = "alloc")]
pub use transaction::TxSkeleton;
use dusk_jubjub::{
JubJubAffine, JubJubScalar, GENERATOR_EXTENDED, GENERATOR_NUMS_EXTENDED,
};
pub fn transparent_value_commitment(value: u64) -> JubJubAffine {
JubJubAffine::from(GENERATOR_EXTENDED * JubJubScalar::from(value))
}
pub fn value_commitment(
value: u64,
blinding_factor: JubJubScalar,
) -> JubJubAffine {
JubJubAffine::from(
(GENERATOR_EXTENDED * JubJubScalar::from(value))
+ (GENERATOR_NUMS_EXTENDED * blinding_factor),
)
}