Class: TonClient::Crypto
- Includes:
- CommonInstanceHelpers
- Defined in:
- lib/ton-client-ruby/Client/Crypto.rb
Constant Summary collapse
- MODULE =
self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#core ⇒ Object
readonly
Returns the value of attribute core.
Instance Method Summary collapse
-
#chacha20(payload, &block) ⇒ Object
INPUT: ParamsOfChaCha20 data: String - # # Source data to be encrypted or decrypted.
-
#convert_public_key_to_ton_safe_format(payload, &block) ⇒ Object
INPUT: ParamsOfConvertPublicKeyToTonSafeFormat public_key: String - # # Public key - 64 symbols hex string RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat ton_public_key: String - # # Public key represented in TON safe format.
-
#factorize(payload, &block) ⇒ Object
INPUT: ParamsOfFactorize composite: String - # # Hexadecimal representation of u64 composite number.
-
#generate_random_bytes(payload, &block) ⇒ Object
INPUT: ParamsOfGenerateRandomBytes length: Number - # # Size of random byte array.
-
#generate_random_sign_keys(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#get_signing_box(payload, &block) ⇒ Object
INPUT: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#hdkey_derive_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key child_index: Number - # # Child index (see BIP-0032) hardened: Boolean - # # Indicates the derivation of hardened/not-hardened key (see BIP-0032) RESPONSE: ResultOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key.
-
#hdkey_derive_from_xprv_path(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrvPath xprv: String - # # Serialized extended private key path: String - # # Derivation path, for instance “m/44’/396’/0’/0/0” RESPONSE: ResultOfHDKeyDeriveFromXPrvPath xprv: String - # # Derived serialized extended private key.
-
#hdkey_public_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyPublicFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeyPublicFromXPrv public: String - # # Public key - 64 symbols hex string.
-
#hdkey_secret_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeySecretFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeySecretFromXPrv secret: String - # # Private key - 64 symbols hex string.
-
#hdkey_xprv_from_mnemonic(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyXPrvFromMnemonic phrase: String - # # String with seed phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfHDKeyXPrvFromMnemonic xprv: String - # # Serialized extended master private key.
-
#initialize(context: Context.new, core: TonClient::TonBinding) ⇒ Crypto
constructor
A new instance of Crypto.
-
#mnemonic_derive_sign_keys(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicDeriveSignKeys phrase: String - # # Phrase path: String<Optional> - # # Derivation path, for instance “m/44’/396’/0’/0/0” dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#mnemonic_from_entropy(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromEntropy entropy: String - # # Entropy bytes.
-
#mnemonic_from_random(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromRandom dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromRandom phrase: String - # # String of mnemonic words.
-
#mnemonic_verify(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicVerify phrase: String - # # Phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: ResultOfMnemonicVerify valid: Boolean - # # Flag indicating if the mnemonic is valid or not.
-
#mnemonic_words(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicWords dictionary: MnemonicDictionary - # # Dictionary identifier RESPONSE: ResultOfMnemonicWords words: String - # # The list of mnemonic words.
-
#modular_power(payload, &block) ⇒ Object
INPUT: ParamsOfModularPower base: String - # # ‘base` argument of calculation.
-
#nacl_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBox decrypted: String - # # Data that must be encrypted encoded in ‘base64`.
-
#nacl_box_keypair(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_box_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxOpen encrypted: String - # # Data that must be decrypted.
-
#nacl_secret_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBox decrypted: String - # # Data that must be encrypted.
-
#nacl_secret_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBoxOpen encrypted: String - # # Data that must be decrypted.
-
#nacl_sign(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in ‘base64`.
-
#nacl_sign_detached(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in ‘base64`.
-
#nacl_sign_detached_verify(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignDetachedVerify unsigned: String - # # Unsigned data that must be verified.
-
#nacl_sign_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_sign_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignOpen signed: String - # # Signed data that must be unsigned.
-
#register_signing_box(&block) ⇒ Object
RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#remove_signing_box(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#scrypt(payload, &block) ⇒ Object
INPUT: ParamsOfScrypt password: String - # # The password bytes to be hashed.
-
#sha256(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation.
-
#sha512(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation.
-
#sign(payload, &block) ⇒ Object
INPUT: ParamsOfSign unsigned: String - # # Data that must be signed encoded in ‘base64`.
-
#signing_box_get_public_key(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#signing_box_sign(payload, &block) ⇒ Object
INPUT: ParamsOfSigningBoxSign signing_box: SigningBoxHandle - # # Signing Box handle.
-
#ton_crc16(payload, &block) ⇒ Object
INPUT: ParamsOfTonCrc16 data: String - # # Input data for CRC calculation.
-
#verify_signature(payload, &block) ⇒ Object
INPUT: ParamsOfVerifySignature signed: String - # # Signed data that must be verified encoded in ‘base64`.
Methods included from CommonInstanceHelpers
#base64?, #encode_to_base64, #full_method_name
Constructor Details
#initialize(context: Context.new, core: TonClient::TonBinding) ⇒ Crypto
Returns a new instance of Crypto.
9 10 11 12 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 9 def initialize(context: Context.new, core: TonClient::TonBinding) @context = context @core = core end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 6 def context @context end |
#core ⇒ Object (readonly)
Returns the value of attribute core.
6 7 8 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 6 def core @core end |
Instance Method Details
#chacha20(payload, &block) ⇒ Object
INPUT: ParamsOfChaCha20 data: String - # # Source data to be encrypted or decrypted. # # Must be encoded with ‘base64`. key: String - # # 256-bit key. # # Must be encoded with `hex`. nonce: String - # # 96-bit nonce. # # Must be encoded with `hex`. RESPONSE: ResultOfChaCha20 data: String - # # Encrypted/decrypted data. # # Encoded with `base64`.
315 316 317 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 315 def chacha20(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#convert_public_key_to_ton_safe_format(payload, &block) ⇒ Object
INPUT: ParamsOfConvertPublicKeyToTonSafeFormat public_key: String - # # Public key - 64 symbols hex string RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat ton_public_key: String - # # Public key represented in TON safe format.
52 53 54 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 52 def convert_public_key_to_ton_safe_format(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#factorize(payload, &block) ⇒ Object
INPUT: ParamsOfFactorize composite: String - # # Hexadecimal representation of u64 composite number. RESPONSE: ResultOfFactorize factors: Array - # # Two factors of composite or empty if composite can’t be factorized.
18 19 20 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 18 def factorize(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#generate_random_bytes(payload, &block) ⇒ Object
INPUT: ParamsOfGenerateRandomBytes length: Number - # # Size of random byte array. RESPONSE: ResultOfGenerateRandomBytes bytes: String - # # Generated bytes encoded in ‘base64`.
44 45 46 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 44 def generate_random_bytes(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#generate_random_sign_keys(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
59 60 61 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 59 def generate_random_sign_keys(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#get_signing_box(payload, &block) ⇒ Object
INPUT: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
330 331 332 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 330 def get_signing_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_derive_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key child_index: Number - # # Child index (see BIP-0032) hardened: Boolean - # # Indicates the derivation of hardened/not-hardened key (see BIP-0032) RESPONSE: ResultOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key
280 281 282 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 280 def hdkey_derive_from_xprv(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_derive_from_xprv_path(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrvPath xprv: String - # # Serialized extended private key path: String - # # Derivation path, for instance “m/44’/396’/0’/0/0” RESPONSE: ResultOfHDKeyDeriveFromXPrvPath xprv: String - # # Derived serialized extended private key
289 290 291 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 289 def hdkey_derive_from_xprv_path(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_public_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyPublicFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeyPublicFromXPrv public: String - # # Public key - 64 symbols hex string
305 306 307 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 305 def hdkey_public_from_xprv(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_secret_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeySecretFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeySecretFromXPrv secret: String - # # Private key - 64 symbols hex string
297 298 299 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 297 def hdkey_secret_from_xprv(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_xprv_from_mnemonic(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyXPrvFromMnemonic phrase: String - # # String with seed phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfHDKeyXPrvFromMnemonic xprv: String - # # Serialized extended master private key
270 271 272 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 270 def hdkey_xprv_from_mnemonic(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_derive_sign_keys(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicDeriveSignKeys phrase: String - # # Phrase path: String<Optional> - # # Derivation path, for instance “m/44’/396’/0’/0/0” dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
260 261 262 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 260 def mnemonic_derive_sign_keys(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_from_entropy(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromEntropy entropy: String - # # Entropy bytes. # # Hex encoded. dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromEntropy phrase: String - # # Phrase
238 239 240 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 238 def mnemonic_from_entropy(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_from_random(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromRandom dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromRandom phrase: String - # # String of mnemonic words
228 229 230 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 228 def mnemonic_from_random(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_verify(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicVerify phrase: String - # # Phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: ResultOfMnemonicVerify valid: Boolean - # # Flag indicating if the mnemonic is valid or not
248 249 250 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 248 def mnemonic_verify(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_words(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicWords dictionary: MnemonicDictionary - # # Dictionary identifier RESPONSE: ResultOfMnemonicWords words: String - # # The list of mnemonic words
219 220 221 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 219 def mnemonic_words(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#modular_power(payload, &block) ⇒ Object
INPUT: ParamsOfModularPower base: String - # # ‘base` argument of calculation. exponent: String - # # `exponent` argument of calculation. modulus: String - # # `modulus` argument of calculation. RESPONSE: ResultOfModularPower modular_power: String - # # Result of modular exponentiation
28 29 30 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 28 def modular_power(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBox decrypted: String - # # Data that must be encrypted encoded in ‘base64`. nonce: String - # # Nonce, encoded in `hex` their_public: String - # # Receiver’s public key - unprefixed 0-padded to 64 symbols hex string secret: String - # # Sender’s private key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBox encrypted: String - # # Encrypted data encoded in ‘base64`.
180 181 182 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 180 def nacl_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box_keypair(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
160 161 162 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 160 def nacl_box_keypair(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#nacl_box_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
169 170 171 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 169 def nacl_box_keypair_from_secret_key(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxOpen encrypted: String - # # Data that must be decrypted. # # Encoded with ‘base64`. nonce: String - their_public: String - # # Sender’s public key - unprefixed 0-padded to 64 symbols hex string secret: String - # # Receiver’s private key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBoxOpen decrypted: String - # # Decrypted data encoded in ‘base64`.
191 192 193 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 191 def nacl_box_open(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_secret_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBox decrypted: String - # # Data that must be encrypted. # # Encoded with ‘base64`. nonce: String - # # Nonce in `hex` key: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBox encrypted: String - # # Encrypted data encoded in `base64`.
201 202 203 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 201 def nacl_secret_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_secret_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBoxOpen encrypted: String - # # Data that must be decrypted. # # Encoded with ‘base64`. nonce: String - # # Nonce in `hex` key: String - # # Public key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBoxOpen decrypted: String - # # Decrypted data encoded in `base64`.
211 212 213 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 211 def nacl_secret_box_open(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in ‘base64`. secret: String - # # Signer’s secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclSign signed: String - # # Signed data, encoded in ‘base64`.
125 126 127 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 125 def nacl_sign(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_detached(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in ‘base64`. secret: String - # # Signer’s secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclSignDetached signature: String - # # Signature encoded in ‘hex`.
143 144 145 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 143 def nacl_sign_detached(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_detached_verify(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignDetachedVerify unsigned: String - # # Unsigned data that must be verified. # # Encoded with ‘base64`. signature: String - # # Signature that must be verified. # # Encoded with `hex`. public: String - # # Signer’s public key - unprefixed 0-padded to 64 symbols hex string. RESPONSE: ResultOfNaclSignDetachedVerify succeeded: Boolean - # # ‘true` if verification succeeded or `false` if it failed
153 154 155 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 153 def nacl_sign_detached_verify(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
116 117 118 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 116 def nacl_sign_keypair_from_secret_key(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignOpen signed: String - # # Signed data that must be unsigned. # # Encoded with ‘base64`. public: String - # # Signer’s public key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclSignOpen unsigned: String - # # Unsigned data, encoded in ‘base64`.
134 135 136 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 134 def nacl_sign_open(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#register_signing_box(&block) ⇒ Object
RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
321 322 323 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 321 def register_signing_box(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#remove_signing_box(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
353 354 355 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 353 def remove_signing_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#scrypt(payload, &block) ⇒ Object
INPUT: ParamsOfScrypt password: String - # # The password bytes to be hashed. Must be encoded with ‘base64`. salt: String - # # Salt bytes that modify the hash to protect against Rainbow table attacks. Must be encoded with `base64`. log_n: Number - # # CPU/memory cost parameter r: Number - # # The block size parameter, which fine-tunes sequential memory read size and performance. p: Number - # # Parallelization parameter. dk_len: Number - # # Intended output length in octets of the derived key. RESPONSE: ResultOfScrypt key: String - # # Derived key. # # Encoded with `hex`.
107 108 109 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 107 def scrypt(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sha256(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation. # # Encoded with ‘base64`. RESPONSE: ResultOfHash hash: String - # # Hash of input `data`. # # Encoded with ’hex’.
86 87 88 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 86 def sha256(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sha512(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation. # # Encoded with ‘base64`. RESPONSE: ResultOfHash hash: String - # # Hash of input `data`. # # Encoded with ’hex’.
94 95 96 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 94 def sha512(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sign(payload, &block) ⇒ Object
INPUT: ParamsOfSign unsigned: String - # # Data that must be signed encoded in ‘base64`. keys: KeyPair - # # Sign keys. RESPONSE: ResultOfSign signed: String - # # Signed data combined with signature encoded in `base64`. signature: String - # # Signature encoded in `hex`.
69 70 71 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 69 def sign(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#signing_box_get_public_key(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box. RESPONSE: ResultOfSigningBoxGetPublicKey pubkey: String - # # Public key of signing box. # # Encoded with hex
338 339 340 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 338 def signing_box_get_public_key(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#signing_box_sign(payload, &block) ⇒ Object
INPUT: ParamsOfSigningBoxSign signing_box: SigningBoxHandle - # # Signing Box handle. unsigned: String - # # Unsigned user data. # # Must be encoded with ‘base64`. RESPONSE: ResultOfSigningBoxSign signature: String - # # Data signature. # # Encoded with `hex`.
347 348 349 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 347 def signing_box_sign(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#ton_crc16(payload, &block) ⇒ Object
INPUT: ParamsOfTonCrc16 data: String - # # Input data for CRC calculation. # # Encoded with ‘base64`. RESPONSE: ResultOfTonCrc16 crc: Number - # # Calculated CRC for input data.
36 37 38 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 36 def ton_crc16(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#verify_signature(payload, &block) ⇒ Object
INPUT: ParamsOfVerifySignature signed: String - # # Signed data that must be verified encoded in ‘base64`. public: String - # # Signer’s public key - 64 symbols hex string RESPONSE: ResultOfVerifySignature unsigned: String - # # Unsigned data encoded in ‘base64`.
78 79 80 |
# File 'lib/ton-client-ruby/Client/Crypto.rb', line 78 def verify_signature(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |