bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
237 stars 122 forks source link

Does this library use any hardware AES acceleration? #87

Closed hongfeiyang closed 3 years ago

hongfeiyang commented 3 years ago

Modern CPUs have AES engine built within their processors, starting from Apple A9 and SnapDragon 805 the compiler is able to emit AES instructions when compiling code that uses AES operations. I just want to know can this library use any hardware acceleration when doing cryptographic operations? If it doesn't, can you recommend any means for me to use hardware AES accelerations in flutter?

untp commented 3 years ago

This package is pure Dart, completely software implementation, so it is slow. If you want to use the device's hardware, you can look into CryptoKit (iOS) and Cipher (android). You need to write custom platform-specific code for calling APIs from android and iOS.

There is also a flutter package that wraps libsodium. It should be faster than this library, because it is written in C.

This library, Pointy Castle, is good for cross-platform support (desktop, mobile, web). You should use this library, if cross-platform support is more important than performance.

AKushWarrior commented 3 years ago

Yeah, this is not a performance intensive library. Granted, it probably won't be your bottleneck, but you should use flutter-sodium if you absolutely need the fastest performance.

writethesky commented 2 years ago

It is very poor in real-time encryption and decryption of video streams and large files, encryption and decryption of ordinary files do not feel. At present, it is used for RSA encryption and decryption. AES uses cryptography, Performance doubled, but still used more CPU on MacOS

mwcw commented 2 years ago

It is very poor in real-time encryption and decryption of video streams and large files, encryption and decryption of ordinary files do not feel. At present, it is used for RSA encryption and decryption. AES uses cryptography, Performance doubled, but still used more CPU on MacOS

No it does not use any hardware acceleration it is a pure dart implementation.