rbsecp256k1 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::KeyPair
4
- ==================
5
-
6
- Secp256k1::KeyPair represents a public-private Secp256k1 key pair.
7
-
8
- Instance Methods
9
- ----------------
10
-
11
- #### public_key
12
-
13
- Returns the [PublicKey](public_key.md) part of this key pair.
14
-
15
- #### xonly_public_key
16
-
17
- Returns the [XOnlyPublicKey](xonly_public_key.md).
18
-
19
- #### private_key
20
-
21
- Returns the [PrivateKey](private_key.md) part of this key pair.
22
-
23
- #### ==(other)
24
-
25
- Returns `true` if the `other` has the same public and private key.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::KeyPair
4
+ ==================
5
+
6
+ Secp256k1::KeyPair represents a public-private Secp256k1 key pair.
7
+
8
+ Instance Methods
9
+ ----------------
10
+
11
+ #### public_key
12
+
13
+ Returns the [PublicKey](public_key.md) part of this key pair.
14
+
15
+ #### xonly_public_key
16
+
17
+ Returns the [XOnlyPublicKey](xonly_public_key.md).
18
+
19
+ #### private_key
20
+
21
+ Returns the [PrivateKey](private_key.md) part of this key pair.
22
+
23
+ #### ==(other)
24
+
25
+ Returns `true` if the `other` has the same public and private key.
@@ -1,25 +1,25 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::PrivateKey
4
- =====================
5
-
6
- Secp256k1::PrivateKey represents the private key part of a public-private key pair.
7
-
8
- Class Methods
9
- -------------
10
-
11
- #### from_data(private_key_data)
12
-
13
- Loads new private key from the given binary `private_key_data` string. Raises
14
- `Secp256k1::Error` if the given data is invalid.
15
-
16
- Instance Methods
17
- ----------------
18
-
19
- #### data
20
-
21
- Returns the binary private key data as a `String`.
22
-
23
- #### ==(other)
24
-
25
- Returns `true` if this private key matches `other`.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::PrivateKey
4
+ =====================
5
+
6
+ Secp256k1::PrivateKey represents the private key part of a public-private key pair.
7
+
8
+ Class Methods
9
+ -------------
10
+
11
+ #### from_data(private_key_data)
12
+
13
+ Loads new private key from the given binary `private_key_data` string. Raises
14
+ `Secp256k1::Error` if the given data is invalid.
15
+
16
+ Instance Methods
17
+ ----------------
18
+
19
+ #### data
20
+
21
+ Returns the binary private key data as a `String`.
22
+
23
+ #### ==(other)
24
+
25
+ Returns `true` if this private key matches `other`.
@@ -1,36 +1,36 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::PublicKey
4
- ====================
5
-
6
- Secp256k1::PublicKey represents the public key part of a public-private key pair.
7
-
8
- See: [KeyPair](key_pair.md)
9
-
10
- Class Methods
11
- -------------
12
-
13
- #### from_data(public_key_data)
14
-
15
- Parses compressed or uncompressed from binary string `public_key_data` and
16
- creates and returns a new public key from it. Raises a `Secp256k1::DeserializationError`
17
- if the given public key data is invalid.
18
-
19
- Instance Methods
20
- ----------------
21
-
22
- #### compressed
23
-
24
- Returns the binary compressed representation of this public key.
25
-
26
- #### uncompressed
27
-
28
- Returns the binary uncompressed representation of this public key.
29
-
30
- ### to_xonly
31
-
32
- Returns the `XOnlyPublicKey` equivalent of this key.
33
-
34
- #### ==(other)
35
-
36
- Return `true` if this public key matches `other`.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::PublicKey
4
+ ====================
5
+
6
+ Secp256k1::PublicKey represents the public key part of a public-private key pair.
7
+
8
+ See: [KeyPair](key_pair.md)
9
+
10
+ Class Methods
11
+ -------------
12
+
13
+ #### from_data(public_key_data)
14
+
15
+ Parses compressed or uncompressed from binary string `public_key_data` and
16
+ creates and returns a new public key from it. Raises a `Secp256k1::DeserializationError`
17
+ if the given public key data is invalid.
18
+
19
+ Instance Methods
20
+ ----------------
21
+
22
+ #### compressed
23
+
24
+ Returns the binary compressed representation of this public key.
25
+
26
+ #### uncompressed
27
+
28
+ Returns the binary uncompressed representation of this public key.
29
+
30
+ ### to_xonly
31
+
32
+ Returns the `XOnlyPublicKey` equivalent of this key.
33
+
34
+ #### ==(other)
35
+
36
+ Return `true` if this public key matches `other`.
@@ -1,30 +1,30 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::RecoverableSignature
4
- ===============================
5
-
6
- **Requires:** libsecp256k1 was build with recovery module.
7
-
8
- Secp256k1::RecoverableSignature represents a recoverable ECDSA signature
9
- signing the 32-byte SHA-256 hash of some data.
10
-
11
- Instance Methods
12
- ----------------
13
-
14
- #### compact
15
-
16
- Returns an array whose first element is the 64-byte compact signature as a
17
- binary string and whose second element is the integer recovery ID.
18
-
19
- #### recover_public_key
20
-
21
- Recovers the public key corresponding to the recoverable signature. Returns a
22
- [PublicKey](public_key.md).
23
-
24
- #### to_signature
25
-
26
- Converts a recoverable signature to a non-recoverable [Signature](signature.md) object.
27
-
28
- #### ==(other)
29
-
30
- Returns `true` if this recoverable signature matches `other`.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::RecoverableSignature
4
+ ===============================
5
+
6
+ **Requires:** libsecp256k1 was build with recovery module.
7
+
8
+ Secp256k1::RecoverableSignature represents a recoverable ECDSA signature
9
+ signing the 32-byte SHA-256 hash of some data.
10
+
11
+ Instance Methods
12
+ ----------------
13
+
14
+ #### compact
15
+
16
+ Returns an array whose first element is the 64-byte compact signature as a
17
+ binary string and whose second element is the integer recovery ID.
18
+
19
+ #### recover_public_key
20
+
21
+ Recovers the public key corresponding to the recoverable signature. Returns a
22
+ [PublicKey](public_key.md).
23
+
24
+ #### to_signature
25
+
26
+ Converts a recoverable signature to a non-recoverable [Signature](signature.md) object.
27
+
28
+ #### ==(other)
29
+
30
+ Returns `true` if this recoverable signature matches `other`.
@@ -1,30 +1,34 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::SchnorrSignature
4
- ===========================
5
-
6
- Secp256k1::SchnorrSignature represents an Schnorr signature signing a 32-byte message.
7
-
8
- Class Methods
9
- -------------
10
-
11
- #### from_data(schnorr_sig_data)
12
-
13
- Loads a new Schnorr signature from the given 64-byte binary
14
- `schnorr_sig_data`. Does not perform any validation on the loaded data.
15
-
16
- Instance Methods
17
- ----------------
18
-
19
- #### serialized
20
-
21
- Returns the 64-byte binary `String` of the serialized Schnorr signature.
22
-
23
- #### verify(msg, xonly_pubkey)
24
-
25
- Returns `true` if the schnorr signature is a valid signing of `msg` with the
26
- private key for `xonly_pubkey`, `false` otherwise.
27
-
28
- #### ==(other)
29
-
30
- Returns `true` if this signature matches `other`.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::SchnorrSignature
4
+ ===========================
5
+
6
+ Secp256k1::SchnorrSignature represents a 64-byte Schnorr signature of a message
7
+ of any byte length, including zero.
8
+
9
+ Class Methods
10
+ -------------
11
+
12
+ #### from_data(schnorr_sig_data)
13
+
14
+ Loads a new Schnorr signature from the given 64-byte binary
15
+ `schnorr_sig_data`. Does not perform any validation on the loaded data.
16
+
17
+ Instance Methods
18
+ ----------------
19
+
20
+ #### serialized
21
+
22
+ Returns the 64-byte binary `String` of the serialized Schnorr signature.
23
+
24
+ #### verify(msg, xonly_pubkey)
25
+
26
+ Returns `true` if the schnorr signature is a valid signing of `msg` with the
27
+ private key for `xonly_pubkey`, `false` otherwise.
28
+
29
+ `msg` must be a Ruby `String` containing the exact bytes passed to signing.
30
+ It may have any byte length, including zero. No implicit hashing is performed.
31
+
32
+ #### ==(other)
33
+
34
+ Returns `true` if this signature matches `other`.
@@ -1,24 +1,24 @@
1
- [Index](index.md)
2
-
3
- Secp256k1
4
- =========
5
-
6
- Secp256k1 is the top-level module for this library.
7
-
8
- Class Methods
9
- -------------
10
-
11
- #### have_recovery?
12
-
13
- Returns `true` if the recovery module was built with libsecp256k1, `false`
14
- otherwise.
15
-
16
- #### have_ecdh?
17
-
18
- Returns `true` if the EC Diffie-Hellman module was built with libsecp256k1,
19
- `false` otherwise.
20
-
21
- #### have_schnorr?
22
-
23
- Returns `true` if the Schnorr signature module was built with libsecp256k1,
24
- `false` otherwise.
1
+ [Index](index.md)
2
+
3
+ Secp256k1
4
+ =========
5
+
6
+ Secp256k1 is the top-level module for this library.
7
+
8
+ Class Methods
9
+ -------------
10
+
11
+ #### have_recovery?
12
+
13
+ Returns `true` if the recovery module was built with libsecp256k1, `false`
14
+ otherwise.
15
+
16
+ #### have_ecdh?
17
+
18
+ Returns `true` if the EC Diffie-Hellman module was built with libsecp256k1,
19
+ `false` otherwise.
20
+
21
+ #### have_schnorr?
22
+
23
+ Returns `true` if the Schnorr signature module was built with libsecp256k1,
24
+ `false` otherwise.
@@ -1,14 +1,14 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::SharedSecret
4
- =======================
5
-
6
- Secp256k1::SharedSecret represents a 32-byte shared secret computed from a
7
- public key (point) and private key (scalar).
8
-
9
- Instance Methods
10
- ----------------
11
-
12
- #### data
13
-
14
- Binary string containing the 32-byte shared secret.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::SharedSecret
4
+ =======================
5
+
6
+ Secp256k1::SharedSecret represents a 32-byte shared secret computed from a
7
+ public key (point) and private key (scalar).
8
+
9
+ Instance Methods
10
+ ----------------
11
+
12
+ #### data
13
+
14
+ Binary string containing the 32-byte shared secret.
@@ -1,42 +1,42 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::Signature
4
- ====================
5
-
6
- Secp256k1::Signature represents an ECDSA signature signing the 32-byte SHA-256
7
- hash of some data.
8
-
9
- Class Methods
10
- -------------
11
-
12
- #### from_compact(compact_signature)
13
-
14
- Parses a signature from binary string `compact_signature`. Raises a
15
- `Secp256k1::DeserializationError` if the signature data is invalid.
16
-
17
- #### from_der_encoded(der_encoded_signature)
18
-
19
- Parses a signature from binary string `der_encoded_signature`. Raises a
20
- `Secp256k1::DeserializationError` if the signature data is invalid.
21
-
22
- Instance Methods
23
- ----------------
24
-
25
- #### der_encoded
26
-
27
- Returns the DER encoded representation of this signature.
28
-
29
- #### compact
30
-
31
- Returns the compact 64-byte representation of this signature.
32
-
33
- #### normalized
34
-
35
- Returns an array containing two elements. The first is a Boolean indicating
36
- whether or not the signature was normalized, false if it was already in lower-S
37
- normal form. The second element is a `Signature` containing the normalized
38
- signature object.
39
-
40
- #### ==(other)
41
-
42
- Returns `true` if this signature matches `other`.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::Signature
4
+ ====================
5
+
6
+ Secp256k1::Signature represents an ECDSA signature signing the 32-byte SHA-256
7
+ hash of some data.
8
+
9
+ Class Methods
10
+ -------------
11
+
12
+ #### from_compact(compact_signature)
13
+
14
+ Parses a signature from binary string `compact_signature`. Raises a
15
+ `Secp256k1::DeserializationError` if the signature data is invalid.
16
+
17
+ #### from_der_encoded(der_encoded_signature)
18
+
19
+ Parses a signature from binary string `der_encoded_signature`. Raises a
20
+ `Secp256k1::DeserializationError` if the signature data is invalid.
21
+
22
+ Instance Methods
23
+ ----------------
24
+
25
+ #### der_encoded
26
+
27
+ Returns the DER encoded representation of this signature.
28
+
29
+ #### compact
30
+
31
+ Returns the compact 64-byte representation of this signature.
32
+
33
+ #### normalized
34
+
35
+ Returns an array containing two elements. The first is a Boolean indicating
36
+ whether or not the signature was normalized, false if it was already in lower-S
37
+ normal form. The second element is a `Signature` containing the normalized
38
+ signature object.
39
+
40
+ #### ==(other)
41
+
42
+ Returns `true` if this signature matches `other`.
@@ -1,17 +1,17 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::Util
4
- ===============
5
-
6
- Secp256k1::Util in a module containing generally useful methods for using the library.
7
-
8
- Class Methods
9
- -------------
10
-
11
- #### bin_to_hex(binary_data)
12
-
13
- Returns the hexadecimal string representation of `binary_data`
14
-
15
- #### hex_to_bin(hex_string)
16
-
17
- Returns the binary string representation of `hex_string`
1
+ [Index](index.md)
2
+
3
+ Secp256k1::Util
4
+ ===============
5
+
6
+ Secp256k1::Util in a module containing generally useful methods for using the library.
7
+
8
+ Class Methods
9
+ -------------
10
+
11
+ #### bin_to_hex(binary_data)
12
+
13
+ Returns the hexadecimal string representation of `binary_data`
14
+
15
+ #### hex_to_bin(hex_string)
16
+
17
+ Returns the binary string representation of `hex_string`
@@ -1,29 +1,29 @@
1
- [Index](index.md)
2
-
3
- Secp256k1::XOnlyPublicKey
4
- =========================
5
-
6
- Secp256k1::XOnlyPublicKey represents an x-only public key version of a public key.
7
-
8
- See: [KeyPair](key_pair.md)
9
-
10
- Class Methods
11
- -------------
12
-
13
- #### from_data(xonly_public_key_serialized)
14
-
15
- Parses the 32-byte serialized binary `xonly_public_key_serialized` and creates
16
- and returns a new x-only public key from it. Raises a
17
- `Secp256k1::DeserializationError` if the given x-only public key data is
18
- invalid.
19
-
20
- Instance Methods
21
- ----------------
22
-
23
- #### serialized
24
-
25
- Serializes the `XOnlyPublicKey` into a 32-byte binary `String`.
26
-
27
- #### ==(other)
28
-
29
- Return `true` if this x-only public key matches `other`.
1
+ [Index](index.md)
2
+
3
+ Secp256k1::XOnlyPublicKey
4
+ =========================
5
+
6
+ Secp256k1::XOnlyPublicKey represents an x-only public key version of a public key.
7
+
8
+ See: [KeyPair](key_pair.md)
9
+
10
+ Class Methods
11
+ -------------
12
+
13
+ #### from_data(xonly_public_key_serialized)
14
+
15
+ Parses the 32-byte serialized binary `xonly_public_key_serialized` and creates
16
+ and returns a new x-only public key from it. Raises a
17
+ `Secp256k1::DeserializationError` if the given x-only public key data is
18
+ invalid.
19
+
20
+ Instance Methods
21
+ ----------------
22
+
23
+ #### serialized
24
+
25
+ Serializes the `XOnlyPublicKey` into a 32-byte binary `String`.
26
+
27
+ #### ==(other)
28
+
29
+ Return `true` if this x-only public key matches `other`.