mirror of
https://github.com/standardnotes/mobile.git
synced 2026-04-22 15:17:00 -04:00
feature: changes for new snjs
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
"react-navigation-stack": "^1.10.3",
|
||||
"regenerator": "^0.14.2",
|
||||
"sn-textview": "standardnotes/sn-textview#f42f0bf",
|
||||
"snjs": "standardnotes/snjs#a18da1b",
|
||||
"snjs": "standardnotes/snjs#6249603",
|
||||
"standard-notes-rn": "standardnotes/standard-notes-rn"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,10 +1,29 @@
|
||||
/* eslint-disable no-bitwise */
|
||||
import { SNPureCrypto } from 'snjs';
|
||||
import { Base64 } from 'js-base64';
|
||||
import { decode as decodeBase64toArrayBuffer } from 'base64-arraybuffer';
|
||||
import Sodium from 'react-native-sodium';
|
||||
import Aes from 'react-native-aes-crypto';
|
||||
|
||||
export class SNReactNativeCrypto extends SNPureCrypto {
|
||||
export class SNReactNativeCrypto implements SNPureCrypto {
|
||||
deinit(): void {}
|
||||
public timingSafeEqual(a: string, b: string) {
|
||||
const strA = String(a);
|
||||
let strB = String(b);
|
||||
const lenA = strA.length;
|
||||
let result = 0;
|
||||
|
||||
if (lenA !== strB.length) {
|
||||
strB = strA;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
for (let i = 0; i < lenA; i++) {
|
||||
result |= strA.charCodeAt(i) ^ strB.charCodeAt(i);
|
||||
}
|
||||
|
||||
return result === 0;
|
||||
}
|
||||
public async pbkdf2(
|
||||
password: string,
|
||||
salt: string,
|
||||
|
||||
@@ -40,8 +40,8 @@ export class MobileApplication extends SNApplication {
|
||||
Environment.Mobile,
|
||||
platformFromString(Platform.OS),
|
||||
deviceInterface,
|
||||
namespace,
|
||||
new SNReactNativeCrypto(),
|
||||
namespace,
|
||||
[
|
||||
{
|
||||
swap: SNAlertService,
|
||||
|
||||
10
yarn.lock
10
yarn.lock
@@ -6990,15 +6990,9 @@ snapdragon@^0.8.1:
|
||||
source-map-resolve "^0.5.0"
|
||||
use "^3.1.0"
|
||||
|
||||
"sncrypto@github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d":
|
||||
version "1.1.2"
|
||||
resolved "https://codeload.github.com/standardnotes/sncrypto/tar.gz/6625bbcc141161eb866475d9786238001f3c514d"
|
||||
|
||||
snjs@standardnotes/snjs#a18da1b:
|
||||
snjs@standardnotes/snjs#6249603:
|
||||
version "1.0.5"
|
||||
resolved "https://codeload.github.com/standardnotes/snjs/tar.gz/a18da1b197310486781fe215652ded1cfc47e524"
|
||||
dependencies:
|
||||
sncrypto "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d"
|
||||
resolved "https://codeload.github.com/standardnotes/snjs/tar.gz/624960349a58b798190698702bf8055d3a6a2cd0"
|
||||
|
||||
source-map-resolve@^0.5.0:
|
||||
version "0.5.3"
|
||||
|
||||
Reference in New Issue
Block a user