@@ -2,21 +2,13 @@
|
||||
|
||||
pub mod ristretto;
|
||||
|
||||
extern crate solana_sdk;
|
||||
use crate::ristretto::ristretto_mul;
|
||||
use curve25519_dalek::{constants::RISTRETTO_BASEPOINT_POINT, scalar::Scalar};
|
||||
use solana_sdk::{
|
||||
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info, pubkey::Pubkey,
|
||||
};
|
||||
|
||||
entrypoint!(process_instruction);
|
||||
fn process_instruction(
|
||||
_program_id: &Pubkey,
|
||||
_accounts: &[AccountInfo],
|
||||
_instruction_data: &[u8],
|
||||
) -> ProgramResult {
|
||||
info!("Ristretto multiply");
|
||||
|
||||
fn test_ristretto_mul() -> ProgramResult {
|
||||
let point = RISTRETTO_BASEPOINT_POINT;
|
||||
let scalar = Scalar::zero();
|
||||
let result = ristretto_mul(&point, &scalar)?;
|
||||
@@ -29,3 +21,28 @@ fn process_instruction(
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
entrypoint!(process_instruction);
|
||||
fn process_instruction(
|
||||
_program_id: &Pubkey,
|
||||
_accounts: &[AccountInfo],
|
||||
_instruction_data: &[u8],
|
||||
) -> ProgramResult {
|
||||
info!("Ristretto multiply");
|
||||
|
||||
test_ristretto_mul()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
// Pull in syscall stubs when building for non-BPF targets
|
||||
solana_sdk::program_stubs!();
|
||||
|
||||
#[test]
|
||||
fn test_ristretto() {
|
||||
test_ristretto_mul().unwrap();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user