deno.land / std@0.166.0 / node / _crypto / crypto_browserify / public_encrypt / with_public.js

with_public.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.// Copyright 2017 Calvin Metcalf. All rights reserved. MIT license.
import { BN } from "../bn.js/bn.js";import { Buffer } from "../../../buffer.ts";
export function withPublic(paddedMsg, key) { return Buffer.from( paddedMsg .toRed(BN.mont(key.modulus)) .redPow(new BN(key.publicExponent)) .fromRed() .toArray(), );}
std

Version Info

Tagged at
a year ago