957 Commits

Author SHA1 Message Date
sinu.eth
5bac60fbd1 ZK Factory (#194) 2023-02-15 09:37:30 -08:00
sinu.eth
7ba5d8775f ZK refactor + Defer (#193)
* refactor ZK

* deferred zk

* add summaries

* feedback
2023-02-15 09:30:51 -08:00
th4s
aa43ed428e Generic share conversion (#184)
* WIP: Making fields generic

* WIP: Introduced field trait

- added P256
- added Gf2_128

* Readded inverse test

* WIP: Refactoring share-conversion-core

- removed old gf2_128 module
- started adding share-conversion generic over fields

* WIP: Made a2m generic over field

* Refactored share-conversion-core to be generic

- Tests still need to be refactored

* Tests are now generic

* Improved operation implementations for field

- fixed some bugs

* Fixed endianess in Gf2_128

- test against ghash working again

* Bugfixes for Gf2_128

* Get rid of shift operators and xor

* Added test for bit operations

* Removed unused from impls

* Fixed bug for P256

- apply montgomery reduction before extracting bits

* WIP: Refactoring share-conversion-aio to be generic

* Added byte conversion for fields

- also repaired trait bounds

* WIP: Implemented OT for arbitrary message lengths

* Added conversion functions to blocks for fields

* Implemented ObliviousTransfer for long messages for sender

* Implemented ObliviousReceive for longer messages

- repaired tests in share-conversion-aio

* Repaired tests

* WIP: Adapting trait bounds

* Adapted share-conversion actor

* Adapted ghash implementation to new generic fields

* Final touches

- added comments
- improved tests

* Added feedback

* Tidy up from rebase

* added feedback part 1

* Adapted share-conversion-core and added feedback

* Added feedback part 2

* Improve conversion to use less vec allocations

* Added more feedback and some small improvements

* Rename OTEncoding -> BlockEncoding

* Repaired actor-share-conversion

* Adapt Gf2_128 to use an LSB0 encoding internally

* Adapt comment

* Improve bit encoding test
2023-02-10 18:18:59 +00:00
sinu.eth
eb1cd50e0e Unify Dualex API (#191) 2023-02-10 09:37:20 -08:00
th4s
aec6e9c84c Added OT for arbitrary message length (#187)
* Added OT for arbitrary message length

* Adapted actor-ot to new OT traits

* Update #187 to use const generic (#188)

* update to use const generic

* parallel encryption for multi-block OT

---------

Co-authored-by: sinu.eth <65924192+sinui0@users.noreply.github.com>
2023-02-09 09:14:27 +00:00
sinu.eth
689bbbbb90 Add Traits for ZK GC (#189)
* zk traits

* comments
2023-02-08 13:17:05 -08:00
sinu.eth
bee1ff5a48 DualEx Factory (#179)
* dual ex factories

* expose mocks

* remove state generic from mock type

* remove state from mock type deap

* implement clone

* fix typo
2023-02-02 09:00:35 -08:00
valpaq
70711ad6f6 Circuit builder tests (#164)
* tests

* added some tests and fixed errors

* some more tests

* fmt

---------

Co-authored-by: Valpaq <viktor.paramonov2000@gmail.com>
2023-02-02 08:53:43 -08:00
sinu.eth
480566af6f free xor labels (#182) 2023-01-31 10:55:33 -08:00
sinu.eth
4aaa326ac2 DualEx Traits (#178)
* split up dualex modules

* dual ex traits

* deap traits

* remove sized trait bounds

* add static bounds

* add boxed methods to trait

* DESummary

* rebase fix
2023-01-31 10:14:58 -08:00
sinu.eth
f4b80fdcc9 DualEx use OT Factory (#177)
* refactor dualex to use ot factory

* remove unnecessary clone
2023-01-30 10:15:31 -08:00
sinu.eth
a92342cd8b Garbled Circuit ZKP (#172)
* zk

* misc comments

* feedback updates

* comment on circuit opening

* typo

---------

Co-authored-by: themighty1 <you@example.com>
2023-01-30 10:14:12 -08:00
Dan
9f96b3b5e3 Merge pull request #176 from tlsnotary/ot_wrong_ciphertext_count
Ot wrong ciphertext count
2023-01-30 17:45:12 +00:00
sinu
0a3877d096 bump curve25519-dalek, fix compatability issues 2023-01-29 14:00:45 -08:00
sinu
f9c970c701 delete deprecated module 2023-01-28 21:37:01 -08:00
sinu.eth
14d6098e7c DualEx option to skip equality check (#175)
* dual ex skip equality check

* comment
2023-01-27 09:55:40 -08:00
themighty1
dc06319efc sender ciphertext count must match choice bit count 2023-01-27 13:35:59 +02:00
sinu.eth
cd9faec569 Refactor 2PC GHASH (#171)
* refactor ghash

* update comment
2023-01-26 09:31:18 -08:00
sinu.eth
7f5e2bb7a0 Refactor encoder (#167)
* refactor encoder

* update comment
2023-01-24 11:02:45 -08:00
sinu.eth
6531830554 Refactor label types (#168)
* refactor label types

* update comment
2023-01-24 10:52:56 -08:00
sinu.eth
afac611ebb Groupless labels (#166)
* remove wire id from wire label types

* rename labels

* make label state public

* alias label state and expose methods for working with them

* into_labels
2023-01-23 09:44:48 -08:00
sinu
d8ca7010c6 ignore .vscode 2023-01-20 12:44:19 -08:00
sinu.eth
6e9122c348 DEAP (#163)
* DEAP

* feedback
2023-01-20 12:43:02 -08:00
sinu.eth
b637e3e09b Update DualEx (#162)
* update dualex

* comments and tweaks

* misc comments

* reverted comment

* comments

* update naming + comments

Co-authored-by: themighty1 <you@example.com>
2023-01-18 11:33:38 -08:00
th4s
0edecdceb3 Adapt .gitignore to exclude neovim settings 2023-01-18 12:43:13 +01:00
sinu.eth
cb62745b48 Update mock ot factory (#159) 2023-01-17 13:45:40 -08:00
th4s
85241923f3 Ghash aio (#157)
* Add mocking to share-conversion-aio and adapt to new project structure

* Added aio ghash module

- temporarily commented other modules than ghash
- adapted dependencies

* Add error variant which can be used by actors

* Added feedback 1/2

* Added feedback 2/2

* Remove pub from converters

* comments

Co-authored-by: themighty1 <you@example.com>
2023-01-17 08:50:20 +00:00
sinu.eth
6839586ceb Label Sets (#156)
* decouple input labels from gc

* label sets

* fix mpc-aio

* getter

* set iter

* disable dualex
2023-01-16 09:23:41 -08:00
sinu.eth
e341fde8c3 Mock mux channel factory (#160) 2023-01-15 23:17:13 -08:00
sinu.eth
ee45cb4bd9 Unique Group Ids (#153)
* group id feature

* compile circuits

* update mpc-core

* update tls circuits

* update mpc-aio

* prevent duplicate group ids

* rebase fixes
2023-01-12 12:13:34 -08:00
sinu
e76a65ebb4 Partition Workspaces 2023-01-12 12:00:05 -08:00
th4s
d7ff993919 Actor share conversion (#136)
* WIP: Adding actor sender for share conversion...

* WIP: Added actor for share-conversion sender

* Added actor for recevier

* Added state enum to allow verify functionality

* Added tests

* Adapted trait bounds to rebase of async-factory PR

* Added part of feedback

* Added more tests

* Completed feedback

* Simplify code with let-else

* code comments + test

* Introduce additional `Error` state for share-conversion sender/receiver

* Added feedback

* misc comments

* Cherry-picked from 870e4a1 and merged

Added more let-else and changed error handling

* Add critical errors which stop actor when out-of-order messages arrive

* Made setup to be a message handled by handler and added it to the
corresponding control

Co-authored-by: themighty1 <you@example.com>
2023-01-12 17:01:05 +00:00
th4s
d3cef4d4bd Ghash core implementation (#149)
* WIP: Migrated ghash-core implementation...

* Adapted tests

* Fixed some typos

* Added state module with sealed trait

* Removed leftover `MAC` wording

* Replace some forgotten `MAC` wordings

* Complete sealed trait state pattern

* misc comments

* simplify

Co-authored-by: themighty1 <you@example.com>
2023-01-12 10:31:14 +00:00
valpaq
bdb2209e40 BLAKE3 (#154)
* sha256->blake3

switched from sha256 to blake3

* rustfmt

Co-authored-by: Valpaq <viktor.paramonov2000@gmail.com>
2023-01-11 22:00:44 -08:00
sinu
b374b7a9ba fix tests 2023-01-11 09:30:57 -08:00
sinu.eth
0287e2cd92 Label Encoder (#148)
* Label encoder

* fix word pos storage

* fix test

Co-authored-by: themighty1 <you@example.com>
2023-01-11 09:24:27 -08:00
sinu.eth
68258afce2 Circuit Cyclic Reference (#152)
* add cyclic reference to circuits, and tidy errors

* update dependents

* misc comments

Co-authored-by: themighty1 <you@example.com>
2023-01-11 09:23:39 -08:00
sinu.eth
25fd14ac37 Arc Labels + Iterators (#143)
* Refactor garble labels 2

* fix from_labels

* comment

* simplify logic

Co-authored-by: themighty1 <you@example.com>
2023-01-11 09:16:41 -08:00
sinu.eth
8cd2b6efda Refactor Wire Labels (#142)
* Refactor garble labels

* remove unnecessary error type

* comment fixes

* comments

Co-authored-by: themighty1 <you@example.com>
2023-01-09 10:20:59 -08:00
sinu.eth
ca8da94b8c Refactor Wire Groups (#141)
* introduce WireGroup trait and Arc

* update mpc-core

* more simplifications

* fixes

* move id into group

* consolidate value type

* from_bits

* fixed imports

* unit tests

* touch ups for clarity

* fmt fix

* rebuild circuit bins

* add a check + comments

Co-authored-by: themighty1 <you@example.com>
2023-01-09 09:04:24 -08:00
th4s
aaffbea1ed Fix rng seed for kos15 unit tests
Encountered a failed kos15 unit test, because of some very special rng seed.

The test which failed was `test_ot_splitting_mix_pairs`, which is
expected to panic because it uses a wrong pair of split senders and
receivers. I believe that it failed (did not panic, like expected)
because  the rng seed incidentally produced some blocks, where the first
half does not differ from the second half. This probably happened because
the number of blocks produced is a random number between (1..1024) and I
expect that the number chosen by the rng seed was very small, so that
there was a high probability that this could happen.

We agreed to seed unit tests with a fixed seed, so I took this
opportunity to just do that for the kos15 unit tests.
2023-01-06 15:50:33 +01:00
sinu.eth
8eb6ca75e9 Async Factory (#146)
* async factory

* move config and error to associated types

* rename factory method to create
2023-01-05 10:14:07 -08:00
sinu.eth
c8db9ba919 Refactor OT traits to be generics (#137)
* switch OT traits to generic instead of associated types

* blanket OT impls for wire labels

* rustfmt

* make ObliviousVerify generic

* OT verify

* update share-conversion-aio

* fixes for rebase

* rebase fixes

* fmt fix

* mock ot

Co-authored-by: sinu.eth <>
2023-01-04 12:14:47 -08:00
sinu.eth
416acec977 OT Actors (#119)
* fix ot split methods in mpc-aio

* OT factory actor impl

* merge fixes

* committed ot

* scope stream futs

* trigger CI

* pr feedback

* alias in test for readability

* misc comments

* error handling and comments

Co-authored-by: themighty1 <you@example.com>
2022-12-29 09:26:10 -08:00
sinu.eth
f11d00b3ac Encapsulate labels (#139)
Co-authored-by: sinu.eth <>
2022-12-28 12:04:14 -08:00
sinu.eth
aba2e194ef Pin tokio to 1.23 2022-12-26 18:10:27 -08:00
sinu.eth
b6c2913b03 GC Opening (#133)
* input label decoding

* unchecked and conversions

* persist delta in summary state

* tests passing

* rename to CircuitOpening

* export CircuitOpening

* update validator trait

* msg types

* fix comment

* properly persist input labels

* misc comments

* unit tests and add circuit id to model

* revert adding circuit id to opening

Co-authored-by: themighty1 <you@example.com>
2022-12-20 11:55:14 -08:00
th4s
f57e91b640 Maliciously secure M2A/A2M (#131)
* WIP: Refactoring a2m/m2a...

* WIP: Refactor homomorphic subcrate...

* Implemented aio homomorph sender

* Removed integration test for now and renamed things

* Implemented homomorph aio receiver

* Improved API

* Rename crate homomorph -> share_conversion

* Rename errors and traits

* Migrated changes from branch `ghash-refactor-again`

* Improvements to share-conversion

- Renamed share_conversion to share-conversion
- Got rid of PhantomData for aio layer

* Improved variable naming and some doc

* Added aio unit tests and various improvements

- documentation
- variable naming

* Added TODO comment for OT integration test

* Added part of feedback

* Separated share-conversion into {share-converison-core, share-conversion-aio}

* WIP: Added recorder and implemented on sender side

* Implemented recorder on receiver side

* WIP: Added first draft for traits

* Implemented SendTape for Sender

* Removed TapeAccept trait

- implemented shell of TapeVerify for receiver

* WIP: Adapted verify function...

* Added verify trait and implemented it for AddShare and MulShare

* WIP: Refactoring replay functionality...

* Reapply feedback

* WIP: Refactoring and simplifing implementation...

* Tidied up and simplified recorder implementation

* Added unit tests for recorder in share-conversion-aio

* Added some comments

* Added barrier for sender

* Added feedback

* Added feedback

* Added feedback

* misc comments

* Fixed imports

* Added feedback

Co-authored-by: themighty1 <you@example.com>
2022-12-20 10:12:47 +00:00
sinu.eth
ca382374c4 GC Unchecked types (#128)
* initial work on unchecked types

* circuit io id utilities

* tests passing

* fix wire id bug

* relocate from_unchecked methods

* replace asserts with error

* fixtures and unit tests
2022-12-19 13:52:13 -08:00
sinu.eth
e8eadc7960 CI Add rustfmt check + import grouping (#132)
* remove old docs action

* add rustfmt check to gh workflow

* rustfmt group imports
2022-12-16 10:20:27 -08:00