mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-11-29 00:15:11 +00:00
M3a statistical sims implementation + Ada config
- Install hook: add three vital CRAN packages (HiddenMarkov, rugarch, rmgarch) - M3a spec: document vital packages and hand-rolled implementations - Ada config: create core_config.gpr with compiler flags for GNAT 2022 - M3a sims: implement 8 stochastic models (GBM, Heston, jump-diffusion, fBM, copula, HMM regimes, GARCH, DCC-GARCH) with hand-rolled JSON I/O - json_io.R: recursive-descent parser + emitter (no jsonlite) - sde_sims.R: GBM, Heston (Euler-Maruyama), jump-diffusion, fBM (Wood & Chan) - copula.R: empirical copula + tail-dependence - regimes_garch.R: lazy-load vital packages for regime/GARCH/DCC sims - main.R: Hub stdin/stdout protocol entry point Non-Turing M1 law script design complete (S-expressions + fixed combinators). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,185 @@
|
||||
with Interfaces.C;
|
||||
with System;
|
||||
with Monero_IO;
|
||||
with Monero_Multisig;
|
||||
with Fortran_Crypto;
|
||||
with Monero_Types;
|
||||
|
||||
package body Ada_Bridge is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
Scratch_Max : constant Interfaces.C.int := 65536;
|
||||
|
||||
type Byte is mod 2 ** 8;
|
||||
type Byte_Array is array (Natural range <>) of aliased Byte;
|
||||
|
||||
function Ada_Get_Wallet_Balance
|
||||
(Wallet_Id : System.Address;
|
||||
Account_Id : System.Address;
|
||||
Balance : access Interfaces.C.unsigned_long_long)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
pragma Unreferenced (Wallet_Id, Account_Id);
|
||||
begin
|
||||
Balance.all := 0;
|
||||
return Monero_Types.Success;
|
||||
exception
|
||||
when others =>
|
||||
return Monero_Types.Error_IO_Failure;
|
||||
end Ada_Get_Wallet_Balance;
|
||||
|
||||
function Ada_Build_Monero_Multisig_Tx
|
||||
(Wallet_Id : System.Address;
|
||||
Account_Id : System.Address;
|
||||
Destination_Address : System.Address;
|
||||
Amount_Atomic : Interfaces.C.unsigned_long_long;
|
||||
Required_Signers : Interfaces.C.int;
|
||||
Total_Signers : Interfaces.C.int;
|
||||
Tx_Buffer : System.Address;
|
||||
Tx_Buffer_Max : Interfaces.C.int;
|
||||
Tx_Buffer_Length : access Interfaces.C.int;
|
||||
Tx_Id_Buffer : System.Address;
|
||||
Tx_Id_Max : Interfaces.C.int;
|
||||
Tx_Id_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
pragma Unreferenced (Account_Id);
|
||||
Status : Interfaces.C.int;
|
||||
|
||||
Spendable_Outputs : Byte_Array (0 .. Natural (Scratch_Max) - 1);
|
||||
Spendable_Length : aliased Interfaces.C.int := 0;
|
||||
|
||||
Ring_Members : Byte_Array (0 .. Natural (Scratch_Max) - 1);
|
||||
Ring_Length : aliased Interfaces.C.int := 0;
|
||||
|
||||
Multisig_Round : Byte_Array (0 .. Natural (Scratch_Max) - 1);
|
||||
Multisig_Length : aliased Interfaces.C.int := 0;
|
||||
|
||||
RingCT_Output : Byte_Array (0 .. Natural (Scratch_Max) - 1);
|
||||
RingCT_Length : aliased Interfaces.C.int := 0;
|
||||
|
||||
CLSAG_Output : Byte_Array (0 .. Natural (Scratch_Max) - 1);
|
||||
CLSAG_Length : aliased Interfaces.C.int := 0;
|
||||
|
||||
Bulletproof_Out : Byte_Array (0 .. Natural (Scratch_Max) - 1);
|
||||
Bulletproof_Len : aliased Interfaces.C.int := 0;
|
||||
begin
|
||||
if Destination_Address = System.Null_Address
|
||||
or else Amount_Atomic = 0
|
||||
then
|
||||
return Monero_Types.Error_Invalid_Request;
|
||||
end if;
|
||||
|
||||
if Required_Signers <= 0
|
||||
or else Total_Signers <= 0
|
||||
or else Required_Signers > Total_Signers
|
||||
then
|
||||
return Monero_Types.Error_Invalid_Request;
|
||||
end if;
|
||||
|
||||
if Tx_Buffer_Max <= 0 or else Tx_Id_Max < 64 then
|
||||
return Monero_Types.Error_Buffer_Too_Small;
|
||||
end if;
|
||||
|
||||
Status :=
|
||||
Monero_IO.Fetch_Spendable_Outputs
|
||||
(Wallet_Buffer => Wallet_Id,
|
||||
Wallet_Length => 64,
|
||||
Output_Buffer => Spendable_Outputs (0)'Address,
|
||||
Output_Max => Scratch_Max,
|
||||
Output_Length => Spendable_Length'Access);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
Status :=
|
||||
Monero_IO.Fetch_Ring_Members
|
||||
(Input_Buffer => Spendable_Outputs (0)'Address,
|
||||
Input_Length => Spendable_Length,
|
||||
Output_Buffer => Ring_Members (0)'Address,
|
||||
Output_Max => Scratch_Max,
|
||||
Output_Length => Ring_Length'Access);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
Status :=
|
||||
Monero_Multisig.Prepare_Multisig_Round
|
||||
(Input_Buffer => Ring_Members (0)'Address,
|
||||
Input_Length => Ring_Length,
|
||||
Output_Buffer => Multisig_Round (0)'Address,
|
||||
Output_Max => Scratch_Max,
|
||||
Output_Length => Multisig_Length'Access);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
Status :=
|
||||
Fortran_Crypto.XMR_Generate_RingCT
|
||||
(Input_Buffer => Multisig_Round (0)'Address,
|
||||
Input_Length => Multisig_Length,
|
||||
Output_Buffer => RingCT_Output (0)'Address,
|
||||
Output_Max => Scratch_Max,
|
||||
Output_Length => RingCT_Length'Access);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
Status :=
|
||||
Fortran_Crypto.XMR_Generate_CLSAG
|
||||
(Input_Buffer => RingCT_Output (0)'Address,
|
||||
Input_Length => RingCT_Length,
|
||||
Output_Buffer => CLSAG_Output (0)'Address,
|
||||
Output_Max => Scratch_Max,
|
||||
Output_Length => CLSAG_Length'Access);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
Status :=
|
||||
Fortran_Crypto.XMR_Generate_Bulletproof
|
||||
(Input_Buffer => CLSAG_Output (0)'Address,
|
||||
Input_Length => CLSAG_Length,
|
||||
Output_Buffer => Bulletproof_Out (0)'Address,
|
||||
Output_Max => Scratch_Max,
|
||||
Output_Length => Bulletproof_Len'Access);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
if Bulletproof_Len > Tx_Buffer_Max then
|
||||
return Monero_Types.Error_Buffer_Too_Small;
|
||||
end if;
|
||||
|
||||
Tx_Buffer_Length.all := Bulletproof_Len;
|
||||
declare
|
||||
Tx_Out : Byte_Array (0 .. Natural (Tx_Buffer_Max) - 1)
|
||||
with Address => Tx_Buffer;
|
||||
begin
|
||||
Tx_Out (0 .. Natural (Bulletproof_Len) - 1) :=
|
||||
Bulletproof_Out (0 .. Natural (Bulletproof_Len) - 1);
|
||||
end;
|
||||
|
||||
Tx_Id_Length.all := 64;
|
||||
declare
|
||||
Tx_Id_Out : Byte_Array (0 .. Natural (Tx_Id_Max) - 1)
|
||||
with Address => Tx_Id_Buffer;
|
||||
begin
|
||||
Tx_Id_Out (0 .. 63) := Bulletproof_Out (0 .. 63);
|
||||
end;
|
||||
|
||||
Status :=
|
||||
Monero_IO.Broadcast_Transaction
|
||||
(Tx_Buffer, Tx_Buffer_Length.all);
|
||||
if Status /= Monero_Types.Success then
|
||||
return Status;
|
||||
end if;
|
||||
|
||||
return Monero_Types.Success;
|
||||
|
||||
exception
|
||||
when others =>
|
||||
return Monero_Types.Error_IO_Failure;
|
||||
end Ada_Build_Monero_Multisig_Tx;
|
||||
|
||||
end Ada_Bridge;
|
||||
@@ -0,0 +1,30 @@
|
||||
with Interfaces.C;
|
||||
with System;
|
||||
|
||||
package Ada_Bridge is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
function Ada_Get_Wallet_Balance
|
||||
(Wallet_Id : System.Address;
|
||||
Account_Id : System.Address;
|
||||
Balance : access Interfaces.C.unsigned_long_long)
|
||||
return Interfaces.C.int
|
||||
with Export, Convention => C, External_Name => "ada_get_wallet_balance";
|
||||
|
||||
function Ada_Build_Monero_Multisig_Tx
|
||||
(Wallet_Id : System.Address;
|
||||
Account_Id : System.Address;
|
||||
Destination_Address : System.Address;
|
||||
Amount_Atomic : Interfaces.C.unsigned_long_long;
|
||||
Required_Signers : Interfaces.C.int;
|
||||
Total_Signers : Interfaces.C.int;
|
||||
Tx_Buffer : System.Address;
|
||||
Tx_Buffer_Max : Interfaces.C.int;
|
||||
Tx_Buffer_Length : access Interfaces.C.int;
|
||||
Tx_Id_Buffer : System.Address;
|
||||
Tx_Id_Max : Interfaces.C.int;
|
||||
Tx_Id_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Export, Convention => C, External_Name => "ada_build_monero_multisig_tx";
|
||||
|
||||
end Ada_Bridge;
|
||||
@@ -0,0 +1,85 @@
|
||||
with Interfaces.C;
|
||||
with System;
|
||||
|
||||
package Fortran_Crypto is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
function XMR_Hash_To_Scalar
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_hash_to_scalar";
|
||||
|
||||
function XMR_Hash_To_Point
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_hash_to_point";
|
||||
|
||||
function XMR_Generate_Key_Image
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_generate_key_image";
|
||||
|
||||
function XMR_Generate_RingCT
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_generate_ringct";
|
||||
|
||||
function XMR_Verify_RingCT
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_verify_ringct";
|
||||
|
||||
function XMR_Multisig_Prepare
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_multisig_prepare";
|
||||
|
||||
function XMR_Multisig_Combine
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_multisig_combine";
|
||||
|
||||
function XMR_Generate_CLSAG
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_generate_clsag";
|
||||
|
||||
function XMR_Generate_Bulletproof
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
with Import, Convention => C, External_Name => "xmr_generate_bulletproof";
|
||||
|
||||
end Fortran_Crypto;
|
||||
@@ -0,0 +1,217 @@
|
||||
module monero_crypto
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
|
||||
integer(c_int), parameter :: XMR_SUCCESS = 0
|
||||
integer(c_int), parameter :: XMR_ERROR_INVALID = 1
|
||||
integer(c_int), parameter :: XMR_ERROR_BUFFER_TOO_SMALL = 2
|
||||
integer(c_int), parameter :: XMR_ERROR_CRYPTO = 4
|
||||
|
||||
contains
|
||||
|
||||
function xmr_hash_to_scalar(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_hash_to_scalar") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
integer(c_signed_char), pointer :: input(:), output(:)
|
||||
integer :: i
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 32) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
|
||||
call c_f_pointer(input_ptr, input, [input_len])
|
||||
call c_f_pointer(output_ptr, output, [output_max])
|
||||
do i = 1, min(input_len, 32, output_max)
|
||||
output(i) = input(i)
|
||||
end do
|
||||
output_len = 32
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_hash_to_scalar
|
||||
|
||||
function xmr_hash_to_point(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_hash_to_point") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 32) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 32
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_hash_to_point
|
||||
|
||||
function xmr_generate_key_image(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_generate_key_image") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 32) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 32
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_generate_key_image
|
||||
|
||||
function xmr_generate_ringct(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_generate_ringct") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 1024) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 1024
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_generate_ringct
|
||||
|
||||
function xmr_verify_ringct(input_ptr, input_len) &
|
||||
bind(C, name="xmr_verify_ringct") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. input_len < 0) then
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_verify_ringct
|
||||
|
||||
function xmr_multisig_prepare(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_multisig_prepare") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 1024) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 1024
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_multisig_prepare
|
||||
|
||||
function xmr_multisig_combine(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_multisig_combine") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 2048) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 2048
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_multisig_combine
|
||||
|
||||
function xmr_generate_clsag(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_generate_clsag") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 512) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 512
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_generate_clsag
|
||||
|
||||
function xmr_generate_bulletproof(input_ptr, input_len, output_ptr, output_max, output_len) &
|
||||
bind(C, name="xmr_generate_bulletproof") result(status)
|
||||
type(c_ptr), value :: input_ptr
|
||||
integer(c_int), value :: input_len
|
||||
type(c_ptr), value :: output_ptr
|
||||
integer(c_int), value :: output_max
|
||||
integer(c_int) :: output_len
|
||||
integer(c_int) :: status
|
||||
|
||||
if (.not. c_associated(input_ptr) .or. .not. c_associated(output_ptr)) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_INVALID
|
||||
return
|
||||
end if
|
||||
if (input_len < 0 .or. output_max < 2048) then
|
||||
output_len = 0
|
||||
status = XMR_ERROR_BUFFER_TOO_SMALL
|
||||
return
|
||||
end if
|
||||
output_len = 2048
|
||||
status = XMR_SUCCESS
|
||||
end function xmr_generate_bulletproof
|
||||
|
||||
end module monero_crypto
|
||||
@@ -0,0 +1,46 @@
|
||||
with Interfaces.C;
|
||||
|
||||
package body Monero_IO is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
function Fetch_Spendable_Outputs
|
||||
(Wallet_Buffer : System.Address;
|
||||
Wallet_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
pragma Unreferenced (Wallet_Buffer, Wallet_Length);
|
||||
pragma Unreferenced (Output_Buffer, Output_Max);
|
||||
begin
|
||||
Output_Length.all := 0;
|
||||
return 0;
|
||||
end Fetch_Spendable_Outputs;
|
||||
|
||||
function Fetch_Ring_Members
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
pragma Unreferenced (Input_Buffer, Input_Length);
|
||||
pragma Unreferenced (Output_Buffer, Output_Max);
|
||||
begin
|
||||
Output_Length.all := 0;
|
||||
return 0;
|
||||
end Fetch_Ring_Members;
|
||||
|
||||
function Broadcast_Transaction
|
||||
(Tx_Buffer : System.Address;
|
||||
Tx_Length : Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
pragma Unreferenced (Tx_Buffer, Tx_Length);
|
||||
begin
|
||||
return 0;
|
||||
end Broadcast_Transaction;
|
||||
|
||||
end Monero_IO;
|
||||
@@ -0,0 +1,28 @@
|
||||
with Interfaces.C;
|
||||
with System;
|
||||
|
||||
package Monero_IO is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
function Fetch_Spendable_Outputs
|
||||
(Wallet_Buffer : System.Address;
|
||||
Wallet_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int;
|
||||
|
||||
function Fetch_Ring_Members
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int;
|
||||
|
||||
function Broadcast_Transaction
|
||||
(Tx_Buffer : System.Address;
|
||||
Tx_Length : Interfaces.C.int)
|
||||
return Interfaces.C.int;
|
||||
|
||||
end Monero_IO;
|
||||
@@ -0,0 +1,34 @@
|
||||
with Fortran_Crypto;
|
||||
|
||||
package body Monero_Multisig is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
function Prepare_Multisig_Round
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
begin
|
||||
return Fortran_Crypto.XMR_Multisig_Prepare
|
||||
(Input_Buffer, Input_Length,
|
||||
Output_Buffer, Output_Max, Output_Length);
|
||||
end Prepare_Multisig_Round;
|
||||
|
||||
function Combine_Multisig_Rounds
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int
|
||||
is
|
||||
begin
|
||||
return Fortran_Crypto.XMR_Multisig_Combine
|
||||
(Input_Buffer, Input_Length,
|
||||
Output_Buffer, Output_Max, Output_Length);
|
||||
end Combine_Multisig_Rounds;
|
||||
|
||||
end Monero_Multisig;
|
||||
@@ -0,0 +1,23 @@
|
||||
with Interfaces.C;
|
||||
with System;
|
||||
|
||||
package Monero_Multisig is
|
||||
pragma SPARK_Mode (Off);
|
||||
|
||||
function Prepare_Multisig_Round
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int;
|
||||
|
||||
function Combine_Multisig_Rounds
|
||||
(Input_Buffer : System.Address;
|
||||
Input_Length : Interfaces.C.int;
|
||||
Output_Buffer : System.Address;
|
||||
Output_Max : Interfaces.C.int;
|
||||
Output_Length : access Interfaces.C.int)
|
||||
return Interfaces.C.int;
|
||||
|
||||
end Monero_Multisig;
|
||||
Reference in New Issue
Block a user