equal
deleted
inserted
replaced
59 $ic |
59 $ic |
60 ), |
60 ), |
61 $message |
61 $message |
62 ); |
62 ); |
63 } |
63 } |
|
64 |
|
65 /** |
|
66 * @internal You should not use this directly from another application |
|
67 * |
|
68 * @param string $message |
|
69 * @param string $nonce |
|
70 * @param string $key |
|
71 * @param string $ic |
|
72 * @return string |
|
73 * @throws SodiumException |
|
74 * @throws TypeError |
|
75 */ |
|
76 public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '') |
|
77 { |
|
78 return self::encryptBytes( |
|
79 new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx( |
|
80 self::hChaCha20(self::substr($nonce, 0, 16), $key), |
|
81 "\x00\x00\x00\x00" . self::substr($nonce, 16, 8), |
|
82 $ic |
|
83 ), |
|
84 $message |
|
85 ); |
|
86 } |
64 } |
87 } |