mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-03 19:30:09 +00:00
no message
This commit is contained in:
parent
333b5c0ffc
commit
4cf9a68a19
@ -20,7 +20,7 @@ typedef struct {
|
||||
- (void)addIncomingBytes:(NSUInteger)incomingBytes interface:(MTNetworkUsageManagerInterface)interface;
|
||||
- (void)addOutgoingBytes:(NSUInteger)outgoingBytes interface:(MTNetworkUsageManagerInterface)interface;
|
||||
|
||||
- (void)resetKeys:(NSArray<NSNumber *> *)keys completion:(void (^)())completion;
|
||||
- (void)resetKeys:(NSArray<NSNumber *> *)keys setKeys:(NSDictionary<NSNumber *, NSNumber *> *)setKeys completion:(void (^)())completion;
|
||||
- (MTSignal *)currentStatsForKeys:(NSArray<NSNumber *> *)keys;
|
||||
|
||||
@end
|
||||
|
@ -103,13 +103,17 @@ static int offsetForInterface(MTNetworkUsageCalculationInfo *info, MTNetworkUsag
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)resetKeys:(NSArray<NSNumber *> *)keys completion:(void (^)())completion {
|
||||
- (void)resetKeys:(NSArray<NSNumber *> *)keys setKeys:(NSDictionary<NSNumber *, NSNumber *> *)setKeys completion:(void (^)())completion {
|
||||
[_queue dispatchOnQueue:^{
|
||||
if (_map) {
|
||||
for (NSNumber *key in keys) {
|
||||
int64_t *ptr = (int64_t *)(_map + [key intValue] * 8);
|
||||
*ptr = 0;
|
||||
}
|
||||
[setKeys enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSNumber *value, __unused BOOL *stop) {
|
||||
int64_t *ptr = (int64_t *)(_map + [key intValue] * 8);
|
||||
*ptr = [value longLongValue];
|
||||
}];
|
||||
if (completion) {
|
||||
completion();
|
||||
}
|
||||
|
@ -305,10 +305,16 @@ NSData *MTExp(NSData *base, NSData *exp, NSData *modulus)
|
||||
{
|
||||
BN_CTX *ctx = BN_CTX_new();
|
||||
BIGNUM *bnBase = BN_bin2bn(base.bytes, (int)base.length, NULL);
|
||||
BN_set_flags(bnBase, BN_FLG_CONSTTIME);
|
||||
|
||||
BIGNUM *bnExp = BN_bin2bn(exp.bytes, (int)exp.length, NULL);
|
||||
BN_set_flags(bnExp, BN_FLG_CONSTTIME);
|
||||
|
||||
BIGNUM *bnModulus = BN_bin2bn(modulus.bytes, (int)modulus.length, NULL);
|
||||
BN_set_flags(bnModulus, BN_FLG_CONSTTIME);
|
||||
|
||||
BIGNUM *bnRes = BN_new();
|
||||
BN_set_flags(bnModulus, BN_FLG_CONSTTIME);
|
||||
|
||||
BN_mod_exp(bnRes, bnBase, bnExp, bnModulus, ctx);
|
||||
|
||||
|
@ -1765,8 +1765,12 @@ static const NSUInteger MTMaxUnacknowledgedMessageCount = 64;
|
||||
int32_t messageDataLength = 0;
|
||||
[decryptedData getBytes:&messageDataLength range:NSMakeRange(28, 4)];
|
||||
|
||||
if (messageDataLength < 0 || messageDataLength > (int32_t)decryptedData.length)
|
||||
if (messageDataLength < 0 || messageDataLength > (int32_t)decryptedData.length) {
|
||||
#if MTProtoV2
|
||||
__unused NSData *result = MTSha256(decryptedData);
|
||||
#endif
|
||||
return nil;
|
||||
}
|
||||
|
||||
#if MTProtoV2
|
||||
int xValue = 8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user