PHP8 sodium_crypto_core_ristretto255_scalar_sub

2024-03-16 10:10 更新

(PHP 8 >= 8.1.0)

sodium_crypto_core_ristretto255_scalar_sub — 減去標(biāo)量值

說明

sodium_crypto_core_ristretto255_scalar_sub(string $x, string $y): string

從中減去標(biāo)量。 從 libsodium 1.0.18 開始可用。yx

警告

本函數(shù)還未編寫文檔,僅有參數(shù)列表。

參數(shù) 

x

標(biāo)量,表示 X 坐標(biāo)。

y

標(biāo)量,表示 Y 坐標(biāo)。

返回值 

返回一個(gè) 32 字節(jié)的隨機(jī)字符串。

示例 

示例 #1 sodium_crypto_core_ristretto255_scalar_sub() example

<?php

$foo = sodium_crypto_core_ristretto255_scalar_random();
$bar = sodium_crypto_core_ristretto255_scalar_random();

$value = sodium_crypto_core_ristretto255_scalar_add($foo, $bar);
$value = sodium_crypto_core_ristretto255_scalar_sub($value, $bar);

var_dump(hash_equals($foo, $value));
?>

以上示例會(huì)輸出:

bool(true)

參見 

  • sodium_crypto_core_ristretto255_scalar_random() - 生成一個(gè)隨機(jī)鍵
  • sodium_crypto_core_ristretto255_scalar_add() - 添加標(biāo)量值


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)