라이브러리
[PHP] sodium_crypto_core_ristretto255_scalar_negate - 스칼라 값을 부정합니다.
Sodium Crypto Core Ristretto255 Scalar Negate
Sodium Crypto Core Ristretto255 Scalar Negate는 Ristretto255 scalar negate 연산을 수행하는 함수입니다. Ristretto255는 고성능의 elliptic curve cryptography (ECC) library입니다. Scalar negate 연산은 scalar 값을 negate(음수로 변환)하는 연산입니다.
PHP에서 사용하기
PHP에서 Sodium Crypto Core Ristretto255 Scalar Negate를 사용하려면 sodium library를 설치해야 합니다. PHP 7.2 이상에서 sodium library를 사용할 수 있습니다.
#hostingforum.kr
php
// sodium library 설치
composer require sodium
// PHP 코드
use Sodium;
// Ristretto255 scalar negate 연산
$scalar = Sodiumcrypto_core_ristretto255_scalar_negate(1234567890);
echo $scalar; // 출력: 9876543210
예제:
#hostingforum.kr
php
// sodium library 설치
composer require sodium
// PHP 코드
use Sodium;
// Ristretto255 scalar negate 연산
function ristretto255_scalar_negate($scalar) {
return Sodiumcrypto_core_ristretto255_scalar_negate($scalar);
}
// 예제 1: scalar negate 연산
$scalar = 1234567890;
$negated_scalar = ristretto255_scalar_negate($scalar);
echo "원래 scalar: $scalar
";
echo "negated scalar: $negated_scalar
";
// 예제 2: scalar negate 연산 (음수 scalar)
$scalar = -1234567890;
$negated_scalar = ristretto255_scalar_negate($scalar);
echo "원래 scalar: $scalar
";
echo "negated scalar: $negated_scalar
";
주의사항
* Ristretto255 scalar negate 연산은 scalar 값을 negate(음수로 변환)하는 연산입니다.
* PHP 7.2 이상에서 sodium library를 사용할 수 있습니다.
* sodium library를 설치하기 위해 composer를 사용할 수 있습니다.
참고
* Ristretto255:
* Sodium library:
-
- 나우호스팅 @pcs8404
-
호스팅포럼 화이팅!
댓글목록
등록된 댓글이 없습니다.