File tree Expand file tree Collapse file tree
packages/react-native-quick-crypto/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,13 +2,7 @@ import { NitroModules } from 'react-native-nitro-modules';
22import type { DiffieHellman as DiffieHellmanInterface } from './specs/diffie-hellman.nitro' ;
33import { Buffer } from '@craftzdog/react-native-buffer' ;
44import { DH_GROUPS } from './dh-groups' ;
5-
6- function toArrayBufferExact ( buf : Buffer ) : ArrayBuffer {
7- return buf . buffer . slice (
8- buf . byteOffset ,
9- buf . byteOffset + buf . byteLength ,
10- ) as ArrayBuffer ;
11- }
5+ import { toArrayBuffer as toArrayBufferExact } from './utils/conversion' ;
126
137export class DiffieHellman {
148 private _hybrid : DiffieHellmanInterface ;
Original file line number Diff line number Diff line change 11import { NitroModules } from 'react-native-nitro-modules' ;
22import type { ECDH as ECDHInterface } from './specs/ecdh.nitro' ;
33import { Buffer } from '@craftzdog/react-native-buffer' ;
4+ import { toArrayBuffer as toArrayBufferExact } from './utils/conversion' ;
45
56const POINT_CONVERSION_COMPRESSED = 2 ;
67const POINT_CONVERSION_UNCOMPRESSED = 4 ;
78const POINT_CONVERSION_HYBRID = 6 ;
89
9- function toArrayBufferExact ( buf : Buffer ) : ArrayBuffer {
10- return buf . buffer . slice (
11- buf . byteOffset ,
12- buf . byteOffset + buf . byteLength ,
13- ) as ArrayBuffer ;
14- }
15-
1610export class ECDH {
1711 private static _convertKeyHybrid : ECDHInterface | undefined ;
1812 private static get convertKeyHybrid ( ) : ECDHInterface {
You can’t perform that action at this time.
0 commit comments