Repository navigation
v1.0.0-alpha.2
Pre-release
Pre-release
·
7 commits
to main
since this release
Second alpha of the 1.0 development line. It fixes a Delta recovery in
v1.0.0-alpha.1's garbling hash (see Security), so both parties of a protocol
must upgrade together, and class layouts and wire transcripts change, so every
dependent must be rebuilt. Both alphas install as CMake package version 1.0.0,
so pin the tag.
Security
MITCCRH: the bucketed key reuse (ReuseShift > 0, default 3) now
carries the gate id into the cipher input,
H(x, i) = y ⊕ E_{S ⊕ (i >> ReuseShift)}(y)withy = σ(x) ⊕ T(i),
T(i) = makeBlock(i, 0). Previously the gids sharing a bucket key
hashed a block to the same value, so a wire label fed to two AND gates
of one bucket (orAND(a, a)) gave half-gate rows whose XOR was0or
Δ, and the evaluator recoveredΔ. Affectsv1.0.0-alpha.1, the
first release with the bucketedReuseShifthash; the 0.3.x line keys
every gate separately and is unaffected by this leak.
Every MITCCRH-derived transcript changes; both parties must upgrade
together, pinned wire-trace baselines must be regenerated, and every
dependent must be rebuilt (the class layout changed). (Issue #212.)MITCCRH: an instance that hashed with more than oneK(for example
hash<1, 1>and thenhash<2, 1>) read past its key schedule. It renewed
the schedule only once exactlyBatchSizelanes were used, so a mix ofK
stepped over that point, hashed under round keys read from the memory after
the schedule, and never re-keyed again. It now starts a new schedule whenever
the nextKlanes do not fit, skipping the leftover gids. Affects
v1.0.0-alpha.1and the 0.3.x line; an instance used with oneK, or with
setScalled before each change ofK, never reached the over-read.- Deterministic test mode is a build option,
-DEMP_TEST_MODE=ON, instead of
theEMP_TEST_MODEenvironment variable andset_test_mode(). Setting the
variable made every default PRG seed and EC scalar of any build, Release
included, predictable. A normal build now compiles the deterministic paths
out, and test-mode and normal objects cannot be linked into one program.
Wire-trace tests need a test-mode build of emp-tool and of the code under
test. - Half-gate garbling: both parties seed
MITCCRHwith one public start point
S, chosen independently of the garbler'sΔ, and keep the gid schedule in
step;half_gate.hstates this.v1.0.0-alpha.1'stest_halfgateand
bench_halfgateseededMITCCRHwithΔ, so code copied from them must
switch to a separate publicS.
Added
tcp::SocketOptions(runtime/io/tcp_socket.h): send and receive buffer sizes
forNetIO::listen/NetIO::connect(new overloads) and
TLSConfig::socket_options, applied beforelisten()/connect()so TCP
window scaling covers them; accepted sockets inherit them andmake_sibling()
passes them on.SocketOptions::for_bandwidth_and_rtt(bandwidth, rtt)sizes both
directions for a path: zero, the operating system's own sizing, up to a 4 MiB
bandwidth-delay product, and the first power of two above it beyond that. A size
above the system's limit (net.core.rmem_max/wmem_maxon Linux, 212,992 bytes
unless raised;kern.ipc.maxsockbufon macOS, 8 MiB) is lowered to the limit when
that is above 4 MiB and otherwise not made, keeping the operating system's own
sizing; one warning per process gives thesysctlcommand that allows it.vector_inn_prdt_sum_red_x4(res, a, b, n)(crypto/f2k.h): four
independent GF(2¹²⁸) inner products in one call, with the operands laid
out term-major (a[4l + j]is termlof sumj). Each SIMD lane
carries one sum, so the 512- and 256-bit VPCLMULQDQ tiers fold nothing
across lanes, and each sum is reduced once at the end, bit-identical to
vector_inn_prdt_sum_redon the de-interleaved operands.ScheduledProgram(ir/schedule.h) owns a denseBooleanProgramand its
AND-depth schedule, validated and scheduled once in the constructor.
scheduled_execute_programandsimd_execute_programtake it in place of a
program plus a separately built plan.RebindableWireBundle<V, Ctx>andwire_bundle_rebind_t<V, Ctx>
(ir/wire_value.h): the cross-context half of theWireBundlecontract
(V::rebind<Ctx>is aWireBundleoverCtxat the same width), required of
every argument and return family byfrontend::run(ctx, circuit, …),
frontend::composeandChunkedSession::run(circuit, …).validate_compose_structureandvalidate_compose(ir/context/compose.h):
plan-level and full validation of aComposePlan.ComposeCtx::finishruns
the first on the plan it returns;flatten_composeruns the second.digest_gate_stream(program)(ir/context/digest.h), the stored-program
counterpart of aDigestCtxtrace.ProgramWorkspace::release_wire_values()(ir/execute.h) clears the
workspace's wire vectors and keeps their capacity, for a thread-local
workspace that holds context-bound wires.FlushPlan::error(ir/session/flush_plan.h) names the reasonplan_flush
rejected a recorded stream.DynamicUInt_T<Ctx>andDynamicInt_T<Ctx>(circuits/unsigned_int.h,
circuits/signed_int.h) hold integers whose width (>= 1) is chosen at
construction. They have the fixed types' arithmetic, comparisons, bitwise
operators,selectand public-amount shifts, plusresize(width),
to_fixed<M>()andas_signed()/as_unsigned(), andDynamicUInt_Thas
hamming_weight(). They are theRuntimeWidthValues that aRuntimeSessionIO
session inputs and reveals.uint8_t(byte-bool) overloads ofbools_to_bits/bits_to_bools,
PRG::random_bool,IOChannel::send_bool/recv_bool,
vector_inn_prdt_sum_red(runtime and<N>forms) and
GaloisFieldPacking::packing, so byte-bool buffers need no cast tobool*.
An input byte is false when zero and true otherwise; outputs are 0 or 1. The
boolanduint8_tpaths give the same bits, wire bytes and PRG state.- Two hooks for sessions derived from
ChunkedSession: a
static constexpr bool kCountsAndsInternallymember makes the base skip its
own AND count, andmaterialize_deferred_inputs_()is called at everyrun,
run_artifactand flush boundary, so a derived session can settle deferred
inputs there.
Changed
IOChannel::sync()is one non-virtual implementation in the base, used by every
channel: each side sends one zero byte, flushes, and waits for the peer's, so
neither side has to go first and no channel can turn it into a no-op. Two
channels adopted from existing sockets (bothis_server == false) used to
deadlock in it, each waiting to receive first. It still stays out of the byte
counters and the Fiat-Shamir transcript and sends the same bytes as before, so
old and new peers still pair up, and it now reports a nonzero byte as the two
sides being out of step. NetIO, TLSIO and TraceIO no longer override it; a
custom channel that overrodesync()must drop the override, and dependents must
be rebuilt, sinceIOChannel's virtual table changed.NetIO::flush()stops the process when the stdiofflushfails instead of
ignoring it.TraceIOrejects a null channel, creates its trace files with mode0600,
flushes them before the wrapped channel, reports trace write and flush failures,
and records the bytes ofsync().- Test mode stops the process in more of the cases where deterministic streams
would repeat. Deriving a child lane on lane 0, asThreadPool::enqueuedoes,
now claims lane 0 just as drawing a seed does, so a second unscoped thread
that enqueues pool work must run under its owntest_lane_scope. Lane 0's
owner is a per-thread token rather than a hash ofstd::thread::id, so a
thread started after the owner exits can no longer reuse its id and replay
its seeds.test_lane_scope(0)stops the process; on lane 0's owner it
restarted lane 0's ordinals and repeated the seeds already drawn. parse_partyandpeer_portstop the process unless the value is plain
decimal digits within range (EMP_PORTmust be in [1, 65535]). They used
atoi, which read2xor+2as 2 and passed anyEMP_PORT, such as0or
70000, through unchecked.clock_start/time_fromusestd::chrono::steady_clock, which does not
jump when the system clock is set. On libstdc++, where
high_resolution_clockissystem_clock, their type changes: code that
storesclock_start()in atime_point<high_resolution_clock>must use
autoorsteady_clock::time_point.ThreadPool(0)stops the process; such a pool accepted tasks that never ran,
so their futures never became ready. A worker thread that fails to start no
longer ends instd::terminate.ThreadPool::enqueuestores its arguments withoutstd::bind. They are
passed as lvalues, as before, or as rvalues when the callable cannot take
lvalues, so a function taking a move-only argument by value can be enqueued;
the future's type is the result of that call, which can differ from
invoke_result_t<F, Args...>for a callable overloaded on value category.
std::bind's special cases are gone: astd::reference_wrapperargument is
no longer unwrapped, so a generic parameter sees the wrapper (aT&
parameter still binds through its conversion), and a nested bind expression
is passed as is instead of being called.bool_to_int<bool>no longer compiles; it wrote eight packed bits into a
bool, which may only hold 0 or 1.- Negative sizes stop the process where they used to be silent no-ops or zero
results: the runtimeParaEnc/AES_ecb_encrypt_blksforms (also when
K * Noverflowsint64_t),CCRH::Hn, and the F2K helpers
vector_inn_prdt_sum_no_red,vector_inn_prdt_sum_red(block,booland
uint8_tselectors),vector_inn_prdt_sum_red_x4andvector_self_xor.
Their compile-time forms,AES_opt_key_schedule<N>andaes_ctr_fill_dm<W>
reject a negative size with astatic_assert,uni_hash_coeff_gen<N>
requiresN > 0, andMITCCRHrequiresBatchSize,KandHto be
positive. Zero sizes stay no-ops. - The AES-CTR counter (
aes_ctr_fill_dm,detail::ParaCtrEnc,
detail::AesLane<N>::ctr_xor_tweak) isuint64_tinstead ofint64_t, so
counter arithmetic is defined across block 2^63; existing call sites convert
implicitly. ECGroup::rand_scalar()samples[1, order)instead of[0, order),
throughBN_priv_rand_range.ECGroup::hash_to_pointrequires a DST of 1 to 255 bytes (an empty one was
accepted), andRO(domain, sid)requires the same ofdomain.- On a
const Scalar,n()returnsconst BIGNUM*; a non-const overload
returnsBIGNUM*. Code that passes a constScalar's handle to an OpenSSL
call takingBIGNUM*no longer compiles. SessionID::derive()is[[nodiscard]].MITCCRH::start_pointstarts aszero_blockinstead of indeterminate. It is
a placeholder:setS()must still install the parties' shared random seed.WireBundlerequires a positive staticwidth().BitVec_T<Ctx, 0>and
other zero-width values are no longer frontend arguments, return values or
session I/O values; they can still be built inside circuit code.- An explicit-context circuit body takes the context as a mutable lvalue
reference (Ctx&orauto&). A generic by-value or forwarding-reference
(auto&&) first parameter, and a body that returns a value over a different
context type than its arguments, are compile-time errors. - Live
frontend::run(body, args…)passes decayed, owned argument values, as
compiledoes, so a body overloaded on lvalue versus rvalue arguments
describes one circuit.compile, bothrunforms andcomposestop the
process when an argument or the result belongs to another context instance,
in every build (therunargument check used to exist only under
EMP_CONTEXT_CHECKS), andrunstops on a default-constructed first
argument. frontend::run(ctx, circuit, args…)and
ChunkedSession::run(const frontend::Circuit<…>&, args…)are constrained by
RebindableWireBundleand spelled withwire_bundle_rebind_t. A session that
derives fromChunkedSessionand redeclares thatrunmust give it the same
constraint and spelling, or calls to it become ambiguous.validate_programrejects an unknownwire_reusevalue. Under
WireReuse::Linearan And output takes a slot no gate has written and no
later gate writes (Fullallows both); underWireReuse::Nonegateimust
write wirenum_inputs + i. A dense program with out-of-order outputs, or a
Linear one that places an And output in a recycled slot, used to load and is
rejected now,.empbcfiles included.- Scheduled and SIMD replay take a
ScheduledProgram. The one-shot
scheduled_execute_program(ctx, program, inputs)remains and validates its
program on every call, andsimd_execute_programstops on a negative
instance count. Code that cached aScheduledPlanconstructs a
ScheduledProgramfrom the program instead. - IR diagnostics separate a streamed gate trace (
DigestCtx::value(),
digest_gate_stream) from the versioned full-program fingerprint
(digest_program).DigestCtxseals its input prefix once, at the first gate
or atvalue(), and stops onexternal_inputafter a gate; code that read
DigestCtx::digestcallsvalue().digest_programmixes a domain tag, a
format version,wire_reuse,num_wires, the gate count and the ordered
outputs, so its value changes for every program (thestored_program_digest
anddense_program_digestfields ofempbc-tool inspect --jsonchange; the
checked-in manifests carry neither). Code that compared aDigestCtxtrace or
digest_sourcewithdigest_programcompares withdigest_gate_stream. session::plan_flushrejects a malformed recorded stream instead of
compacting it with zero operands: recorder id 0, the null sentinel, as a gate
operand, output or keep id; a Not or constant gate with non-canonical
operands; an unknown op; two gates producing one id; a chunk-local operand
read before its producer; a stale keep id; and counts that do not fit
uint32_t.okis false anderrornames the reason, which
ChunkedSessionincludes in its stop. Debug builds validate the compacted
program.ChunkedSession::revealtreats only an empty decode as "not a recipient" and
stops on a nonempty decode of the wrong width.run_artifactvalidates the
raw program in Debug builds and trusts it in Release.builtin_circuitaccepts onlyaes128,sha256_256andsha3_256_256, and
float_circuitonly widths 16, 32 and 64 with the shipped operations; both
check the loaded program's input and output counts before caching it.load_empbcrejects a null buffer with a nonzero length and a nonzero
reserved gate byte, andsave_empbcstops when the output or gate count does
not fit the 32-bit header field.validate_artifactrejects a zero argument or return width, and
CircuitSignature::total_input_bitsstops when the sum exceedsUINT32_MAX.ComposeCtx::finishvalidates the plan's wiring;flatten_composevalidates
the plan and every distinct unit and bounds the flattened wire count before
indexing;ComposeCtx::call_unitstops on a null input array and on index or
wire-id overflow. A glue event is taggedinstance == -1exactly.~ChunkRecorderCtxstops the process when a recorder wire is still pinned, in
every build; the check used to run only underEMP_CONTEXT_CHECKS.ClearSession::inputandrevealstop on a value from another session's
context, on a runtime-width codec whoseencodereturns the wrong number of
bits or whosefrom_wiresreturns the wrong context or width, and on
revealing a runtime-width value of width 0.Float_T's IR-replay helpers (replay_,unary_,binop_,ternary_,
cmp_,classify_) are private.make_compactrecycles a slot as soon as its value has no reader and is
neither a program output nor a Linear And output, and lets a program output
take a recycled slot; only Linear And outputs insist on a never-written slot.
A consumer that maps an output slot to its producer takes the slot's last
writer. Linear and Full programs it produces can have fewer wires than
before, and theirdigest_programvalues change.execute_program(ctx, program, inputs)moves the output vector out of its
workspace instead of copying it.UInt_T<Ctx, N>andInt_T<Ctx, N>requireN > 0; their runtime-width forms
are the separate typesDynamicUInt_T<Ctx>andDynamicInt_T<Ctx>. Replace
UInt_T<Ctx, 0>withDynamicUInt_T<Ctx>andInt_T<Ctx, 0>with
DynamicInt_T<Ctx>, whether the width is spelled0orruntime_width, and
read their wires throughdata(), since the wire vector is private. A dynamic
value stops the process when it is used unbound (default-constructed or
moved-from) or indexed out of range, and itsdecode, so a sessionreveal,
stops when the value does not fituint64_t/int64_tinstead of returning
its low 64 bits. A zero-widthslice/extract/truncand
BitVec_T<Ctx, 0>::as_uint()no longer compile; they used to produce a
zero-width runtime value.popcount<R>()requiresR >= bits_for(N), the width that holds0..N; a
narrowerRused to return the count modulo2^R.- Integer circuits emit fewer gates; every result is unchanged, including
division by zero andINT_MIN / -1.==/!=takeN - 1AND gates
instead ofN, as a balanced tree of AND depthceil(log2 N)instead of a
chain of depthN - 1./and%divide non-restoringly over a growing
window, so no step needs a restoring multiplexer: an unsigned quotient takes
N(N+1)/2 + 2N - 3ANDs instead ofN² + 3N - 1(589 instead of 1,119 at 32
bits) and a remainder2N - 1more; signed/and%take the magnitudes
and re-sign them with conditional negations ofN - 1ANDs (682 and 745
instead of 1,308 at 32 bits).hamming_weight/popcounttake
N - popcount(N)ANDs, the multiplicative complexity of the Hamming weight
(31 instead of 155 at 32 bits), andleading_zerostakesN - 1(31 instead
of 186).*takesN² - N + 1below 24 bits and is a Karatsuba short product
from 24 bits (931 instead of 993 at 32 bits, 3,347 instead of 4,033 at 64),
at a higher AND depth from 48 bits (73 instead of 63 at 64). Unary-on
Int_TtakesN - 2, signed<takesN, and the secret-amount shifts fold
the out-of-range test into their last stage (203 instead of 219 at 32 bits,
198 forInt_T >>, at AND depth 7 instead of 28). Compiled programs, gate
counts anddigest_programvalues change, and so do pinned transcripts of
circuits that use these operators. compare_swap,sortandsort_by_keyexchange two values with one AND per
bit,d = s & (a ^ b),a ^= d,b ^= d, instead of twoselects that each
computed that AND. A compare-swap of 32-bit integers takes 64 AND gates instead
of 96, and one carrying a 32-bit payload 96 instead of 160. Values without
pack_wires/from_wires(or the runtime-width integers'^) still use two
selects. Results are unchanged; gate counts and pinned transcripts change.batcher_network(and sosort/sort_by_key) sorts the two halves of any
length, larger first, and joins them with Batcher's merge for unequal runs,
instead of cutting the next power-of-two network down to the length. At 2^k
and 2^k - 1 inputs the network is the same; at the other lengths checked
(every length up to 8192) it has no more compare-swaps and no more layers,
and up to 17% fewer compare-swaps just above a power of two (85 to 74 at 17
inputs, 679 to 565 at 65). Integersortresults are unchanged. At the
lengths whose network changed,sort_by_keymay leave the payloads of equal
keys in a different order, andFloat_Tsorts may place NaNs and zeros of
opposite sign differently.- Sorts of 9 to 16 values, and the 9- to 16-value blocks that larger sorts
merge, use the smallest known sorting networks (25, 29, 35, 39, 45, 51, 56
and 60 compare-swaps; Knuth, TAOCP vol. 3, §5.3.4) instead of Batcher's (26,
31, 37, 41, 48, 53, 59 and 63). Sorting 16, 64 or 1024 values takes 60, 531 or
23871 compare-swaps instead of 63, 543 or 24063, with no more layers. As
above, integersortresults are unchanged, whilesort_by_keymay order the
payloads of equal keys differently andFloat_Tsorts may place NaNs and
signed zeros differently. compare_swap(a, b)andsortoverUInt_T,Int_Tand their runtime-width
forms decide the exchange with a comparison that may answer either way when
the two values are equal, where exchanging changes nothing: the borrow chain
starts at bit 1, with one operand's bit 0 as the incoming borrow. A
compare-swap of w-bit values takes 2w - 1 AND gates in w AND layers (before:
2w in w + 1 layers unsigned; 2w + 1 in w + 2 layers signed, which now
complements both sign bits instead of ending in a mux). Results are
unchanged.sort_by_keykeeps the exact comparison, so equal keys still never
exchange their payloads in a compare-swap.- The shipped floating-point circuits are rebuilt for fewer AND gates and
compute the same results, NaN payloads and signed zeros included. At fp32
(fp16 / fp64 in the same proportions):add/sub1,143 -> 550,mul
2,286 -> 1,463,square1,876 -> 744,fma3,429 -> 2,013,div7,845 ->
1,355,recip5,863 -> 845,sqrt5,699 -> 570,rsqrt11,179 -> 1,202,
eq/ne111 -> 61,lt/le/gt/ge112 -> 92,min200 -> 125
andmax176 -> 125 ANDs;isinf/iszeroandfp32_isnankeep their AND
counts at one less AND depth. The circuits minimize AND gates, not depth: the
division family is deeper than before (fp64divhas AND depth 3,013 instead
of 389).docs/floating_point_circuits.mdlists every count and how each
circuit was verified. Compiled programs,digest_programvalues and pinned
transcripts of circuits that use these operators change. - In-circuit AES-128 uses a 28-AND S-box (straight-line program
aes-sbox-a28-ad4-g131-gd32-xx103-47of the NIST Circuit Complexity
repository) instead of Boyar-Peralta's 32-AND one: AES-128 with its key
schedule takes 5,600 ANDs instead of 6,400, at AND depth 40 instead of 60.
SHA-256 computes majority with one AND per bit, folds public bits (the IV,
padding and round constants) into its additions and compresses multi-operand
sums: a compression takes 22,271 ANDs instead of 24,744, and the
sha256_256asset 20,954. SHA3-256 evaluates chi in the last round only on
the lanes the digest reads: 37,056 ANDs instead of 38,400. Results are
unchanged; theaes128,sha256_256andsha3_256_256assets, their
digests and pinned transcripts change. Int_T's secret-amount shifts check, underEMP_CONTEXT_CHECKS, that the
shift amount belongs to the value's context, as the other binary integer
operators do.ThreadPoolisemp::ThreadPool, so it cannot collide with another copy of
the upstream file. Code outsidenamespace empthat names it unqualified,
withoutusing namespace emp, must qualify it.NetIOandTLSIOkeep their socket,FILE*/SSLhandles, buffers and
init_from_sockprivate.fd()returns the connected socket and
NetIO::listener_fd()a server channel's listening socket.IOChannel's
send_data_internal/recv_data_internalare protected: channels still
override them, and callers usesend_data/recv_data, so every byte
passes the counters and the Fiat-Shamir transcript.MITCCRHkeeps its schedule state private.start_point()returns theS
installed bysetS, andnext_gid()the gid the next hash's first lane
takes;setSandrenew_ks(gid)are the only ways to change the state.- Length and count parameters that were
size_t,uint64_toruint32_tare
int64_t, asdocs/api_conventions.mdrequires, and a negative value stops
the process instead of wrapping to a huge count:Scalar::to_bin_padded/
from_bin,Point::to_bin/from_bin,ECGroup::hash_to_point,
ECGroup::resize_scratch,RO::absorb(const void*, n),to_hex,
load_empbc(bytes, len),sse_trans,sse_trans_n128, the counts of
circuit::execute_program,external_inputonRecordCtx/ComposeCtx/
DigestCtx,ComposeCtx::call_unit,ChunkRecorderCtx::reserve_ids,
digest_source,batcher_network, the pointer forms ofsort/
sort_by_key, and the count ofBulkBooleanContext::and_many. Callers
passingsize_tstill compile, and a backend whoseand_manytakes
size_tstill satisfies the concept. Circuit widths stayint. ChunkedSession::revealtakes only the value and the recipient. Its trailing
keep...values could not change the flush, since every value still in scope
is kept anyway; they were only checked to belong to the session. To drop
values that are still in scope, callcheckpoint(keep...)first.ChunkedSession::InputBatchis move-only: its copy constructor, copy
assignment and move assignment are deleted, wherev1.0.0-alpha.1had
implicit copies. Keep the batch thatinput_batch()returns, or move it into
a new variable; do not copy or reassign one.
Removed
TLSIO::is_server, which only chose who went first in the oldsync().set_test_mode()and theEMP_TEST_MODEenvironment variable; test mode is
a build option (see Security).MITCCRH::renew_ks()without an argument, which renewed from the stored gid;
renew_ks(gid)remains.MITCCRH::renew_ks(const block*)andMITCCRH::hash_cir_fixed, the
explicit-tweak mode in which the caller scheduled the keys and owned
tweak uniqueness. Every hash now goes through the gid stream, which the
class keeps distinct per(S, gid); a second tweak dimension is XORed
into the low qword of a randomSor laid out as gid gaps with
renew_ks(gid). A protocol that scheduled its own keys and bucketed on
explicit tweaks shared one key across gates with nothing in the cipher
input to tell them apart, the same leak one layer up; it must re-derive
its tweak layout on the gid stream, on both ends, not rename calls.macro_xstr/macro_str, whichutils.hdefined for every file that
includes it, although emp-tool does not use them.ScheduledPlanandmake_scheduled_planfrom the public namespace (they are
emp::detail), thescheduled_execute_program/simd_execute_program
overloads that took aBooleanProgramplus a plan, and the
simd_execute_programforms over a bareBooleanProgram.layout_pass'sLivenessStatsparameter;layout_pass(program)computes its
own liveness.DigestCtx's public data members (digest,next_id,c0,c1).UInt_T::mod_exp. It reduced eachN-bit product modulo2^Nbefore reducing
it moduloq, so its result was wrong whenever a product reached2^N.runtime_width, and theis_dynamicmember ofUInt_T/Int_T
(RuntimeWidthValuerequires it, astrue, of a runtime-width type).audit-report/: it reviewed an earlier tree, and its guidance no longer
applied. The README no longer cites it.
Fixed
bench_halfgatemeasured nothing: with the hashes inlined intomain
and their results unused, the compiler removed them, so the loop timed
the PRG and key schedules, and the printed rate divided 128M gates by a
2M-gate loop. The outputs are now folded into a printed sink and the
count matches the loop.joinNcleanCheatstopped callingget()once a task returnedtrue, so it
could return while later tasks were still running. It now waits for every
future.error()flushesstderrbefore exiting, so a diagnostic written to a
bufferedstderris no longer lost.- A translation unit that included
runtime/core/simd_tier.hbefore
runtime/core/block.hcompiledsse_transwithout its AVX2 / AVX-512 / GFNI
kernels. Linked with translation units that included them in the usual order,
the program had two definitions of the same inline functions, and the linker
could pick the slower one for every call that was not inlined. PRG::reseed()kept the words buffered foroperator(), so a PRG used as a
UniformRandomBitGeneratorreturned up to 31 words of the old stream after a
reseed.ECGroup::hash_to_pointcould leaveBN_R_NOT_A_SQUAREin OpenSSL's
thread-local error queue, where a later OpenSSL call would see it. The queue
is now restored to what the caller had, and aBN_mod_sqrtfailure for any
other reason stops the process.- On VAES builds (x86 with AVX2 or AVX-512),
MITCCRH::hashandhash_cir
read each tile of their input with one 32- or 64-byte load. When the caller
had just written those blocks one at a time, as half-gate garbling and
evaluation do, the load could not be forwarded from the 16-byte stores and
waited for them to reach the cache, so consecutive calls ran one after
another. The input is now read 16 bytes per block. Output is unchanged, and
builds with 1-block AES lanes (AES-NI only, ARM) compile the same code as
before. Float_Treplay kept the last replay's wires in its thread-local
ProgramWorkspace. Over a context with refcounted wires they stayed pinned
after their recorder was destroyed, and a later recorder could inherit them as
stale ids. The helpers move the outputs out and release the workspace's wires.layout_passmarked input wire 0 reachable whenever a constant gate was
reachable (through its normalized operand), overstatingreachable_wiresin
empbc-tool inspect, andanalyze_programcounted a gate that reads the same
wire twice as two consumers inmax_fanout.save_empbc_filereports a failedfclose; a write that failed at close used
to report success.Float_Taddition, subtraction andfmareturned-0for an exact zero
such asx - x, where round-to-nearest-even gives+0, so1 / (x - x)was
-inf. The shippedfp{16,32,64}_{add,sub,fma}circuits now break a
magnitude tie toward the positive operand. Their AND counts and AND depth are
unchanged, but programs that use them get newdigest_programvalues and
transcripts.execute_program(ctx, program, inputs, ws)resizedws.outbefore reading
inputs, so passing the outputs of an earlier call on the same workspace
read freed or destroyed elements. It now reads the inputs first.session::plan_flushaccepted a recorded gate that reads its own output in
Release builds, giving a program that reads a wire before writing it, and
stopped the process in Debug builds instead of returningok = false. It now
rejects the gate with "gate reads its own output".~TLSIOwaited for the peer'sclose_notify, so it blocked until the peer
destroyed its end of the channel, and two parties that destroyed their
channels in different orders, as NetIO allows, deadlocked. It now sends
close_notifyand closes without waiting. A TLSIO server also sends no
session tickets, which TLSIO never uses, so a send-only peer has no unread
bytes that would turn its close into a connection reset.- The link-time guards that reject objects built with a different default
Hashbackend, or with and without BLAKE3, were discarded by linker section
garbage collection (-ffunction-sections -fdata-sections -Wl,--gc-sections),
and such objects then linked into one program, whereHashandIOChannel
objects crossing between them had mismatched layouts. Each guard, like the
new test-mode guard, is now an empty function that runs at program start and
references its marker. Linkers keep startup functions, so the check holds
with any compiler and linker. Every translation unit that includeshash.h
ortest_mode.hgets one such function per guard, which Clang's
-Wglobal-constructorsreports. load_empbc/load_empbc_filetake amax_wireslimit, default
empbc_default_max_wires(2^30), and reject a header that declares more wires
before anything is allocated. Input wires take no bytes in a.empbcfile, so
a 24-byte file could declare 2^32 − 1 of them, and the IR passes, which size
their arrays by the wire count, then requested tens of GiB. Pass a larger
limit to load a bigger program, or a smaller one for files from an untrusted
source.bench_f2kcounts bytes per row: 32 for two-operand products, 17 for
byte-bool selectors, 16 for generators.- The two-party test harness
./runusesEMP_PORTwhen set and 12345
otherwise, andctestgives each two-party test its own ports from 20000 up.
It used to pick a random port in 20000-49999, which overlaps the range Linux
assigns to outgoing connections (32768-60999): a test's port could already be
held by an outgoing connection (bind: Address already in use), and a
reconnecting client could be handed the listener's port and connect to
itself.