Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
af18765
Allow caller-owned full SPIN maps and worker-specific banks
ladnir Nov 24, 2026
2246d8c
Merge commit '8a5740d19deb7938ec11cfd156d7eb9cfa5b7a45' into codex/se…
ladnir Nov 25, 2026
3a107da
Fuse two-bit SmallFieldVole sender hashing and reduction on AVX-512 VAES
ladnir Nov 25, 2026
80d8ffb
Fuse two-bit VOLE receiver hashing, reduction and correction on AVX-5…
ladnir Nov 25, 2026
fd2170a
Pack live regular PPRF sender leaves and mask block messages directly
ladnir Nov 25, 2026
675f9cc
Stream compact regular PPRF leaves and unmask receiver corrections di…
ladnir Nov 25, 2026
dc53c8a
Interleave compact XOR PPRF leaf hashes with AVX-512 VAES
ladnir Nov 25, 2026
1b2d240
Recover the regular PPRF receiver root directly and keep block leaf s…
ladnir Nov 25, 2026
f7e893c
Pair regular PPRF sender correction masks with VAES
ladnir Nov 25, 2026
fca9ddb
Fold PPRF corrections in SIMD registers and index internal nodes by row
ladnir Nov 25, 2026
ec75427
Index full PPRF leaves by row and reuse the public VAES keys
ladnir Nov 25, 2026
c2e0423
Hash compact XOR PPRF leaves with 256-bit VAES
ladnir Nov 25, 2026
b2c7216
Batch the first three physical PPRF sender levels across eight trees
ladnir Nov 25, 2026
c49ecaf
Reduce internal PPRF corrections across two AVX2 rows
ladnir Nov 25, 2026
b0795e8
Hash SoftSpoken sender pairs directly into their output
ladnir Nov 25, 2026
7c1ecaa
Fuse two-bit VOLE sender hashing and reduction on AVX2 VAES
ladnir Nov 25, 2026
5b1ea93
Fuse paired two-bit VOLE receiver reductions on AVX2 VAES
ladnir Nov 25, 2026
e29e7b3
Allocate regular PPRF base OTs for immediate overwrite
ladnir Nov 25, 2026
347cf47
Hash partial AVX2 two-bit VOLE sender batches with initialized padding
ladnir Nov 25, 2026
d5198ad
Reuse broadcast PPRF leaf keys on the AVX2 receiver
ladnir Nov 25, 2026
42fd061
Consume complete padded triples in the AVX2 VOLE receiver
ladnir Nov 25, 2026
70f5602
Pin SPIN to the validated Turbo transpose kernels
ladnir Nov 26, 2026
047d68e
Pin SPIN with the corrected artifact test fixture
ladnir Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions libOTe/Tools/OtPairHashVaes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#pragma once
#include "cryptoTools/Crypto/AES.h"
#include <array>

#ifdef OC_ENABLE_VAES
namespace osuCrypto::details
{
// Each YMM lane holds one sender message. Keep both messages in registers
// through the Davies-Meyer feed-forward and store directly to the output.
struct OtPairHashVaes
{
__m256i key[11];
__m256i dpair;

OC_FORCEINLINE OtPairHashVaes(const osuCrypto::AES& aes, block delta)
: dpair(_mm256_set_m128i(delta.mData, _mm_setzero_si128()))
{
for (u64 k = 0; k < 11; ++k)
key[k] = _mm256_broadcastsi128_si256(aes.mRoundKey[k].mData);
}

template<bool clearChoiceBit, bool streaming = false, bool aligned32 = false>
OC_FORCEINLINE void hashEight(const block* r, std::array<block, 2>* m) const
{
const auto mask = _mm256_set_epi64x(-1, -2, -1, -2);
__m256i x0, x1, x2, x3, x4, x5, x6, x7;
__m256i a0, a1, a2, a3, a4, a5, a6, a7;
#define OC_HASH_LANES(OP) OP(0); OP(1); OP(2); OP(3); OP(4); OP(5); OP(6); OP(7)
#define OC_HASH_LOAD(j) \
x##j = _mm256_xor_si256(_mm256_broadcastsi128_si256(_mm_loadu_si128(&r[j].mData)), dpair); \
if constexpr (clearChoiceBit) x##j = _mm256_and_si256(x##j, mask); \
a##j = _mm256_xor_si256(x##j, key[0])
#define OC_HASH_ROUND(j) a##j = _mm256_aesenc_epi128(a##j, key[k])
#define OC_HASH_STORE(j) \
a##j = _mm256_xor_si256(_mm256_aesenclast_epi128(a##j, key[10]), x##j); \
if constexpr (streaming && aligned32) \
_mm256_stream_si256(reinterpret_cast<__m256i*>(&m[j]), a##j); \
else if constexpr (streaming) { \
_mm_stream_si128(&m[j][0].mData, _mm256_castsi256_si128(a##j)); \
_mm_stream_si128(&m[j][1].mData, _mm256_extracti128_si256(a##j, 1)); \
} else \
_mm256_storeu_si256(reinterpret_cast<__m256i*>(&m[j]), a##j)
OC_HASH_LANES(OC_HASH_LOAD);
for (u64 k = 1; k < 10; ++k)
{
OC_HASH_LANES(OC_HASH_ROUND);
}
OC_HASH_LANES(OC_HASH_STORE);
#undef OC_HASH_STORE
#undef OC_HASH_ROUND
#undef OC_HASH_LOAD
#undef OC_HASH_LANES
}
};
}
#endif
Loading
Loading