-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: lovesh <[email protected]>
- Loading branch information
Showing
26 changed files
with
248 additions
and
257 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
BBDT16_MAC_PARAMS_LABEL_BYTES, BBDT16KeypairG1, BBDT16MacPublicKeyG1, | ||
BBDT16Mac, BBDT16MacParams, BBDT16MacSecretKey, | ||
} from '@docknetwork/crypto-wasm-ts'; | ||
|
||
import { Bls12381BBDT16DockVerKeyName } from './constants'; | ||
import DockCryptoKeyPair from './common/DockCryptoKeyPair'; | ||
|
||
export default class Bls12381BBDT16KeyPairDock2024 extends DockCryptoKeyPair { | ||
constructor(options) { | ||
super(options, Bls12381BBDT16DockVerKeyName); | ||
} | ||
|
||
static get paramGenerator() { | ||
return this.SignatureParams.getMacParamsOfRequiredSize; | ||
} | ||
} | ||
|
||
Bls12381BBDT16KeyPairDock2024.SecretKey = BBDT16MacSecretKey; | ||
Bls12381BBDT16KeyPairDock2024.PublicKey = BBDT16MacPublicKeyG1; | ||
Bls12381BBDT16KeyPairDock2024.SignatureParams = BBDT16MacParams; | ||
Bls12381BBDT16KeyPairDock2024.Signature = BBDT16Mac; | ||
Bls12381BBDT16KeyPairDock2024.KeyPair = BBDT16KeypairG1; | ||
Bls12381BBDT16KeyPairDock2024.defaultLabelBytes = BBDT16_MAC_PARAMS_LABEL_BYTES; |
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,48 @@ | ||
import { | ||
BBDT16Credential, | ||
BBDT16CredentialBuilder, | ||
} from '@docknetwork/crypto-wasm-ts/'; | ||
|
||
import { Bls12381BBDT16MacDockName } from './constants'; | ||
|
||
import DockCryptoSignature from './common/DockCryptoSignature'; | ||
import Bls12381BBDT16KeyPairDock2024 from './Bls12381BBDT16KeyPairDock2024'; | ||
|
||
/** | ||
* A BBDT16 signature suite for use with BLS12-381 Dock key pairs | ||
*/ | ||
export default class Bls12381BBDT16MACDock2024 extends DockCryptoSignature { | ||
/** | ||
* Default constructor | ||
* @param options {SignatureSuiteOptions} options for constructing the signature suite | ||
*/ | ||
constructor(options = {}) { | ||
super( | ||
{ | ||
...options, | ||
signer: | ||
options.signer | ||
|| Bls12381BBDT16MACDock2024.signerFactory( | ||
options.keypair, | ||
options.verificationMethod, | ||
), | ||
}, | ||
Bls12381BBDT16MacDockName, | ||
Bls12381BBDT16KeyPairDock2024, | ||
'https://ld.dock.io/security/bbdt16/v1', | ||
); | ||
} | ||
|
||
static get paramGenerator() { | ||
return this.KeyPair.SignatureParams.getMacParamsOfRequiredSize; | ||
} | ||
} | ||
|
||
Bls12381BBDT16MACDock2024.KeyPair = Bls12381BBDT16KeyPairDock2024; | ||
Bls12381BBDT16MACDock2024.CredentialBuilder = BBDT16CredentialBuilder; | ||
Bls12381BBDT16MACDock2024.Credential = BBDT16Credential; | ||
Bls12381BBDT16MACDock2024.proofType = [ | ||
Bls12381BBDT16MacDockName, | ||
`sec:${Bls12381BBDT16MacDockName}`, | ||
`https://w3id.org/security#${Bls12381BBDT16MacDockName}`, | ||
]; |
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,41 @@ | ||
import { | ||
Bls12381BBDT16MacProofDockName, Bls12381BBDT16MacDockName, | ||
} from './constants'; | ||
|
||
import DockCryptoSignatureProof from './common/DockCryptoSignatureProof'; | ||
import Bls12381BBDT16KeyPairDock2024 from './Bls12381BBDT16KeyPairDock2024'; | ||
import Bls12381BBDT16MACDock2024 from './Bls12381BBDT16MACDock2024'; | ||
|
||
/** | ||
* A BBDT16 signature suite for use with derived BBDT16 credentials aka BBDT16 presentations | ||
*/ | ||
export default class Bls12381BBDT16MACProofDock2024 extends DockCryptoSignatureProof { | ||
/** | ||
* Default constructor | ||
* @param options {SignatureSuiteOptions} options for constructing the signature suite | ||
*/ | ||
constructor(options = {}) { | ||
super( | ||
options, | ||
Bls12381BBDT16MacProofDockName, | ||
Bls12381BBDT16KeyPairDock2024, | ||
'https://ld.dock.io/security/bbdt16/v1', | ||
); | ||
} | ||
|
||
/** | ||
* | ||
* @param _ | ||
* @returns {Promise<void>} - Public key isn't used for verifying KVACs | ||
*/ | ||
// eslint-disable-next-line no-empty-function | ||
async getVerificationMethod(_) {} | ||
} | ||
|
||
Bls12381BBDT16MACProofDock2024.Signature = Bls12381BBDT16MACDock2024; | ||
Bls12381BBDT16MACProofDock2024.sigName = Bls12381BBDT16MacDockName; | ||
Bls12381BBDT16MACProofDock2024.proofType = [ | ||
Bls12381BBDT16MacProofDockName, | ||
`sec:${Bls12381BBDT16MacProofDockName}`, | ||
`https://w3id.org/security#${Bls12381BBDT16MacProofDockName}`, | ||
]; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.