Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BL12-381 Integration #1310

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 160 additions & 0 deletions soroban-env-common/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,166 @@
"return": "Void",
"docs": "Verifies the `signature` using an ECDSA secp256r1 `public_key` on a 32-byte `msg_digest`. Warning: The `msg_digest` must be produced by a secure cryptographic hash function on the message, otherwise the attacker can potentially forge signatures. The `public_key` is expected to be 65 bytes in length, representing a SEC-1 encoded point in uncompressed format. The `signature` is the ECDSA signature `(r, s)` serialized as fixed-size big endian scalar values, both `r`, `s` must be non-zero and `s` must be in the lower range. ",
"min_supported_protocol": 21
},
{
"export": "4",
"name": "bls_g1_add",
"args": [
{
"name": "point1",
"type": "BytesObject"
},
{
"name": "point2",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format."
},
{
"export": "5",
"name": "bls_g1_mul",
"args": [
{
"name": "point",
"type": "BytesObject"
},
{
"name": "scalar",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Multiplies a BLS12-381 G1 point by a scalar, both given in bytes format, and returns the resulting G1 point in bytes format."
},
{
"export": "6",
"name": "bls_g1_multiexp",
"args": [
{
"name": "scalars",
"type": "BytesObject"
},
{
"name": "pn",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Performs multiexponentiation on a BLS12-381 G1 point by a vector of scalars, all given in bytes format, and returns the resulting G1 point in bytes format."
},
{
"export": "7",
"name": "bls_map_to_g1",
"args": [
{
"name": "msg",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Maps a message to a BLS12-381 G1 point given in bytes format and returns the resulting G1 point in bytes format."
},
{
"export": "8",
"name": "bls_hash_to_g1",
"args": [
{
"name": "msg",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Hashes a message to a BLS12-381 G1 point given in bytes format and returns the resulting G1 point in bytes format."
},
{
"export": "9",
"name": "bls_g2_add",
"args": [
{
"name": "point1",
"type": "BytesObject"
},
{
"name": "point2",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format."
},
{
"export": "a",
"name": "bls_g2_mul",
"args": [
{
"name": "point",
"type": "BytesObject"
},
{
"name": "scalar",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Multiplies a BLS12-381 G2 point by a scalar, both given in bytes format, and returns the resulting G2 point in bytes format."
},
{
"export": "b",
"name": "bls_map_to_g2",
"args": [
{
"name": "msg",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Maps a message to a BLS12-381 G2 point given in bytes format and returns the resulting G2 point in bytes format."
},
{
"export": "c",
"name": "bls_g2_multiexp",
"args": [
{
"name": "scalars",
"type": "BytesObject"
},
{
"name": "pn",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Performs multiexponentiation on a BLS12-381 G2 point by a vector of scalars, all given in bytes format, and returns the resulting G2 point in bytes format."
},
{
"export": "d",
"name": "bls_hash_to_g2",
"args": [
{
"name": "msg",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Hashes a message to a BLS12-381 G2 point given in bytes format and returns the resulting G2 point in bytes format."
},
{
"export": "e",
"name": "bls_pairing",
"args": [
{
"name": "p1",
"type": "BytesObject"
},
{
"name": "p2",
"type": "BytesObject"
}
],
"return": "BytesObject",
"docs": "Performs pairing operation on a BLS12-381 G1 point and a G2 point, both given in bytes format, and returns the resulting pairing in bytes format."
}
]
},
Expand Down
1 change: 1 addition & 0 deletions soroban-env-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ sha3 = "=0.10.8"
# protocol release when we can safely bump the minimum curve25519-dalek version
# in stellar-core as well.
curve25519-dalek = { version = ">=4.1.1, <=4.1.2", default-features = false, features = ["digest"]}
blst = "0.3.11"

[target.'cfg(not(target_family = "wasm"))'.dependencies]
tracy-client = { version = "=0.15.2", features = ["enable", "timer-fallback"], default-features = false, optional = true }
Expand Down
Loading