Unverified Commit efb710e4 authored by Nadim Kobeissi's avatar Nadim Kobeissi 💎

Clean up arity spec

parent 41077f21
Pipeline #215 passed with stage
in 34 seconds
{
"name": "verifpal",
"version": "1.0.6",
"version": "1.0.8",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -49,9 +49,9 @@
"dev": true
},
"@types/node": {
"version": "13.13.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz",
"integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==",
"version": "13.13.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz",
"integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==",
"dev": true
},
"@types/vscode": {
......@@ -61,45 +61,45 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.30.0.tgz",
"integrity": "sha512-PGejii0qIZ9Q40RB2jIHyUpRWs1GJuHP1pkoCiaeicfwO9z7Fx03NQzupuyzAmv+q9/gFNHu7lo1ByMXe8PNyg==",
"version": "2.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.31.0.tgz",
"integrity": "sha512-iIC0Pb8qDaoit+m80Ln/aaeu9zKQdOLF4SHcGLarSeY1gurW6aU4JsOPMjKQwXlw70MvWKZQc6S2NamA8SJ/gg==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "2.30.0",
"@typescript-eslint/experimental-utils": "2.31.0",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
"tsutils": "^3.17.1"
}
},
"@typescript-eslint/experimental-utils": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.30.0.tgz",
"integrity": "sha512-L3/tS9t+hAHksy8xuorhOzhdefN0ERPDWmR9CclsIGOUqGKy6tqc/P+SoXeJRye5gazkuPO0cK9MQRnolykzkA==",
"version": "2.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.31.0.tgz",
"integrity": "sha512-MI6IWkutLYQYTQgZ48IVnRXmLR/0Q6oAyJgiOror74arUMh7EWjJkADfirZhRsUMHeLJ85U2iySDwHTSnNi9vA==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.30.0",
"@typescript-eslint/typescript-estree": "2.31.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
}
},
"@typescript-eslint/parser": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.30.0.tgz",
"integrity": "sha512-9kDOxzp0K85UnpmPJqUzdWaCNorYYgk1yZmf4IKzpeTlSAclnFsrLjfwD9mQExctLoLoGAUXq1co+fbr+3HeFw==",
"version": "2.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.31.0.tgz",
"integrity": "sha512-uph+w6xUOlyV2DLSC6o+fBDzZ5i7+3/TxAsH4h3eC64tlga57oMb96vVlXoMwjR/nN+xyWlsnxtbDkB46M2EPQ==",
"dev": true,
"requires": {
"@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.30.0",
"@typescript-eslint/typescript-estree": "2.30.0",
"@typescript-eslint/experimental-utils": "2.31.0",
"@typescript-eslint/typescript-estree": "2.31.0",
"eslint-visitor-keys": "^1.1.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.30.0.tgz",
"integrity": "sha512-nI5WOechrA0qAhnr+DzqwmqHsx7Ulr/+0H7bWCcClDhhWkSyZR5BmTvnBEyONwJCTWHfc5PAQExX24VD26IAVw==",
"version": "2.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.31.0.tgz",
"integrity": "sha512-vxW149bXFXXuBrAak0eKHOzbcu9cvi6iNcJDzEtOkRwGHxJG15chiAQAwhLOsk+86p9GTr/TziYvw+H9kMaIgA==",
"dev": true,
"requires": {
"debug": "^4.1.1",
......@@ -1154,9 +1154,9 @@
}
},
"tslib": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
"integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==",
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz",
"integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==",
"dev": true
},
"tsutils": {
......
......@@ -121,127 +121,106 @@ export default class VerifpalLib {
static primitiveInfo = (primitiveName: string) => {
let primitives = {
"ASSERT": {
arity: 2,
output: 1,
eg: "ASSERT(MAC(key, message), MAC(key, message)): unused",
help: "Checks the equality of two values, and especially useful for checking MAC equality. Output value is not used."
},
"CONCAT": {
arity: -1,
output: 1,
eg: "CONCAT(a, b): c",
eg: "CONCAT(a, b...): c",
help: "Concatenates two or more values into one value. For example, the concatenation of the strings `cat` and `dog` would be `catdog`."
},
"SPLIT": {
arity: 1,
output: -1,
eg: "SPLIT(CONCAT(a, b)): a, b",
help: "Splits a concatenation back to its component values. Must contain a CONCAT primitive as input; otherwise, Verifpal will output an error."
},
"HASH": {
arity: -1,
output: 1,
eg: "HASH(a, b...): x",
help: "Secure hash function, similar in practice to, for example, BLAKE2s. Takes an arbitrary number of input arguments ≥ 1, and returns one output."
},
"MAC": {
arity: 2,
output: 1,
eg: "MAC(key, message): h",
help: "Keyed hash function. Useful for message authentication and for some other protocol constructions."
},
"HKDF": {
arity: 3,
output: -1,
eg: "HKDF(salt, ikm, info): a, b...",
help: "Hash-based key derivation function inspired by the Krawczyk HKDF scheme. Essentially, HKDF is used to extract more than one key out a single secret value. salt and info help contextualize derived keys. Produces an arbitrary number of outputs ≥ 1."
},
"PW_HASH": {
arity: 1,
output: 1,
eg: "PW_HASH(a): x",
help: "Password hashing function, similar in practice to, for example, Scrypt or Argon2. Hashes passwords and produces output that is suitable for use as a private key, secret key or other sensitive key material. Useful in conjunction with values declared using `knows password a`."
},
"ENC": {
arity: 2,
output: 1,
eg: "ENC(key, plaintext): ciphertext",
help: "Symmetric encryption, similar for example to AES-CBC or to ChaCha20."
},
"DEC": {
arity: 2,
output: 1,
eg: "DEC(key, ENC(key, plaintext)): plaintext",
help: "Symmetric decryption."
},
"AEAD_ENC": {
arity: 3,
output: 1,
eg: "AEAD_ENC(key, plaintext, ad): ciphertext",
help: "Authenticated encryption with associated data. `ad` represents an additional payload that is not encrypted, but that must be provided exactly in the decryption function for authenticated decryption to succeed. Similar for example to AES-GCM or to ChaCha20-Poly1305."
},
"AEAD_DEC": {
arity: 3,
output: 1,
eg: "AEAD_DEC(key, AEAD_ENC(key, plaintext, ad), ad): plaintext",
help: "Authenticated decryption with associated data."
},
"PKE_ENC": {
arity: 2,
output: 1,
eg: "PKE_ENC(G^key, plaintext): ciphertext",
help: "Public-key encryption."
},
"PKE_DEC": {
arity: 2,
output: 1,
eg: "PKE_DEC(key, PKE_ENC(G^key, plaintext)): plaintext",
help: "Public-key decryption."
},
"SIGN": {
arity: 2,
output: 1,
eg: "SIGN(key, message): signature",
help: "Classic signature primitive. Here, `key` is a private key, for example `a`."
},
"SIGNVERIF": {
arity: 3,
output: 1,
eg: "SIGNVERIF(G^key, message, SIGN(key, message)): message",
help: "Verifies if signature can be authenticated. If key a was used for SIGN, then SIGNVERIF will expect `G^a` as the key value."
},
"RINGSIGN": {
arity: 4,
output: 1,
eg: "RINGSIGN(key_a, G^key_b, G^key_c, message): signature",
help: "Ring signature. In ring signatures, one of three parties (Alice, Bob and Charlie) signs a message. The resulting signature can be verified using the public key of any of the three parties, and the signature does not reveal the signatory, only that they are a member of the signing ring (Alice, Bob or Charlie). The first key must be the private key of the actual signer, while the subsequent two keys must be the public keys of the other potential signers."
},
"RINGSIGNVERIF": {
arity: 5,
output: 1,
eg: "RINGSIGNVERIF(G^a, G^b, G^c, m, RINGSIGN(a, G^b, G^c, m)): m",
help: "Verifies if a ring signature can be authenticated. The signer’s public key must match one or more of the public keys provided, but the public keys may be provided in any order and not necessarily in the order used during the RINGSIGN operation."
},
"BLIND": {
arity: 2,
output: 1,
eg: "BLIND(k, m): b",
help: "Message blinding primitive, useful for the implementation of blind signatures. Here, the sender uses the secret \"blinding factor\" `k` in order to blind message `m`, which can then be sent to the signer, who will be able to produce a signature on `m` without knowing `m`. Used in conjunction with UNBLIND -- see UNBLIND's documentation for more information."
},
"UNBLIND": {
arity: 3,
output: 1,
eg: "UNBLIND(k, m, SIGN(a, BLIND(k, m))): SIGN(a, m)",
help: "Once `BLIND(k, m)` is signed by the signer, the sender can convert `SIGN(a, BLIND(k, m))` to `SIGN(a, m)` by unblinding the message using their secret blinding factor `k`. The resulting unblinded signature can then be used as if it were a regular signature by `a` over `m`."
},
"SHAMIR_SPLIT": {
arity: 1,
output: 3,
eg: "SHAMIR_SPLIT(k): s1, s2, s3",
help: "In Verifpal, we allow splitting the key into three shares such that only two shares are required to reconstitute it."
},
"SHAMIR_JOIN": {
arity: 2,
output: 1,
eg: "SHAMIR_JOIN(sa, sb): k",
help: "Here, sa and sb must be two distinct elements out of the set (s1, s2, s3) in order to obtain k."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment