mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
More Uint8Array conversions to subtle calls & fix one UInt8Array typo
This commit is contained in:
parent
c9c072b3df
commit
5b655ffbfb
6
sea.js
6
sea.js
@ -22,7 +22,7 @@
|
||||
var wc = window.crypto || window.msCrypto; // STD or M$
|
||||
subtle = wc.subtle || wc.webkitSubtle; // STD or iSafari
|
||||
getRandomBytes = function(len){
|
||||
return wc.getRandomValues(new UInt8Array(Buffer.alloc(len)));
|
||||
return wc.getRandomValues(new Uint8Array(Buffer.alloc(len)));
|
||||
};
|
||||
TextEncoder = window.TextEncoder;
|
||||
TextDecoder = window.TextDecoder;
|
||||
@ -541,7 +541,7 @@
|
||||
.then(function(hashedKey){
|
||||
return subtle.importKey(
|
||||
'raw',
|
||||
hashedKey,
|
||||
new Uint8Array(hashedKey),
|
||||
'AES-CBC',
|
||||
false,
|
||||
o
|
||||
@ -1194,7 +1194,7 @@
|
||||
subtle.importKey('jwk', keystoecdsajwk(p), ecdsakeyprops, false, ['verify'])
|
||||
.then(function(key){
|
||||
sha256hash(m).then(function(mm){
|
||||
subtle.verify(ecdsasignprops, key, new Uint8Array(Buffer.from(s, 'base64')), mm)
|
||||
subtle.verify(ecdsasignprops, key, new Uint8Array(Buffer.from(s, 'base64')), new Uint8Array(mm))
|
||||
.then(function(v){ resolve(v) })
|
||||
.catch(function(e){ Gun.log(e); reject(e) });
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user