-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
324 mac check spdz #343
Merged
Merged
324 mac check spdz #343
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a05c828
Do coin tossing in SPDZ mac check
n1v0lg aff65f4
Moving generic broadcast etc into core
n1v0lg 6d78043
Fix seed length
n1v0lg 0129537
Compatible maliciousmaccheck
n1v0lg 6522466
SPDZ res. pool now supplies drbgs
n1v0lg 6023277
Move broadcast test to core
n1v0lg fa0f98a
Move commitment test
n1v0lg 6b16c16
Add drbg seed length to resource pool
n1v0lg 0afa163
Malicious commitment tests
n1v0lg d487c9a
Test all parties cheating during commitment
n1v0lg 15190f6
Plug generic commitment comp into spdz mac check
n1v0lg 9bde357
Remove deprecated spdz commitment functionality
n1v0lg 7ff4203
Clean up spdz mac check
n1v0lg 2d2544c
Update malicious spdz mac check in tests
n1v0lg 60d97e0
Kill unused malicious test classes
n1v0lg ae1fab1
Test for tampering with delta
n1v0lg 0cedc1e
Test coin tossing
n1v0lg 1ae7151
Test default constructor for coin tossing
n1v0lg 156fa7b
Merge branch 'master' into 324-mac-check-spdz
n1v0lg 532f83e
Broadcast code coverage
n1v0lg a5553b4
Remove unused method in spdz native prot.
n1v0lg b1576bd
Kill unused SpdzCommitment
n1v0lg 5f9eb04
Addressing review comments
n1v0lg 626fbfc
Remove unused noOfParties
n1v0lg 13ba572
Fix line alignment in spdz mac check
n1v0lg f146673
Kill validMOD_P
n1v0lg e2c8cf9
Document broadcast computation
n1v0lg 5cf79a1
Nit
n1v0lg File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
.../natives/BroadcastValidationProtocol.java → .../generic/BroadcastValidationProtocol.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../spdz2k/resource/SecureBroadcastUtil.java → ...esco/lib/generic/SecureBroadcastUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
core/src/test/java/dk/alexandra/fresco/lib/generic/BroadcastValidationProtocolTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package dk.alexandra.fresco.lib.generic; | ||
|
||
import org.junit.Test; | ||
|
||
public class BroadcastValidationProtocolTest { | ||
|
||
@Test(expected = IllegalStateException.class) | ||
public void testOutThrows() { | ||
new BroadcastValidationProtocol(new byte[1]).out(); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
core/src/test/java/dk/alexandra/fresco/lib/generic/MaliciousCommitmentComputation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package dk.alexandra.fresco.lib.generic; | ||
|
||
import dk.alexandra.fresco.commitment.HashBasedCommitment; | ||
import dk.alexandra.fresco.framework.DRes; | ||
import dk.alexandra.fresco.framework.builder.numeric.ProtocolBuilderNumeric; | ||
import dk.alexandra.fresco.framework.network.serializers.ByteSerializer; | ||
import dk.alexandra.fresco.framework.util.Drbg; | ||
import dk.alexandra.fresco.framework.util.Pair; | ||
import java.util.List; | ||
|
||
public class MaliciousCommitmentComputation extends CommitmentComputation { | ||
|
||
private final ByteSerializer<HashBasedCommitment> commitmentSerializer; | ||
private final byte[] value; | ||
private final int noOfParties; | ||
private final Drbg localDrbg; | ||
|
||
public MaliciousCommitmentComputation( | ||
ByteSerializer<HashBasedCommitment> commitmentSerializer, | ||
byte[] value, int noOfParties, Drbg localDrbg) { | ||
super(commitmentSerializer, value, noOfParties, localDrbg); | ||
this.commitmentSerializer = commitmentSerializer; | ||
this.value = value; | ||
this.noOfParties = noOfParties; | ||
this.localDrbg = localDrbg; | ||
} | ||
|
||
@Override | ||
public DRes<List<byte[]>> buildComputation(ProtocolBuilderNumeric builder) { | ||
HashBasedCommitment ownCommitment = new HashBasedCommitment(); | ||
byte[] ownOpening = ownCommitment.commit(localDrbg, value); | ||
return builder.seq( | ||
seq -> { | ||
if (noOfParties > 2) { | ||
n1v0lg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return new BroadcastComputation<ProtocolBuilderNumeric>( | ||
commitmentSerializer.serialize(ownCommitment)) | ||
.buildComputation(seq); | ||
} else { | ||
return seq.append(new InsecureBroadcastProtocol<>( | ||
commitmentSerializer.serialize(ownCommitment))); | ||
} | ||
}) | ||
.seq((seq, rawCommitments) -> { | ||
// tamper with opening | ||
ownOpening[1] = (byte) (ownOpening[1] ^ 1); | ||
DRes<List<byte[]>> res = seq.append(new InsecureBroadcastProtocol<>(ownOpening)); | ||
final Pair<DRes<List<byte[]>>, List<byte[]>> dResListPair = new Pair<>(res, | ||
rawCommitments); | ||
return () -> dResListPair; | ||
}) | ||
.seq((seq, pair) -> null); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is reasonable to document this class and the constructor - especially when it it resonable to use one or the other