1010
1111namespace node {
1212
13+ using ncrypto::Cipher;
14+ using ncrypto::CipherCtxPointer;
15+ using ncrypto::EVPKeyCtxPointer;
16+ using ncrypto::EVPKeyPointer;
17+ using ncrypto::MarkPopErrorOnReturn;
18+ using ncrypto::SSLCtxPointer;
19+ using ncrypto::SSLPointer;
1320using v8::Array;
1421using v8::ArrayBuffer;
1522using v8::BackingStore;
@@ -42,10 +49,10 @@ void GetCipherInfo(const FunctionCallbackInfo<Value>& args) {
4249 const auto cipher = ([&] {
4350 if (args[1 ]->IsString ()) {
4451 Utf8Value name (env->isolate (), args[1 ]);
45- return ncrypto:: Cipher::FromName (*name);
52+ return Cipher::FromName (*name);
4653 } else {
4754 int nid = args[1 ].As <Int32>()->Value ();
48- return ncrypto:: Cipher::FromNid (nid);
55+ return Cipher::FromNid (nid);
4956 }
5057 })();
5158
@@ -334,7 +341,7 @@ void CipherBase::CommonInit(const char* cipher_type,
334341 return THROW_ERR_CRYPTO_INVALID_KEYLEN (env ());
335342 }
336343
337- if (!ctx_.init (ncrypto:: Cipher (), encrypt, key, iv)) {
344+ if (!ctx_.init (Cipher (), encrypt, key, iv)) {
338345 return ThrowCryptoError (env (), ERR_get_error (),
339346 " Failed to initialize cipher" );
340347 }
@@ -345,7 +352,7 @@ void CipherBase::Init(const char* cipher_type,
345352 unsigned int auth_tag_len) {
346353 HandleScope scope (env ()->isolate ());
347354 MarkPopErrorOnReturn mark_pop_error_on_return;
348- auto cipher = ncrypto:: Cipher::FromName (cipher_type);
355+ auto cipher = Cipher::FromName (cipher_type);
349356 if (!cipher) {
350357 return THROW_ERR_CRYPTO_UNKNOWN_CIPHER (env ());
351358 }
@@ -415,7 +422,7 @@ void CipherBase::InitIv(const char* cipher_type,
415422 HandleScope scope (env ()->isolate ());
416423 MarkPopErrorOnReturn mark_pop_error_on_return;
417424
418- auto cipher = ncrypto:: Cipher::FromName (cipher_type);
425+ auto cipher = Cipher::FromName (cipher_type);
419426 if (!cipher) return THROW_ERR_CRYPTO_UNKNOWN_CIPHER (env ());
420427
421428 const int expected_iv_len = cipher.getIvLength ();
@@ -628,8 +635,7 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
628635 } else {
629636 // At this point, the tag length is already known and must match the
630637 // length of the given authentication tag.
631- CHECK (
632- ncrypto::Cipher::FromCtx (cipher->ctx_ ).isSupportedAuthenticatedMode ());
638+ CHECK (Cipher::FromCtx (cipher->ctx_ ).isSupportedAuthenticatedMode ());
633639 CHECK_NE (cipher->auth_tag_len_ , kNoAuthTagLength );
634640 is_valid = cipher->auth_tag_len_ == tag_len;
635641 }
@@ -855,7 +861,7 @@ bool CipherBase::Final(std::unique_ptr<BackingStore>* out) {
855861 }
856862
857863 if (kind_ == kDecipher &&
858- ncrypto:: Cipher::FromCtx (ctx_).isSupportedAuthenticatedMode ()) {
864+ Cipher::FromCtx (ctx_).isSupportedAuthenticatedMode ()) {
859865 MaybePassAuthTagToOpenSSL ();
860866 }
861867
0 commit comments