957 Commits

Author SHA1 Message Date
th4s
92f0ea0f33 Improvements for padding in KOS15 (#64)
* Improvements for padding in KOS15

- Remove `self.padding` of KOS15Receiver
- Remove the entire padding after transposition for both sender and
  receiver

* Adapted comment
2022-08-19 12:40:42 +00:00
th4s
cc76457575 Kos15 improvements (#53)
* WIP: Turning matrix of receiver into one-dimensional Vec

* Adapted KOS15Receiver to use a Vec<u8> for matrix encoding

* WIP: Adapted sender to new table format and minor other improvements

* WIP: Small bugfixes

* Debugging tests...

* Small bugfix, KOS15 implementation working with new matrix format

* Bugfix in benchmarks

* Adapted drainage for KOS check to new matrix encoding

* Added comments about KOS check and extra bytes

* Minor improvements

* Added feedback

* Bugfix of wrong padding

* Made input random for KOS15 test

* Added feedback

- comment about 256
- DOS prevention
- variable rename

* Padding on sender side now calculated based on matrix

* Added correct formula for derivation of padding

* Adapted comment

* Fixed bug in test case

* Adapted test cases

* fix padding, randomize tests

(cherry picked from commit 2b005b442c2c1cb1b8273205b334eb4f3eeab765)

Co-authored-by: themighty1 <you@example.com>
2022-08-18 20:12:59 +00:00
sinuio
54021b8ba0 update README 2022-08-17 11:17:10 -07:00
sinuio
ca28e0807b delete junk 2022-08-17 11:17:10 -07:00
sinu.eth
09f3f5e3ec Refactor msgs + serde support (#60)
* add serde derive to garble msgs

* refactor point_addition

* OT refactor

* serde feature

* exclude mpc-aio

Co-authored-by: sinuio <>
2022-08-17 11:10:58 -07:00
sinu.eth
fa9de81935 GC core impl improvements (#55)
* wip: newtypes

* output labels

* copy -> clone

* fix dualex

* decode comment

* export EvaluatedGarbledCircuit

* export OutputLabels

* wip: move functions into impls

* output label encoding

* add generic to GC

* fix garble bench

* mod visibility and exports

* export garbled circuit data

* garble msgs and type conversions

* remove some things from pub api

* fix tls-2pc-core bench

* generate_split convenience function

* fix validation bug

* comments

* use unwrap_or_else

* Change id to String

* fix wrong apostrophe

* input label tests and bug fix

* allow dead code for delta

* type conversion and validation

Co-authored-by: sinuio <>
2022-08-16 17:27:37 -07:00
sinu.eth
187a78c0e6 IO features mpc-circuits (#51)
* more work on mpc-circuits

* export InputValue OutputValue

* switch from Result to Option

* add invariants to Circuit constructor

* expose inner

* PartialEq for io

* relax constraint on gate wires

* break up circuit validation and add comments

Co-authored-by: sinuio <>
2022-08-16 17:04:44 -07:00
sinuio
ce30bbb55d enclose conditional to fix parsing issue 2022-08-10 11:12:08 -07:00
th4s
239d6a18b7 Disable workflow for draft PRS (#54) 2022-08-10 09:46:47 -07:00
th4s
8708b8f1bf Implement matrix transpose (#50)
* First compiling example using SIMD instructions in WASM

* WIP: Added first implementation of transpose_bytes

* WIP: Matrix transposition

- bugfix in transpose_bytes implementation
- added test case
- return error for N = 1 case

* Added a simple bench

* Improved byte transposition

Now need to only allocate the first half of the matrix

* Improved transpose_bytes to only use one pass per round

* Put pointer alloc before loop

* Now benching both versions

* WIP: Matrix tranpose

- made implementation generic
- improved documentation
- removed slower variant

* WIP: Implementing bit transpose

* Added transpose_bits implementation for wasm architecture

* Improved matrix transpose implementation

- added x86_64 bit-level transpose
- improved api and documentation

* Removed transmute and unused dependencies

* WIP: Various bugfixes

- added test for transpose_bits_unchecked

* Added a bench and removed double implementation of
bitmask_shift_unchecked

* It works

- bugfix in test_transpose_bits

* Renamed crate and made part of tlsn

* Added feature simd-transpose

* Bugfix for row dimension

* Added errors and little bugfix in error-check of transpose_bits function

* WIP: Added non-simd matrix-transpose

* Small bugfix and added doc

* Moved benches to criterion

* Added baseline implementation to criterion benches

* improved non-simd vesion

* Improved simd version

* Reverted changes in mpc-core

* Added feedback
2022-08-10 12:33:46 +00:00
th4s
8ef550b431 Add check for boolvec_to_u8vec to only allow multiples of 8 2022-08-09 18:44:44 +02:00
sinuio
74c56ea60e tidy up benchmarks 2022-08-05 18:03:18 -07:00
sinu.eth
64b686643c Work on Garbled Circuits (#47)
* refactor circuit model and garbling

* refactor circuit input/output with NewTypes

* work on circuit input/output

* circuit id and restructure

* export CircuitId

* relocate bristol circuits, update tls-2pc-core

* Dual Execution (#48)

* type wrappers

* rename eval to evaluate

* more typing and helpers

* dual execution initial work

* organizing

* peer error and trait bound

* garble io

* dual execution works

* delete garble example

* impl AsRef for WireLabel

* WireLabel constructor

* Refactor DualExection struct to DualExLeader and DualExFollower

* shorten execution module name to exec

* derive debug and copy

* comments

Co-authored-by: sinuio <>

* impl AsRef for Output

* remove public labels and simplify INV gate

* DualEx tidying and tests

* make decoded output optional

* tidy up protobuf models

* removed anyhow dep

* readd compile bin

* unused deps

* decode comment and consistency

* tidy up

* comment

* remove comment about label decoding

* impl AsRef for EncryptedGate

* SanitizedInputLabels

Co-authored-by: sinuio <>
2022-08-05 14:43:04 -07:00
themighty1
4cbf62f560 comment typo 2022-08-05 12:47:44 +03:00
themighty1
db2363c802 comment on KOS bits 2022-08-05 12:43:40 +03:00
sinuio
9616dec43f update CI 2022-08-03 22:00:09 -07:00
sinuio
90c98c1935 ignore test, and temporarily exclude tls-client from workspace 2022-07-29 09:33:55 -07:00
Dan
658e6344c5 Merge pull request #45 from tlsnotary/circuit_test
added Bristol circuits with tests
2022-07-22 06:54:53 +00:00
themighty1
ed3ff475fb added Bristol circuits with tests 2022-07-22 09:52:51 +03:00
sinuio
89cb9b5375 clean up and renaming 2022-07-14 12:31:20 -07:00
sinuio
f6654eb4c4 point addition trait + mock 2022-07-14 12:21:05 -07:00
sinuio
daaffedef4 fix mpc-aio 2022-07-13 19:17:39 -07:00
sinuio
ed357a78e8 rename Kos15Message back to Message 2022-07-13 19:17:08 -07:00
sinuio
fa85dd52c5 fix benches, export impls at ot mod root 2022-07-13 18:27:17 -07:00
Michael Rosenberg
39202aebfa Merge pull request #37 from rozbb/dev
Refactor of `mpc-core`
2022-07-13 13:14:36 -04:00
Michael Rosenberg
2c7dde950c Added more length checks to KOS15 sender 2022-07-13 02:47:41 -04:00
Michael Rosenberg
fe36f1c30b Removed all OTE traits 2022-07-11 23:58:07 -04:00
Michael Rosenberg
dc2f17e1df Renamed SenderState::ReadyToSend back to Setup 2022-07-11 23:51:44 -04:00
Michael Rosenberg
9c4d61cc39 Added forgotten length check to base OT send 2022-07-11 15:51:31 -04:00
Michael Rosenberg
30c2bc873f Cleaned up OT state checks 2022-07-11 15:33:12 -04:00
Michael Rosenberg
5ba6757464 Improved state checks in base OT 2022-07-08 16:53:27 -04:00
sinuio
0f5d49402a relocate hs msgs 2022-07-07 15:42:19 -07:00
Michael Rosenberg
050ecb3b1a Finished renaming protobufs messages 2022-07-07 04:49:34 -04:00
sinu.eth
b8906cd490 Standard Crypto implementation for testing (#36)
* initial work on std crypto

* enable tls12 for rustls

* clean up unused

* temp disable kx groups

* set server random

* setup record layer in ExpectServerDone

* refactor enc/decrypter setup

* disable currently unsupported version and suites

* enable RSA

* fix decrypt keys

* use constructor

* fix comment

* disable some cipher suites from tests

* prepare decrypter

* begin support for ems

Co-authored-by: themighty1 <>
2022-07-05 13:15:42 -07:00
Michael Rosenberg
b50190ae5a Removed printlns from previous debugging 2022-07-04 18:25:46 -04:00
Michael Rosenberg
bece3b03f7 Made naming more consistent 2022-07-04 17:58:03 -04:00
Michael Rosenberg
91114deb82 Undid reversion 2022-06-28 02:59:47 -04:00
Michael Rosenberg
ec8250a72e Reverted to 6569a0e 2022-06-28 02:54:51 -04:00
Michael Rosenberg
b4c46e1cb7 Tests passing 2022-06-28 02:48:11 -04:00
Michael Rosenberg
20e200f71e Tests compiling; not passing 2022-06-28 02:31:40 -04:00
Michael Rosenberg
08dc29462d Refactor compiling; tests not compiling 2022-06-28 01:46:12 -04:00
Michael Rosenberg
4f28ddeef8 Restructured base OT; not compiling yet 2022-06-20 15:37:35 -04:00
sinuio
6569a0e815 fix lint flag 2022-06-15 17:04:00 -07:00
sinuio
d3f123710b rename module to crypto 2022-06-15 16:57:34 -07:00
sinuio
3a15db1a04 use new trait 2022-06-15 16:57:34 -07:00
sinuio
66ed4b646c ignore warnings in key log tests 2022-06-15 16:57:34 -07:00
sinuio
b25643e132 remove unused import, expose cipher modes, change Crypto trait 2022-06-15 16:57:34 -07:00
sinuio
452db97dd2 consolidate traits, convert functions to fallible, and remove recursion 2022-06-15 16:57:34 -07:00
Dan
ce66d2c419 KOS15 check (#29)
* KOS15 check

* prost->core try_into
misc rename

* add new states
replace unwrap

* fix xor()

* add clmul crate

* remove debug info

* add license file

* replace unwrap with match

* move emptool ref clmul128 into clmul.rs to avoid cfg_if in lib.rs
test all backends from lib.rs

* idiomatic error assert in tests

* 6x speed up with clmul_reuse. add benchmarks

* simplify autodetection logic

* resolve endianness issue

* add a dummy "tests" dir to make mod tests happy

* fix path

* add MIT license and README

Co-authored-by: themighty1 <you@example.com>
Co-authored-by: sinuio <>
2022-06-15 12:27:41 -07:00
sinuio
d396755886 remove resolver 2022-06-14 23:19:48 -07:00