Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: lovesh <lovesh.bond@gmail.com>
  • Loading branch information
lovesh committed Jul 3, 2024
1 parent c2e8c91 commit dd0883c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/anonymous-credentials/serialized-credential.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe(`${Scheme} Credential creation and verification from JSON`, () => {
check('0.5.0', '0.3.0');
})

skipIfKvac('check version 0.6.0', () => {
it('check version 0.6.0', () => {
check('0.6.0', '0.4.0');
})
})

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cryptoVersion":"0.6.0","credentialSchema":{"id":"data:application/json;charset=utf-8,","type":"JsonSchemaValidator2018","version":"0.4.0","details":"{\"jsonSchema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"definitions\":{\"encryptableCompString\":{\"type\":\"string\"},\"encryptableString\":{\"type\":\"string\"}},\"properties\":{\"credentialSubject\":{\"properties\":{\"BMI\":{\"minimum\":0,\"multipleOf\":0.01,\"type\":\"number\"},\"SSN\":{\"$ref\":\"#/definitions/encryptableString\"},\"city\":{\"type\":\"string\"},\"country\":{\"type\":\"string\"},\"email\":{\"type\":\"string\"},\"fname\":{\"type\":\"string\"},\"height\":{\"minimum\":0,\"multipleOf\":0.1,\"type\":\"number\"},\"lname\":{\"type\":\"string\"},\"score\":{\"minimum\":-100,\"multipleOf\":0.1,\"type\":\"number\"},\"secret\":{\"type\":\"string\"},\"timeOfBirth\":{\"minimum\":0,\"type\":\"integer\"},\"userId\":{\"$ref\":\"#/definitions/encryptableCompString\"},\"weight\":{\"minimum\":0,\"multipleOf\":0.1,\"type\":\"number\"}},\"type\":\"object\"},\"proof\":{\"properties\":{\"type\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"parsingOptions\":{\"defaultDecimalPlaces\":0,\"defaultMinimumDate\":-17592186044415,\"defaultMinimumInteger\":-4294967295,\"useDefaults\":false}}"},"credentialSubject":{"fname":"John","lname":"Smith","email":"john.smith@example.com","SSN":"123-456789-0","userId":"user:123-xyz-#","country":"USA","city":"New York","timeOfBirth":1662010849619,"height":181.5,"weight":210.4,"BMI":23.25,"score":-13.5,"secret":"my-secret-that-wont-tell-anyone"},"proof":{"type":"Bls12381BBDT16MACDock2024","proofValue":"X8wED4YwRpMitd2oCncbNQHRXsAojucGVGbp2Umzi8k5A1EojsMzuKvBhq7hCpA9CbfKZMW6WQhh3iVaVrh2sk9WxfsSCdB4jW1N3RXoXfCpjY9e88WToeGttQr2pYTcutAmXfWbL6WDFYq3xDu5LKC6w"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cryptoVersion":"0.6.0","credentialSchema":{"id":"data:application/json;charset=utf-8,","type":"JsonSchemaValidator2018","version":"0.4.0","details":"{\"jsonSchema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"definitions\":{\"encryptableCompString\":{\"type\":\"string\"},\"encryptableString\":{\"type\":\"string\"}},\"properties\":{\"credentialSubject\":{\"properties\":{\"fname\":{\"type\":\"string\"},\"isbool\":{\"type\":\"boolean\"},\"lname\":{\"type\":\"string\"},\"location\":{\"properties\":{\"city\":{\"type\":\"string\"},\"country\":{\"type\":\"string\"}},\"type\":\"object\"},\"physical\":{\"properties\":{\"BMI\":{\"minimum\":0,\"multipleOf\":0.01,\"type\":\"number\"},\"height\":{\"minimum\":0,\"multipleOf\":0.1,\"type\":\"number\"},\"weight\":{\"minimum\":0,\"multipleOf\":0.1,\"type\":\"number\"}},\"type\":\"object\"},\"score\":{\"minimum\":-100,\"multipleOf\":0.1,\"type\":\"number\"},\"sensitive\":{\"properties\":{\"SSN\":{\"$ref\":\"#/definitions/encryptableString\"},\"email\":{\"type\":\"string\"},\"secret\":{\"type\":\"string\"},\"userId\":{\"$ref\":\"#/definitions/encryptableCompString\"}},\"type\":\"object\"},\"timeOfBirth\":{\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"},\"proof\":{\"properties\":{\"type\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"parsingOptions\":{\"defaultDecimalPlaces\":0,\"defaultMinimumDate\":-17592186044415,\"defaultMinimumInteger\":-4294967295,\"useDefaults\":false}}"},"credentialSubject":{"fname":"John","lname":"Smith","isbool":true,"sensitive":{"secret":"my-secret-that-wont-tell-anyone","email":"john.smith@example.com","SSN":"123-456789-0","userId":"user:123-xyz-#"},"location":{"country":"USA","city":"New York"},"timeOfBirth":1662010849619,"physical":{"height":181.5,"weight":210,"BMI":23.25},"score":-13.5},"proof":{"type":"Bls12381BBDT16MACDock2024","proofValue":"STnydUcuxstF36Jpu9TBHdkPg5o1eRX7AxcCtbJz1V3Lug44S2WpmrRcJVrPMb5pbvr8kCYkWWtJ8LUxoRDDBjjGcErcMEM4iXy9wHY4MVrT5ASe5qxHBVR5ybL1wWfJBLpLSWtFHKhoTqJcnp23L2Cne"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cryptoVersion":"0.6.0","credentialSchema":{"id":"data:application/json;charset=utf-8,","type":"JsonSchemaValidator2018","version":"0.4.0","details":"{\"jsonSchema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"definitions\":{\"encryptableCompString\":{\"type\":\"string\"},\"encryptableString\":{\"type\":\"string\"}},\"properties\":{\"credentialStatus\":{\"properties\":{\"id\":{\"type\":\"string\"},\"revocationCheck\":{\"type\":\"string\"},\"revocationId\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"type\":\"object\"},\"credentialSubject\":{\"properties\":{\"fname\":{\"type\":\"string\"},\"lessSensitive\":{\"properties\":{\"department\":{\"properties\":{\"location\":{\"properties\":{\"geo\":{\"properties\":{\"lat\":{\"minimum\":-90,\"multipleOf\":0.001,\"type\":\"number\"},\"long\":{\"minimum\":-180,\"multipleOf\":0.001,\"type\":\"number\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},\"location\":{\"properties\":{\"city\":{\"type\":\"string\"},\"country\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"lname\":{\"type\":\"string\"},\"rank\":{\"minimum\":0,\"type\":\"integer\"},\"sensitive\":{\"properties\":{\"SSN\":{\"$ref\":\"#/definitions/encryptableString\"},\"email\":{\"type\":\"string\"},\"phone\":{\"type\":\"string\"},\"very\":{\"properties\":{\"secret\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"}},\"type\":\"object\"},\"proof\":{\"properties\":{\"type\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"parsingOptions\":{\"defaultDecimalPlaces\":0,\"defaultMinimumDate\":-17592186044415,\"defaultMinimumInteger\":-4294967295,\"useDefaults\":false}}"},"credentialSubject":{"fname":"John","lname":"Smith","sensitive":{"very":{"secret":"my-secret-that-wont-tell-anyone"},"email":"john.smith@acme.com","phone":"801009801","SSN":"123-456789-0"},"lessSensitive":{"location":{"country":"USA","city":"New York"},"department":{"name":"Random","location":{"name":"Somewhere","geo":{"lat":-23.658,"long":2.556}}}},"rank":6},"credentialStatus":{"type":"DockVBAccumulator2022","id":"dock:accumulator:accumId123","revocationCheck":"membership","revocationId":"user:A-123"},"proof":{"type":"Bls12381BBDT16MACDock2024","proofValue":"RF4p27pdfHSZAP1iAynCDAPZYHu3exLsgNynQz5w93dBsBtbkfXfePtRfonzKiZknrWENe5576S2qP3Ki2XyJ4ynLkwFzGVvKxmu9iCUjYt7a6xB1nsKNxXkHStBKpyUFChZ4bbvnWeh2vvSQAUb6Z2Yc"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cryptoVersion":"0.6.0","credentialSchema":{"id":"data:application/json;charset=utf-8,","type":"JsonSchemaValidator2018","version":"0.4.0","details":"{\"jsonSchema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"definitions\":{\"encryptableCompString\":{\"type\":\"string\"},\"encryptableString\":{\"type\":\"string\"}},\"properties\":{\"credentialStatus\":{\"properties\":{\"id\":{\"type\":\"string\"},\"revocationCheck\":{\"type\":\"string\"},\"revocationId\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"type\":\"object\"},\"credentialSubject\":{\"properties\":{\"education\":{\"properties\":{\"studentId\":{\"type\":\"string\"},\"transcript\":{\"properties\":{\"CGPA\":{\"minimum\":0,\"multipleOf\":0.01,\"type\":\"number\"},\"rank\":{\"minimum\":0,\"type\":\"integer\"},\"scores\":{\"properties\":{\"english\":{\"minimum\":0,\"type\":\"integer\"},\"geography\":{\"minimum\":0,\"type\":\"integer\"},\"history\":{\"minimum\":0,\"type\":\"integer\"},\"mathematics\":{\"minimum\":0,\"type\":\"integer\"},\"science\":{\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}},\"type\":\"object\"},\"university\":{\"properties\":{\"name\":{\"type\":\"string\"},\"registrationNumber\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"fname\":{\"type\":\"string\"},\"lname\":{\"type\":\"string\"},\"sensitive\":{\"properties\":{\"SSN\":{\"$ref\":\"#/definitions/encryptableString\"},\"email\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"proof\":{\"properties\":{\"type\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"parsingOptions\":{\"defaultDecimalPlaces\":0,\"defaultMinimumDate\":-17592186044415,\"defaultMinimumInteger\":-4294967295,\"useDefaults\":false}}"},"credentialSubject":{"fname":"John","lname":"Smith","sensitive":{"email":"john.smith@example.edu","SSN":"123-456789-0"},"education":{"studentId":"s-22-123450","university":{"name":"Example University","registrationNumber":"XYZ-123-789"},"transcript":{"rank":100,"CGPA":2.57,"scores":{"english":60,"mathematics":70,"science":50,"history":45,"geography":40}}}},"credentialStatus":{"type":"DockVBAccumulator2022","id":"dock:accumulator:accumId124","revocationCheck":"membership","revocationId":"tran:2022-YZ4-250"},"proof":{"type":"Bls12381BBDT16MACDock2024","proofValue":"SZiSqGi4S1bCWjX6ZTDxFqypYxJ4ib5asvQiEjBtwQGX9Py11mAaxNQhQfwhKWZHu8RKjX4MMsGjA1KzEUdxi6Tpk5ktTFwYoRn9GbZh8HTDCPz9DKK2Jz6VCFyAB3KYZWDD7VzGSZK7ucHDmWvEwLXxY"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cryptoVersion":"0.6.0","credentialSchema":{"id":"data:application/json;charset=utf-8,","type":"JsonSchemaValidator2018","version":"0.4.0","details":"{\"jsonSchema\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"definitions\":{\"encryptableCompString\":{\"type\":\"string\"},\"encryptableString\":{\"type\":\"string\"}},\"properties\":{\"credentialSubject\":{\"items\":[{\"properties\":{\"location\":{\"properties\":{\"geo\":{\"properties\":{\"lat\":{\"minimum\":-90,\"multipleOf\":0.001,\"type\":\"number\"},\"long\":{\"minimum\":-180,\"multipleOf\":0.001,\"type\":\"number\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},{\"properties\":{\"location\":{\"properties\":{\"geo\":{\"properties\":{\"lat\":{\"minimum\":-90,\"multipleOf\":0.001,\"type\":\"number\"},\"long\":{\"minimum\":-180,\"multipleOf\":0.001,\"type\":\"number\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},{\"properties\":{\"location\":{\"properties\":{\"geo\":{\"properties\":{\"lat\":{\"minimum\":-90,\"multipleOf\":0.001,\"type\":\"number\"},\"long\":{\"minimum\":-180,\"multipleOf\":0.001,\"type\":\"number\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"},\"name\":{\"type\":\"string\"}},\"type\":\"object\"}],\"type\":\"array\"},\"proof\":{\"properties\":{\"type\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"},\"parsingOptions\":{\"defaultDecimalPlaces\":0,\"defaultMinimumDate\":-17592186044415,\"defaultMinimumInteger\":-4294967295,\"useDefaults\":false}}"},"credentialSubject":[{"name":"Random","location":{"name":"Somewhere","geo":{"lat":-23.658,"long":2.556}}},{"name":"Random-1","location":{"name":"Somewhere-1","geo":{"lat":35.01,"long":-40.987}}},{"name":"Random-2","location":{"name":"Somewhere-2","geo":{"lat":-67,"long":-10.12}}}],"proof":{"type":"Bls12381BBDT16MACDock2024","proofValue":"V5DaBxrvzWhRTvN3tWJs5GTqKiR5FFoSkuuEqTjSWWiUKdVz35xFFBHTn1QRNiwUe7mBWMtGxZGnaTmJLrsnHNB6HkS68X1GUoVJjPoZB8hGYrvqjN2dTpj4EF8ux34ZUGLMNGiqQvUxJstXRZ6LKoaZN"}}
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe(`${Scheme} Presentation creation and verification from JSON`, () => {
check('0.5.0', '0.7.0', 'bound-check-legogroth16-vk2');
});

skipIfKvac('check version 0.8.0', () => {
it('check version 0.8.0', () => {
// Legosnark keys changed due type of certain values changed from `u64` to `u32`
check('0.6.0', '0.8.0', 'bound-check-legogroth16-vk2');
});
Expand Down
4 changes: 2 additions & 2 deletions tests/scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ import {
getBBDT16StatementForBlindMacRequest,
getBBDT16WitnessForBlindMacRequest, BBDT16CredentialBuilder, BBDT16Credential, BBDT16KeypairG1, BBDT16MacPublicKeyG1
} from '../src';
import { BBDT16BlindMac, BBDT16Mac, BBDT16MacParams, BBDT16MacSecretKey } from '../src/bbdt16-mac';
import { BBDT16BlindMac, BBDT16Mac, BBDT16MacParams, BBDT16MacSecretKey } from '../src';

export { Presentation } from '../src/anonymous-credentials/presentation';
export { PresentationBuilder } from '../src/anonymous-credentials/presentation-builder';

export let Scheme: string = process.env.TEST_SIGNATURE_SCHEME || 'BBDT16',
export let Scheme: string = process.env.TEST_SIGNATURE_SCHEME || 'BBS',
SignatureLabelBytes: Uint8Array,
PublicKey,
SecretKey,
Expand Down

0 comments on commit dd0883c

Please sign in to comment.