mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-11 17:49:43 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
620 B
Objective-C
22 lines
620 B
Objective-C
#import <MtProtoKit/MTQuickAck.h>
|
|
|
|
#import <libkern/OSByteOrder.h>
|
|
|
|
static const uint32_t MTQuickAckFlagBit = 0x80000000u;
|
|
|
|
int32_t MTQuickAckTokenFromMsgKeyLarge(const uint8_t *msgKeyLarge) {
|
|
uint32_t token = 0;
|
|
memcpy(&token, msgKeyLarge, 4);
|
|
return (int32_t)(token & ~MTQuickAckFlagBit);
|
|
}
|
|
|
|
int32_t MTQuickAckTokenFromIntermediateWord(int32_t word) {
|
|
return (int32_t)(((uint32_t)word) & ~MTQuickAckFlagBit);
|
|
}
|
|
|
|
int32_t MTQuickAckTokenFromAbridgedBytes(const uint8_t *bytes) {
|
|
uint32_t swapped = 0;
|
|
memcpy(&swapped, bytes, 4);
|
|
return (int32_t)(OSSwapInt32(swapped) & ~MTQuickAckFlagBit);
|
|
}
|