@Test void testEncodedBytes() { KeyPair kp = SECP256K1.KeyPair.random(); Signature sig = SECP256K1.sign(Bytes.of(1, 2, 3), kp); assertEquals(65, sig.bytes().size()); assertTrue(sig.bytes().get(64) <= 3 && sig.bytes().get(64) >= 0); }
public static Signature sign(byte[] data, KeyPair keyPair) { return signHashed(keccak256(data), keyPair); }
SECP256K1 { public static Signature sign(byte[] data, KeyPair keyPair) { return signHashed(keccak256(data), keyPair); } }
SECP256K1 { public static Signature sign(byte[] data, KeyPair keyPair) { return signHashed(keccak256(data), keyPair); } private  SECP256K1(); }
SECP256K1 { public static Signature sign(byte[] data, KeyPair keyPair) { return signHashed(keccak256(data), keyPair); } private  SECP256K1(); static Signature sign(byte[] data, KeyPair keyPair); static Signature sign(Bytes data, KeyPair keyPair); static Signature signHashed(byte[] hash, KeyPair keyPair); static Signature signHashed(Bytes32 hash, KeyPair keyPair); static boolean verify(byte[] data, Signature signature, PublicKey publicKey); static boolean verify(Bytes data, Signature signature, PublicKey publicKey); static boolean verifyHashed(Bytes32 hash, Signature signature, PublicKey publicKey); static boolean verifyHashed(byte[] hash, Signature signature, PublicKey publicKey); static Bytes32 calculateKeyAgreement(SecretKey privKey, PublicKey theirPubKey); }
SECP256K1 { public static Signature sign(byte[] data, KeyPair keyPair) { return signHashed(keccak256(data), keyPair); } private  SECP256K1(); static Signature sign(byte[] data, KeyPair keyPair); static Signature sign(Bytes data, KeyPair keyPair); static Signature signHashed(byte[] hash, KeyPair keyPair); static Signature signHashed(Bytes32 hash, KeyPair keyPair); static boolean verify(byte[] data, Signature signature, PublicKey publicKey); static boolean verify(Bytes data, Signature signature, PublicKey publicKey); static boolean verifyHashed(Bytes32 hash, Signature signature, PublicKey publicKey); static boolean verifyHashed(byte[] hash, Signature signature, PublicKey publicKey); static Bytes32 calculateKeyAgreement(SecretKey privKey, PublicKey theirPubKey);  }