Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

as-chain

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-chain - npm Package Compare versions

Comparing version 0.0.69 to 0.0.70

28

assembly/crypto.ts

@@ -638,2 +638,26 @@ import { check } from "./system";

export class AltBn128Pair implements Packer {
constructor(
public g1: AltBn128G1 = new AltBn128G1(),
public g2: AltBn128G2 = new AltBn128G2(),
) {}
pack(): u8[] {
const rawG1 = this.g1.pack();
const rawG2 = this.g2.pack();
return rawG1.concat(rawG2);
}
unpack(data: u8[]): usize {
let dec = new Decoder(data);
this.g1.unpack(dec.unpackBytes(64))
this.g2.unpack(dec.unpackBytes(128))
return dec.getPos();
}
getSize(): usize {
return 192;
}
}
export function bn128Add(op1: AltBn128G1, op2: AltBn128G1): AltBn128G1 {

@@ -661,6 +685,6 @@ const rawOp1 = op1.pack();

export function bn128Pair(pairs: [AltBn128G1, AltBn128G2][]): boolean {
export function bn128Pair(pairs: AltBn128Pair[]): boolean {
let input: u8[] = []
for (let i=0; i<pairs.length; i++) {
input = input.concat(pairs[i][0].pack()).concat(pairs[i][1].pack())
input = input.concat(pairs[i].pack())
}

@@ -667,0 +691,0 @@ const ret = env.alt_bn128_pair(input.dataStart, input.length)

@@ -131,2 +131,3 @@ export { U128, U256, I128 } from "./bignum";

AltBn128G2,
AltBn128Pair,
bn128Add,

@@ -133,0 +134,0 @@ bn128Mul,

2

package.json
{
"name": "as-chain",
"version": "0.0.69",
"version": "0.0.70",
"description": "chain module for assemblyscript",

@@ -5,0 +5,0 @@ "main": "js/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc