Rename useAEAD --> nativeAEAD

This commit is contained in:
Tankred Hase 2016-03-24 13:49:26 +08:00
parent 2dce233d10
commit 969e39dcf2

View File

@ -158,7 +158,7 @@ export function decryptKey({ privateKey, passphrase }) {
export function encrypt({ data, publicKeys, privateKeys, passwords, filename, armor=true }) {
checkData(data); publicKeys = toArray(publicKeys); privateKeys = toArray(privateKeys); passwords = toArray(passwords);
if (!useAEAD() && asyncProxy) { // use web worker if web crypto apis are not supported
if (!nativeAEAD() && asyncProxy) { // use web worker if web crypto apis are not supported
return asyncProxy.delegate('encrypt', { data, publicKeys, privateKeys, passwords, filename, armor });
}
@ -200,7 +200,7 @@ export function encrypt({ data, publicKeys, privateKeys, passwords, filename, ar
export function decrypt({ message, privateKey, publicKeys, sessionKey, password, format='utf8' }) {
checkMessage(message); publicKeys = toArray(publicKeys);
if (!useAEAD() && asyncProxy) { // use web worker if web crypto apis are not supported
if (!nativeAEAD() && asyncProxy) { // use web worker if web crypto apis are not supported
return asyncProxy.delegate('decrypt', { message, privateKey, publicKeys, sessionKey, password, format });
}
@ -475,10 +475,10 @@ function onError(message, error) {
}
/**
* Check for AES-GCM support and configuration by the user. Note that only browsers that
* implement the current WebCrypto specification support AES-GCM.
* Check for AES-GCM support and configuration by the user. Only browsers that
* implement the current WebCrypto specification support native AES-GCM.
* @return {Boolean} If authenticated encryption should be used
*/
function useAEAD() {
function nativeAEAD() {
return util.getWebCrypto() && config.aead_protect;
}