Document the new DPF surfaces in one command set, and test the field, half-tree, and multipoint edges.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0d8a5a8131
commit
0dff6df8ed
250 changed files with 12199 additions and 1981 deletions
|
|
@ -1,6 +1,5 @@
|
|||
/// @file dpf/prg_aes.hpp
|
||||
/// @brief
|
||||
/// @details
|
||||
/// @brief Fixed-key AES Matyas–Meyer–Oseas PRG.
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @copyright Copyright (c) 2019-2024 Ryan Henry and [others](@ref authors)
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
|
|
@ -100,10 +99,15 @@ HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
|
|||
HEDLEY_PRAGMA(GCC diagnostic pop)
|
||||
}
|
||||
|
||||
/// Round-major multi-block MMO. Positions use the same lane as
|
||||
/// @brief Round-major multi-block MMO. Positions use the same lane as
|
||||
/// `eval` / `eval01` (`set_epi64x(0, pos)`). The first AddRoundKey
|
||||
/// includes `rd_key[0]` so this matches the one-block `eval` for any
|
||||
/// key, not only the all-zero key this PRG currently installs.
|
||||
/// @param seed the PRG seed
|
||||
/// @param output the destination. Unused when `count` is 0
|
||||
/// @param count the number of blocks
|
||||
/// @param pos the 0-based index
|
||||
/// @throws std::invalid_argument if `prg lane index is out of range`
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
static void eval(block_type seed, block_type * HEDLEY_RESTRICT output,
|
||||
psnip_uint32_t count, psnip_uint32_t pos = 0)
|
||||
|
|
@ -164,8 +168,11 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
|
|||
}
|
||||
}
|
||||
|
||||
/// Four independent `eval01` calls as one 8-block round-major AES.
|
||||
/// `left[i] == eval(seeds[i], 0)`, `right[i] == eval(seeds[i], 1)`.
|
||||
/// @brief Four independent `eval01` calls as one 8-block round-major AES.
|
||||
/// @details `left[i] == eval(seeds[i], 0)`, `right[i] == eval(seeds[i], 1)`.
|
||||
/// @param seeds the root seeds
|
||||
/// @param left the `left`
|
||||
/// @param right the `right`
|
||||
HEDLEY_NO_THROW
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_NON_NULL(1, 2, 3)
|
||||
|
|
@ -198,7 +205,10 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
|
|||
}
|
||||
}
|
||||
|
||||
/// Four independent `eval(seed, pos)` as one 4-block round-major AES.
|
||||
/// @brief Four independent `eval(seed, pos)` as one 4-block round-major AES.
|
||||
/// @param seeds the root seeds
|
||||
/// @param output the destination. Unused when `count` is 0
|
||||
/// @param pos the 0-based index
|
||||
HEDLEY_NO_THROW
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_NON_NULL(1, 2)
|
||||
|
|
@ -229,7 +239,10 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
|
|||
}
|
||||
}
|
||||
|
||||
/// Eight independent `eval(seed, pos)` as one 8-block round-major AES.
|
||||
/// @brief Eight independent `eval(seed, pos)` as one 8-block round-major AES.
|
||||
/// @param seeds the root seeds
|
||||
/// @param output the destination. Unused when `count` is 0
|
||||
/// @param pos the 0-based index
|
||||
HEDLEY_NO_THROW
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_NON_NULL(1, 2)
|
||||
|
|
@ -260,7 +273,13 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
|
|||
}
|
||||
}
|
||||
|
||||
/// Raw-bit subtractive share of `T` for party `Party` (see `prg.hpp`).
|
||||
/// @brief Raw-bit subtractive share of `T` for party `Party` (see `prg.hpp`).
|
||||
/// @tparam T value type
|
||||
/// @tparam Party party index, `0` or `1`
|
||||
/// @param seed the PRG seed
|
||||
/// @param pos the 0-based index
|
||||
/// @return Raw-bit subtractive share of `T` for party `Party` (see `prg.hpp`)
|
||||
/// @see `prg.hpp`
|
||||
template <typename T, std::size_t Party>
|
||||
HEDLEY_NO_THROW
|
||||
static auto expand(block_type seed, psnip_uint32_t pos = 0) noexcept;
|
||||
|
|
@ -268,8 +287,10 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
|
|||
private:
|
||||
static const AesKey key;
|
||||
|
||||
/// `blk[i]` is already `seed[i] XOR rd_key[0] XOR pos_i`. Runs AES
|
||||
/// @brief `blk[i]` is already `seed[i] XOR rd_key[0] XOR pos_i`. Runs AES
|
||||
/// rounds 1..last and the MMO feed-forward `XOR seed[i]`.
|
||||
/// @param blk the `blk`
|
||||
/// @param seed the PRG seed
|
||||
HEDLEY_NO_THROW
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_NON_NULL(1, 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue