mirror of
https://github.com/monero-project/monero.git
synced 2025-02-08 15:35:21 -05:00
32-bit platform compatibility in Rust FFI (untested)
This commit is contained in:
parent
10c6c12b18
commit
3a5cf70066
@ -8,8 +8,8 @@ namespace fcmp_pp_rust {
|
|||||||
// ----- deps C bindings -----
|
// ----- deps C bindings -----
|
||||||
|
|
||||||
/// Inner integer type that the [`Limb`] newtype wraps.
|
/// Inner integer type that the [`Limb`] newtype wraps.
|
||||||
// TODO: This is only valid for 64-bit platforms
|
// TODO: test 32-bit platforms
|
||||||
using Word = uint64_t;
|
using Word = uintptr_t;
|
||||||
|
|
||||||
/// Big integers are represented as an array of smaller CPU word-size integers
|
/// Big integers are represented as an array of smaller CPU word-size integers
|
||||||
/// called "limbs".
|
/// called "limbs".
|
||||||
@ -49,14 +49,16 @@ struct Residue {
|
|||||||
|
|
||||||
/// A constant-time implementation of the Ed25519 field.
|
/// A constant-time implementation of the Ed25519 field.
|
||||||
struct SeleneScalar {
|
struct SeleneScalar {
|
||||||
Residue<4> _0;
|
Residue<32 / sizeof(uintptr_t)> _0;
|
||||||
};
|
};
|
||||||
|
static_assert(sizeof(SeleneScalar) == 32, "unexpected size of selene scalar");
|
||||||
|
|
||||||
|
|
||||||
/// The field novel to Helios/Selene.
|
/// The field novel to Helios/Selene.
|
||||||
struct HeliosScalar {
|
struct HeliosScalar {
|
||||||
Residue<4> _0;
|
Residue<32 / sizeof(uintptr_t)> _0;
|
||||||
};
|
};
|
||||||
|
static_assert(sizeof(HeliosScalar) == 32, "unexpected size of helios scalar");
|
||||||
|
|
||||||
struct HeliosPoint {
|
struct HeliosPoint {
|
||||||
SeleneScalar x;
|
SeleneScalar x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user