wppaste
WordPress

ParagonIE_Sodium_Core32_Ed25519

Source
wp-includes/sodium_compat/src/Core32/Ed25519.php:13
Class ParagonIE_Sodium_Core32_Ed25519

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Methods · 13

Source code

abstract class ParagonIE_Sodium_Core32_Ed25519 extends ParagonIE_Sodium_Core32_Curve25519{    const KEYPAIR_BYTES = 96;    const SEED_BYTES = 32;     /**     * @internal You should not use this directly from another application     *     * @return string (96 bytes)     * @throws Exception     * @throws SodiumException     * @throws TypeError     */    public static function keypair()    {        $seed = random_bytes(self::SEED_BYTES);        $pk = '';        $sk = '';        self::seed_keypair($pk, $sk, $seed);        return $sk . $pk;    }     /**     * @internal You should not use this directly from another application     *     * @param string $pk     * @param string $sk     * @param string $seed     * @return string     * @throws SodiumException     * @throws TypeError     */    public static function seed_keypair(&$pk, &$sk, $seed)    {        if (self::strlen($seed) !== self::SEED_BYTES) {            throw new RangeException('crypto_sign keypair seed must be 32 bytes long');        }         /** @var string $pk */        $pk = self::publickey_from_secretkey($seed);        $sk = $seed . $pk;        return $sk;    }     /**     * @internal You should not use this directly from another application     *     * @param string $keypair     * @return string     * @throws TypeError     */    public static function secretkey($keypair)    {        if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {            throw new RangeException('crypto_sign keypair must be 96 bytes long');        }        return self::substr($keypair, 0, 64);    }     /**     * @internal You should not use this directly from another application     *     * @param string $keypair     * @return string     * @throws RangeException     * @throws TypeError     */    public static function publickey($keypair)    {        if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {            throw new RangeException('crypto_sign keypair must be 96 bytes long');        }        return self::substr($keypair, 64, 32);    }     /**     * @internal You should not use this directly from another application     *     * @param string $sk     * @return string

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/sodium_compat/src/Core32/Ed25519.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.