We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b29174a commit f8a0be4Copy full SHA for f8a0be4
Signal/src/crypto/CryptoTools.m
@@ -10,11 +10,11 @@ @implementation CryptoTools
10
11
+ (NSData *)generateSecureRandomData:(NSUInteger)length {
12
NSMutableData *d = [NSMutableData dataWithLength:length];
13
- int err = SecRandomCopyBytes(kSecRandomDefault, length, [d mutableBytes]);
14
- if (err != 0) {
+ OSStatus status = SecRandomCopyBytes(kSecRandomDefault, length, [d mutableBytes]);
+ if (status != noErr) {
15
[SecurityFailure raise:@"SecRandomCopyBytes failed"];
16
}
17
- return d;
+ return [d copy];
18
19
20
+ (uint16_t)generateSecureRandomUInt16 {
0 commit comments