Skip to content

Commit

Permalink
Merge branch 'new-exports' into 'master'
Browse files Browse the repository at this point in the history
Export aes functions

See merge request hive/dhive!43
  • Loading branch information
feruzm committed Nov 9, 2023
2 parents 6a7898c + a81d46e commit 028cedf
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions dist/dhive.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,18 @@ declare module 'dhive/helpers/aes' {
import { PrivateKey, PublicKey } from 'dhive/crypto';
export const encrypt: (private_key: PrivateKey, public_key: PublicKey, message: Buffer, nonce?: string) => any;
export const decrypt: (private_key: PrivateKey, public_key: PublicKey, nonce: any, message: any, checksum: number) => any;
/**
* This method does not use a checksum, the returned data must be validated some other way.
* @arg {string|Buffer} ciphertext - binary format
* @return {Buffer} the decrypted message
*/
export const cryptoJsDecrypt: (message: Buffer, tag: any, iv: any) => Buffer;
/**
* This method does not use a checksum, the returned data must be validated some other way.
* @arg {string|Buffer} plaintext - binary format
* @return {Buffer} binary
*/
export const cryptoJsEncrypt: (message: Buffer, tag: any, iv: any) => Buffer;

}
declare module 'dhive/memo' {
Expand Down
2 changes: 1 addition & 1 deletion dist/dhive.js

Large diffs are not rendered by default.

Binary file modified dist/dhive.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/dhive.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hiveio/dhive",
"version": "1.2.7",
"version": "1.2.8",
"description": "Hive blockchain RPC client library",
"author": "hive-network",
"license": "BSD-3-Clause-No-Military-License",
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/aes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const crypt = (
* @arg {string|Buffer} ciphertext - binary format
* @return {Buffer} the decrypted message
*/
const cryptoJsDecrypt = (message: Buffer, tag, iv): Buffer => {
export const cryptoJsDecrypt = (message: Buffer, tag, iv): Buffer => {
assert(message, 'Missing cipher text')
let messageBuffer = message
const decipher = createDecipheriv('aes-256-cbc', tag, iv)
Expand All @@ -96,7 +96,7 @@ const cryptoJsDecrypt = (message: Buffer, tag, iv): Buffer => {
* @arg {string|Buffer} plaintext - binary format
* @return {Buffer} binary
*/
const cryptoJsEncrypt = (message: Buffer, tag, iv): Buffer => {
export const cryptoJsEncrypt = (message: Buffer, tag, iv): Buffer => {
assert(message, 'Missing plain text')
let messageBuffer = message
const cipher = createCipheriv('aes-256-cbc', tag, iv)
Expand Down

0 comments on commit 028cedf

Please sign in to comment.