Skip to content

Commit

Permalink
Simplify ChatGPT's hallucination
Browse files Browse the repository at this point in the history
  • Loading branch information
mskd12 committed Jun 2, 2023
1 parent bce53f2 commit 5184dac
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
7 changes: 2 additions & 5 deletions openid-zkp-auth/js/compressutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@ const decompressVector = (compressedVector) => {

const decompressAny = (compressedVector, targetNumber) => {
let decompressedVector = [...compressedVector.arr];
let offset = 0;
for (let i = 0; i < compressedVector.ind.length; i++) {
let start = compressedVector.ind[i][0] + offset;
let end = compressedVector.ind[i][1] + offset;
let start = compressedVector.ind[i][0];
let end = compressedVector.ind[i][1];
let length = end - start + 1;
decompressedVector.splice(start, 0, ...Array(length).fill(targetNumber));
start += length;
offset += end - start + 1;
}
return decompressedVector;
};
Expand Down
8 changes: 8 additions & 0 deletions openid-zkp-auth/testvectors/pavlos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjYwODNkZDU5ODE2NzNmNjYxZmRlOWRhZTY0NmI2ZjAzODBhMDE0NWMiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiI5NDY3MzEzNTIyNzYtcGs1Z2xjZzhjcW8zOG5kYjM5aDdqMDkzZnBzcGh1c3UuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI5NDY3MzEzNTIyNzYtcGs1Z2xjZzhjcW8zOG5kYjM5aDdqMDkzZnBzcGh1c3UuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTY4OTEzMjYxMDE4NzQwMDY2OTgiLCJoZCI6Im15c3RlbmxhYnMuY29tIiwiZW1haWwiOiJwYXZsb3NAbXlzdGVubGFicy5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwibm9uY2UiOiJBVWNING1jQVpVSkFBbE54ZTNoeXVEV3gwRGhJMWtBTDlXdUVuQ0twVVZJIiwiaWF0IjoxNjg1NjM4Njk2LCJleHAiOjE2ODU2NDIyOTYsImp0aSI6IjFjY2Q5YWQ1ZWU1OGVmZmE0Y2RjOTE5YjQwMDkxZjM4ZmQ5YzE5NzcifQ.UZOG38ZflIUCSLoyPN_xO_60G97eUwMLMOcFWHnAszv5tw16V6caJYh99SR2y7E63pjOglplwnzXkiRimfJJg-0WbCIGxOxW2z7cfH4fajp3HYJxWmjF3S3TlXXT4TF3ukwtcAnBU0bYAhHizBsoRDauiRVOn1Wi6m6zwngSP92FC2SJjxVbtRTYIfYWLL8uesqGSdRUqyWal4of2HRC5jbIZv-YPIZH_K8jfGAcSXsPwtC117bA4dBXgbgVlVrV2FR1kWFjtSGV1xRVZymIef6z9wyi8rCV2vXP1lV7AuOhTMFGYpSY9FZuY6eZWfrK9draOUej4ynkTqHx6AkT0Q",
"eph_public_key": "56815247060338758579061023017276112418315316695132410170879560228407674206928",
"max_epoch": 197,
"jwt_rand": "281448304213242675699890921152590691282",
"user_pin": "149886769698142983521415977318333651509",
"key_claim_name": "sub"
}
27 changes: 27 additions & 0 deletions openid-zkp-auth/testvectors/realJWTs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,33 @@ const GOOGLE_EXTENSION = {
}
}

const GOOGLE_WALLET = {
jwt: "eyJhbGciOiJSUzI1NiIsImtpZCI6IjYwODNkZDU5ODE2NzNmNjYxZmRlOWRhZTY0NmI2ZjAzODBhMDE0NWMiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiI5NDY3MzEzNTIyNzYtcGs1Z2xjZzhjcW8zOG5kYjM5aDdqMDkzZnBzcGh1c3UuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI5NDY3MzEzNTIyNzYtcGs1Z2xjZzhjcW8zOG5kYjM5aDdqMDkzZnBzcGh1c3UuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTY4OTEzMjYxMDE4NzQwMDY2OTgiLCJoZCI6Im15c3RlbmxhYnMuY29tIiwiZW1haWwiOiJwYXZsb3NAbXlzdGVubGFicy5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwibm9uY2UiOiJBVWNING1jQVpVSkFBbE54ZTNoeXVEV3gwRGhJMWtBTDlXdUVuQ0twVVZJIiwiaWF0IjoxNjg1NjM4Njk2LCJleHAiOjE2ODU2NDIyOTYsImp0aSI6IjFjY2Q5YWQ1ZWU1OGVmZmE0Y2RjOTE5YjQwMDkxZjM4ZmQ5YzE5NzcifQ.UZOG38ZflIUCSLoyPN_xO_60G97eUwMLMOcFWHnAszv5tw16V6caJYh99SR2y7E63pjOglplwnzXkiRimfJJg-0WbCIGxOxW2z7cfH4fajp3HYJxWmjF3S3TlXXT4TF3ukwtcAnBU0bYAhHizBsoRDauiRVOn1Wi6m6zwngSP92FC2SJjxVbtRTYIfYWLL8uesqGSdRUqyWal4of2HRC5jbIZv-YPIZH_K8jfGAcSXsPwtC117bA4dBXgbgVlVrV2FR1kWFjtSGV1xRVZymIef6z9wyi8rCV2vXP1lV7AuOhTMFGYpSY9FZuY6eZWfrK9draOUej4ynkTqHx6AkT0Q",
header: {
"alg": "RS256",
"kid": "6083dd5981673f661fde9dae646b6f0380a0145c",
"typ": "JWT"
},
payload: {
"iss": "https://accounts.google.com",
"azp": "946731352276-pk5glcg8cqo38ndb39h7j093fpsphusu.apps.googleusercontent.com",
"aud": "946731352276-pk5glcg8cqo38ndb39h7j093fpsphusu.apps.googleusercontent.com",
"sub": "116891326101874006698",
"hd": "mystenlabs.com",
"email": "[email protected]",
"email_verified": true,
"nonce": "AUcH4mcAZUJAAlNxe3hyuDWx0DhI1kAL9WuEnCKpUVI",
"iat": 1685638696,
"exp": 1685642296,
"jti": "1ccd9ad5ee58effa4cdc919b40091f38fd9c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