Skip to content

Commit

Permalink
Merge pull request #235 from everx-labs/bls
Browse files Browse the repository at this point in the history
Added BLS primitives
  • Loading branch information
tonjen authored Apr 16, 2024
1 parent bb7e2f8 commit b958071
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Version 1.4.55

- Added BLS primitives

## Version 1.4.42

- Added BURN primitive
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build = 'build.rs'
edition = '2021'
name = 'ton_labs_assembler'
version = '1.4.54'
version = '1.4.55'

[dependencies]
clap = { features = [ 'derive' ], version = '4.3' }
Expand All @@ -13,8 +13,8 @@ num = '0.4'
num-traits = '0.2'
serde = { features = [ 'derive' ], version = '1.0' }
serde_json = '1.0'
ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.40' }
ton_vm = { git = 'https://github.com/tonlabs/ever-vm.git', tag = '1.9.24' }
ton_types = { branch = 'master', git = 'https://github.com/tonlabs/ever-types.git' }
ton_vm = { branch = 'master', git = 'https://github.com/tonlabs/ever-vm.git' }

[features]
gosh = [ ]
Expand Down
31 changes: 31 additions & 0 deletions src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,35 @@ impl Engine {
VERGRTH16 => 0xF9, 0x12
}

simple_commands! {
enumerate_bls_commands
BLS_VERIFY => 0xF9, 0x30, 0x00
BLS_AGGREGATE => 0xF9, 0x30, 0x01
BLS_FASTAGGREGATEVERIFY => 0xF9, 0x30, 0x02
BLS_AGGREGATEVERIFY => 0xF9, 0x30, 0x03
BLS_G1_ADD => 0xF9, 0x30, 0x10
BLS_G1_SUB => 0xF9, 0x30, 0x11
BLS_G1_NEG => 0xF9, 0x30, 0x12
BLS_G1_MUL => 0xF9, 0x30, 0x13
BLS_G1_MULTIEXP => 0xF9, 0x30, 0x14
BLS_G1_ZERO => 0xF9, 0x30, 0x15
BLS_MAP_TO_G1 => 0xF9, 0x30, 0x16
BLS_G1_INGROUP => 0xF9, 0x30, 0x17
BLS_G1_ISZERO => 0xF9, 0x30, 0x18
BLS_G2_ADD => 0xF9, 0x30, 0x20
BLS_G2_SUB => 0xF9, 0x30, 0x21
BLS_G2_NEG => 0xF9, 0x30, 0x22
BLS_G2_MUL => 0xF9, 0x30, 0x23
BLS_G2_MULTIEXP => 0xF9, 0x30, 0x24
BLS_G2_ZERO => 0xF9, 0x30, 0x25
BLS_MAP_TO_G2 => 0xF9, 0x30, 0x26
BLS_G2_INGROUP => 0xF9, 0x30, 0x27
BLS_G2_ISZERO => 0xF9, 0x30, 0x28
BLS_PAIRING => 0xF9, 0x30, 0x30
BLS_PUSHR => 0xF9, 0x30, 0x31

}

fn add_commands<'a>(&mut self, iter: impl IntoIterator<Item = &'a (&'static str, CompileHandler)>) {
// Add automatic commands
for (command, handler) in iter {
Expand All @@ -865,5 +894,7 @@ impl Engine {

#[cfg(feature = "groth")]
self.add_commands(Self::enumerate_groth_commands());

self.add_commands(Self::enumerate_bls_commands());
}
}

0 comments on commit b958071

Please sign in to comment.