957 Commits

Author SHA1 Message Date
themighty1
f6991937ce fix test 2023-05-11 09:28:31 +03:00
sinu
38a0888890 move ValueId, ValueRef to mpc_core 2023-05-10 20:20:07 -07:00
sinu
078d27dc49 rustfmt fix 2023-05-10 09:19:00 -07:00
sinu.eth
af9c81d7cf OT Actor cleanup (#237)
* ot actor cleanup

* typo
2023-05-10 09:12:02 -07:00
themighty1
fde6c4543f use std Range 2023-05-10 08:24:07 +03:00
themighty1
2ab4e4aaf9 nest modules 2023-05-09 12:58:57 +03:00
themighty1
00a95f0326 formatting 2023-05-09 08:51:52 +03:00
themighty1
a38824fa4d tlsn-core prototype 2023-05-09 08:51:52 +03:00
sinu.eth
430cf8ccfb Refactor AEAD for new MPC API (#235)
* refactor aead

* fix mock

* lints and docs

* fix alloc

* remove optional from comment
2023-05-08 09:12:04 -07:00
sinu.eth
519983dd2c Refactor KE for new MPC API (#231)
* refactor ke

* fix share order

* comment
2023-05-08 09:12:04 -07:00
sinu.eth
58b0998182 Refactor prf (#230) 2023-05-08 09:12:04 -07:00
sinu.eth
9285cb5d32 SHA-256 finalization circuit (#227)
* add sha256 finalize

* clippy --fix

* lifetime elision

* more clippy fixes

* remove unnecessary Arc

* add byte conversion support

* fix sha fn to return [u8; 32]

* use test macro

* expose sha2 compress fn

* fix test

* add reference conversions

* ditch const generics for slice ref

* fix padding in sha2
2023-05-08 09:12:04 -07:00
sinu.eth
737fe10c5e Refactor Cipher crates for new MPC API (#226)
* refactor cipher crates

* add Send + Sync trait bounds
2023-05-08 09:12:04 -07:00
sinu.eth
5627197fec Private decoding feature (#225)
* private decode

* implement bitxor trace for BinaryRepr type

* tidy

* rebase fixes
2023-05-08 09:12:04 -07:00
sinu.eth
b11560ee5a implement free-xor for encoded values (#224) 2023-05-08 09:12:04 -07:00
sinu.eth
435e2d1d65 Redesign mpc-garble (#220)
* mpc-garble

* move semihonest test to integration, expose some more types

* value config doc

* reenable all mpc crates

* rename msg type

* simplify config a bit

* typo

* add bound to StaticValueType

* clean up setup_inputs

* appease clippy

* add more flexible methods to memory trait

* add getter for value type

* comments and tweaks

* rename append -> append_string

* fix registry corruption

* drain filter

* finalize bug

* use matches!

* use as_ref

* remove default

* make decode public

* lower visibility for evaluator fn

* eval doc fix

* update buffering to be per value id

* input buffer methods

* move memory impl into separate module

* encapsulate finalized state

* flatten logic in value config

* fixes in utils

* docs
2023-05-08 09:12:04 -07:00
sinu.eth
4a9add9eed test fn and deprecated dep macro (#221) 2023-05-08 09:12:04 -07:00
sinu.eth
e144baaad3 Refactor mpc-garble-core (#219)
* refactor mpc-garble-core

* rename into_inner to to_inner

* fixed encoder bug and added more docs

* add blanket impl for arrays

* add reference for fixed-key cipher garbling

* use domain separated hash for label commitments

* grammar
2023-05-08 09:12:04 -07:00
sinu.eth
9a27d36646 Refactor mpc-core (#218)
* refactor mpc-core

* renamed methods

* fix domain sep macro and add doctest
2023-05-08 09:12:04 -07:00
th4s
f4eeecd1b3 Adapt share-conversion to new OT interface (#216)
* WIP: Adapting share-conversion to new OT interface

* Adapted share-conversion crate in mpc to new ot traits

* Adapted actor-share-conversion sender to new ot interface

* Adapted share-conversion receiver to new OT interface
2023-05-08 09:12:04 -07:00
sinu.eth
1d7807628f remove Result from spawn method (#217) 2023-05-08 09:12:04 -07:00
th4s
a2cff0ee9f Remove ot factory (#215)
* Remove OT factory in `mpc-ot`

* Actor handles for OTSenderActor now implement OT traits

* Added that actor sender stores child OT

* WIP: Reworking receiver...

* Bugfixes for sender

* Added new handlers and messages for receiver

* Remove barrier

* Added verify functionality for receiver

* Changed error msg

* Adapted actor-sender to send back child-sender directly

* Adapt receiver-actor to send back receiver

* Added new traits and adapted old ones

* Added mock implementation

* WIP: Repairing tests...

* Repaired unit tests and some code hygiene

* Adapt traits and move mock

* Repair imports

* Added part of feedback

* Add more feedback

* Restructure mock module and add test for borrowed OT

* Added remaining feedback

* Adapt OT traits to use vec
2023-05-08 09:12:04 -07:00
th4s
c061adc96c Removed OT trait implementations for GC from ot crates 2023-05-08 09:12:04 -07:00
th4s
e79d9356fc Revert "Remove splitting from mpc-ot and mpc-ot-core (#214)"
This reverts commit f41cac5755.
2023-05-08 09:12:04 -07:00
th4s
e1470e777a Remove splitting from mpc-ot and mpc-ot-core (#214)
* Remove splitting from mpc-ot and mpc-ot-core

- remove unused state variables
- adapt verify function
- remove barrier
- remove factory implementation
- some OT traits related to garbling have been moved to
  mpc-garble

* Remove OT trait implementation for garbling
2023-05-08 09:12:04 -07:00
sinu.eth
6818c45701 mpc-circuits-v2 (#212)
* mpc-circuits-v2

* update .gitignore

* little things

* reverse order of generics in add_array_input
2023-05-08 09:12:04 -07:00
th4s
6627b1706b Migrate tls workspace (#234)
* Able to compile and run tests again

* Remove non-existent bench

* Remove prover library for now
2023-05-08 14:03:26 +02:00
th4s
25f5289c01 Async backend general (#206)
* Added rayon backend for OTSender

* Added new SpawnRayon trait

* Remove &self reference

* Typo

* Improved implementation and added a test

* Undo changes in mpc

* Backend is now a global static ZST

- OT setup now uses backend

* Replaced old RayonBackend for Garbling with new Backend

* Move tokio to dev-dependencies

* Added feedback

* Added correct feature flags to dev-dependency tokio in
actor-share-conversion

* WIP: Repairing rebase...
2023-03-24 11:28:55 +00:00
sinu.eth
6f5a2d79a2 Reorg MPC crates (#210)
* refactor mpc crates

* update dependents

* removed deleted mods

* rustfmt
2023-03-22 22:43:31 -07:00
sinu.eth
389aafe663 2PC HMAC-SHA256 PRF (#209)
* prf

* prf circuits

* tests passing

* removed unused deps and code

* remove dead test

* state checks

* more cleanup

* use mpc_circuits test_circ

* PR feedback

* remove deprecated crates

* rename stuff
2023-03-21 12:28:54 -07:00
sinu.eth
1498941999 2PC AES GCM (#204)
* aead

* minor tidying

* add _public suffix to methods

* rebase fixes

* move commitment from garble module to commit module

* add commit-reveal to tag protocol

* factor out fn for ghash prep
2023-03-21 12:23:00 -07:00
Dan
a20816a211 Merge pull request #196 from tlsnotary/simpler_a2m
simplified a2m
2023-03-20 09:52:24 +00:00
themighty1
15845a8c33 feedback 2023-03-20 11:50:02 +02:00
themighty1
12fc6ba59a add comments about DE labels and inputs 2023-03-14 10:09:39 +02:00
Dan
1f4e0c3ee7 Merge pull request #208 from tlsnotary/notarized-session
added notarized-session type
2023-03-14 07:53:51 +00:00
themighty1
158b682316 added feedback 2023-03-14 09:46:00 +02:00
themighty1
f272f52c04 split x randomly 2023-03-13 16:09:18 +02:00
themighty1
1646b38dd8 added notarized-session type 2023-03-13 12:08:17 +02:00
th4s
d9b027387f Key Exchange (#186)
* mock point addition

* add naive key exchange impl

* split ke and pa

* WIP: Implementing key exchange...

* WIP: Adding key-exchange leader implementation...

* Added pms-share computation for key-exchange leader

* Improved awaiting both futures for leader

* Added key-exchange follower

* Improving architecture of KeyExchange

* No need for follower

* Adapted comments and variable names

* WIP: Building circuit for DualExConfig

* Added circuit to key-exchange

* WIP: Working on circuit construction

* WIP: Constructing circuit

* Going back to being generic over DEExecute

* WIP: Working on compute_pms_labels

* WIP: Tinkering with gc api

* Finished compute_pms_labels

* Wrapped nbit_xor in a byte-value circuit

* Small improvements and bugfixes

* Added mock implementation for key exchange

* WIP: Adding tests...

* Fixed test and added `to_be_bytes` for field

* Fix bug in implementation

* WIP: Battling with circuit builder

* Fixed bugs and added one more test

* Add comments and improve code

* Improve message types

* Add part of feedback

* Added rest of feedback

* Improving naming and comments

* Remove double reference

* Added feedback part 2

* Add Builder for KeyExchangeConfig

* Improved input assignment from `Role`

* Added ZST `Leader` and `Follower` structs and `Role` trait

* Sealed role trait

* Added feedback and added encoder

* Add feedback

- improve comment for outputs

---------

Co-authored-by: sinu <65924192+sinui0@users.noreply.github.com>
2023-03-10 13:46:25 +00:00
sinu
b583effd74 update CI to use sparse crate index 2023-03-09 19:41:14 -08:00
sinu.eth
bfe3ccd02e 2PC Block Cipher (#201)
* block cipher

* update package name

* expose Role

* minor tidying
2023-03-09 19:31:28 -08:00
sinu.eth
8c05ee886e 2PC Stream Cipher (#199)
* stream cipher

* simplifications

* add comments to counter_block fns

* remove unnecesary phantom data

* rename flag in build_ctr_labels

* rename methods to have _public suffix

* allocate vector properly

* document record functionality

* document record in decrypt_private

* remove unnecessary summarize

* additive -> xor

* remove unnecessary closure

* remove unnecessary clone

* update tokio dep

* key stream -> keystream

* rename missed key_block -> keystream_block
2023-03-09 14:02:40 -08:00
sinu.eth
258db76c6b Moar bitvec utils (#207) 2023-03-09 09:41:48 -08:00
sinu.eth
e41d5d5164 BitOrder Support (#198)
* add msb0 functionality

* add bit order to circuit model

* preserve bit order of Bits value type

* add bit order to WireGroup

* update garble crates to handle bit order

* update encoder

* reverse circuits

* update dependents

* disable tls crates

* comment from_str

* comments
2023-03-08 09:16:29 -08:00
sinu.eth
6a33c661ce Boolvec Utils (#203)
* bit utilities

* replace old helpers

* panic warning and rename trait methods

* update mpc-circuits

* switch to IntoIterator

* remove redundant into_iter

* panic on wrong bit length

* pr feedback

* uint conversion

* rename byte -> value

* use or instead of xor

---------

Co-authored-by: sinu.eth <>
2023-03-06 14:35:43 -08:00
th4s
4269e91239 Codebase Overview (#200)
* Add some information about the codebase to README.md

* Added feedback
2023-03-01 14:31:43 -07:00
Dan
fbe3c4d1ee Merge pull request #197 from tlsnotary/simplify_decoding
simplify decoding
2023-02-22 13:00:40 +00:00
themighty1
00eb4adf99 simplify decoding
Removes the xor operation in decoding to make it simpler to reason about decoding:
1. We set DecodingInfo(w) to LSB(W_0)
2. `let truth_value = if LSB(W) == DecodingInfo(w) {0} else {1}
2023-02-21 17:07:54 +02:00
themighty1
ff18611821 simplified a2m
It is easier to reason about the protocol if we break it down in 2 steps:
(sender's additive share is x, receiver's is y)
1. the sender sends to peer `y * random`
2. the sender mixes in `x * random` into the last OT.
2023-02-21 13:36:43 +02:00
th4s
fb6ed747a6 Point addition (#190)
* Moved point-addition crate out of key-exchange

* Small improvements

* Added implementation for PointAddition

* WIP: Mock converter

* Implemented mock point addition

- refactored implementation

* Refactored mock implementation

* WIP: Added test to point-addition

* Completed test for point addition

* Undo name changes. Will be done in other branch

* Simplify async test

* Simplify conversion

* Added test for point_to_p256

* Repaired rebase

* Improve point-addition implementation

- Reduce roundtrips
- Add Field supertrait to XCoordinate of PointAddition trait

* Added feedback on comments

* Use enum `Role` instead of bool
2023-02-20 09:22:34 +00:00