Clean methods not in the interface

This commit is contained in:
dapplion 2020-11-29 22:30:47 +00:00
parent 3bb136cfcc
commit 2208922aa6
3 changed files with 0 additions and 22 deletions

View File

@ -1,7 +1,6 @@
import * as blst from "@chainsafe/blst";
import {bytesToHex, hexToBytes} from "../helpers";
import {IPublicKey} from "../interface";
import {Signature} from "./signature";
export class PublicKey implements IPublicKey {
readonly affine: blst.PublicKey;
@ -28,10 +27,6 @@ export class PublicKey implements IPublicKey {
return new PublicKey(affine, jacobian);
}
verifyMessage(signature: Signature, message: Uint8Array): boolean {
return signature.verify(this, message);
}
toBytes(): Uint8Array {
return this.affine.toBytes();
}

View File

@ -1,7 +1,6 @@
import {PublicKeyType} from "bls-eth-wasm";
import {getContext} from "./context";
import {EMPTY_PUBLIC_KEY, PUBLIC_KEY_LENGTH} from "../constants";
import {Signature} from "./signature";
import {bytesToHex, hexToBytes, isEqualBytes} from "../helpers";
import {IPublicKey} from "../interface";
@ -41,16 +40,6 @@ export class PublicKey implements IPublicKey {
return agg;
}
add(other: PublicKey): PublicKey {
const agg = new PublicKey(this.value.clone());
agg.value.add(other.value);
return agg;
}
verifyMessage(signature: Signature, message: Uint8Array): boolean {
return this.value.verify(signature.value, message);
}
toBytes(): Uint8Array {
return this.value.serialize();
}

View File

@ -44,12 +44,6 @@ export class Signature implements ISignature {
return new Signature(signature);
}
add(other: Signature): Signature {
const agg = this.value.clone();
agg.add(other.value);
return new Signature(agg);
}
verify(publicKey: PublicKey, message: Uint8Array): boolean {
return publicKey.value.verify(this.value, message);
}