chore: upgrade eslint and prettier (#2376)
* chore: upgrade eslint and prettier * chore: add restrict-template-expressions
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { PkcKeyPair } from '../Types'
|
||||
import { PkcKeyPair, SodiumTag } from '../Types'
|
||||
import { Base64String } from '../Types/Base64String'
|
||||
import { Base64URLSafeString } from '../Types/Base64URLSafeString'
|
||||
import { HexString } from '../Types/HexString'
|
||||
import { SodiumConstant } from '../Types/SodiumConstant'
|
||||
import { StreamDecryptor } from '../Types/StreamDecryptor'
|
||||
import { StreamEncryptor } from '../Types/StreamEncryptor'
|
||||
import { Utf8String } from '../Types/Utf8String'
|
||||
@@ -122,7 +121,7 @@ export interface PureCryptoInterface {
|
||||
encryptor: StreamEncryptor,
|
||||
plainBuffer: Uint8Array,
|
||||
assocData: Utf8String,
|
||||
tag?: SodiumConstant,
|
||||
tag?: SodiumTag,
|
||||
): Uint8Array
|
||||
|
||||
xchacha20StreamInitDecryptor(header: Base64String, key: HexString): StreamDecryptor
|
||||
@@ -131,7 +130,7 @@ export interface PureCryptoInterface {
|
||||
decryptor: StreamDecryptor,
|
||||
encryptedBuffer: Uint8Array,
|
||||
assocData: Utf8String,
|
||||
): { message: Uint8Array; tag: SodiumConstant } | false
|
||||
): { message: Uint8Array; tag: SodiumTag } | false
|
||||
|
||||
sodiumCryptoBoxEasyEncrypt(
|
||||
message: Utf8String,
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
export enum SodiumConstant {
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_STATEBYTES = 52,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES = 17,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES = 24,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES = 32,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = 0,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL = 1,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = 2,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = 3,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX = 0x3fffffff80,
|
||||
crypto_box_SEEDBYTES = 32,
|
||||
crypto_sign_SEEDBYTES = 32,
|
||||
crypto_generichash_KEYBYTES = 32,
|
||||
export const SodiumConstant = {
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_STATEBYTES: 52,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES: 17,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES: 24,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES: 32,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX: 0x3fffffff80,
|
||||
crypto_box_SEEDBYTES: 32,
|
||||
crypto_sign_SEEDBYTES: 32,
|
||||
crypto_generichash_KEYBYTES: 32,
|
||||
}
|
||||
|
||||
6
packages/sncrypto-common/src/Types/SodiumTag.ts
Normal file
6
packages/sncrypto-common/src/Types/SodiumTag.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export enum SodiumTag {
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = 0,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL = 1,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = 2,
|
||||
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = 3,
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SodiumConstant } from './SodiumConstant'
|
||||
import { SodiumTag } from './SodiumTag'
|
||||
|
||||
export type StreamDecryptorResult = {
|
||||
message: Uint8Array
|
||||
tag: SodiumConstant
|
||||
tag: SodiumTag
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
export * from './Base64String'
|
||||
export * from './Base64URLSafeString'
|
||||
export * from './HexString'
|
||||
export * from './PkcKeyPair'
|
||||
export * from './SodiumConstant'
|
||||
export * from './SodiumStateAddress'
|
||||
export * from './SodiumTag'
|
||||
export * from './StreamDecryptor'
|
||||
export * from './StreamDecryptorResult'
|
||||
export * from './StreamEncryptor'
|
||||
export * from './Unencrypted'
|
||||
export * from './Utf8String'
|
||||
export * from './PkcKeyPair'
|
||||
|
||||
Reference in New Issue
Block a user