fix(ios): key length in bits
This commit is contained in:
parent
68217ac4b9
commit
5be6296829
@ -31,7 +31,8 @@ public class NativeCrypto: NSObject, NativeCryptoAPI {
|
||||
|
||||
func generateSecureRandom(length: Int64) throws -> FlutterStandardTypedData? {
|
||||
let lengthInt = Int(truncatingIfNeeded: length)
|
||||
let symmetricKey = SymmetricKey.init(size: SymmetricKeySize(bitCount: lengthInt / 8))
|
||||
let bitCount = lengthInt * 8
|
||||
let symmetricKey = SymmetricKey.init(size: SymmetricKeySize(bitCount: bitCount))
|
||||
let bytes = symmetricKey.withUnsafeBytes
|
||||
{
|
||||
return Data(Array($0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user