-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9187f5
commit 732bcee
Showing
9 changed files
with
58 additions
and
16 deletions.
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
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
33 changes: 33 additions & 0 deletions
33
concordium-sdk/src/main/java/com/concordium/sdk/crypto/BLSSignature.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,33 @@ | ||
package com.concordium.sdk.crypto; | ||
|
||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.ToString; | ||
|
||
import java.util.Arrays; | ||
|
||
@EqualsAndHashCode | ||
@ToString(includeFieldNames = false) | ||
public class BLSSignature { | ||
|
||
private static final int FIXED_LENGTH = 48; | ||
|
||
/** | ||
* The bytes representing the raw aggregate signature. The bytes have a fixed length of {@value BLSSignature#FIXED_LENGTH} bytes. | ||
*/ | ||
private final byte[] bytes; | ||
|
||
private BLSSignature(final byte[] bytes) { | ||
this.bytes = bytes; | ||
} | ||
|
||
@Builder | ||
public static BLSSignature from(final byte[] sig) { | ||
if (! (sig.length == 48)) {throw new IllegalArgumentException("BLSSignature must have fixed length of " + FIXED_LENGTH + " bytes"); } | ||
return new BLSSignature(sig); | ||
} | ||
|
||
public byte[] getBytes() { | ||
return Arrays.copyOf(bytes, bytes.length); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...m-sdk/src/main/java/com/concordium/sdk/responses/blockcertificates/BlockCertificates.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
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