├── .gitignore
├── README.md
├── ap2-sender.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── ap2-sender
├── AirPlaySenderConnection.h
├── AirPlaySenderConnection.m
├── AppDelegate.h
├── AppDelegate.m
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
├── Base.lproj
│ └── MainMenu.xib
├── Discovery
│ ├── AirPlayService.h
│ ├── AirPlayService.m
│ ├── AirPlayServiceListener.h
│ ├── AirPlayServiceListener.m
│ └── EPAirPlayServiceListener.m
├── GUI
│ ├── AirPlayCodeWindowController.h
│ ├── AirPlayCodeWindowController.m
│ └── AirPlayCodeWindowController.xib
├── Info.plist
├── TLV8
│ ├── NSArray+TLV8Additions.h
│ ├── NSArray+TLV8Additions.m
│ ├── TLV8.h
│ ├── TLV8.m
│ ├── TLV8Item.h
│ └── TLV8Item.m
├── ThirdParty
│ ├── Licenses
│ │ ├── Credits.txt
│ │ ├── chachapoly.txt
│ │ ├── csrp.txt
│ │ ├── curve25519-donna.txt
│ │ ├── ed25519.txt
│ │ └── openssl.txt
│ ├── chachapoly
│ │ ├── README.md
│ │ ├── chacha.c
│ │ ├── chacha.h
│ │ ├── chachapoly-test.c
│ │ ├── chachapoly.c
│ │ ├── chachapoly.h
│ │ ├── poly1305.c
│ │ └── poly1305.h
│ ├── csrp
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── srp.c
│ │ ├── srp.h
│ │ └── test_srp.c
│ ├── curve25519
│ │ ├── CMakeLists.txt
│ │ ├── curve25519-donna.c
│ │ └── curve25519.h
│ ├── ed25519
│ │ ├── CMakeLists.txt
│ │ ├── add_scalar.c
│ │ ├── ed25519.h
│ │ ├── fe.c
│ │ ├── fe.h
│ │ ├── fixedint.h
│ │ ├── ge.c
│ │ ├── ge.h
│ │ ├── key_exchange.c
│ │ ├── keypair.c
│ │ ├── precomp_data.h
│ │ ├── sc.c
│ │ ├── sc.h
│ │ ├── seed.c
│ │ ├── sha512.c
│ │ ├── sha512.h
│ │ ├── sign.c
│ │ └── verify.c
│ ├── prebuilt
│ │ ├── include
│ │ │ ├── .DS_Store
│ │ │ └── openssl
│ │ │ │ ├── aes.h
│ │ │ │ ├── asn1.h
│ │ │ │ ├── asn1_mac.h
│ │ │ │ ├── asn1t.h
│ │ │ │ ├── bio.h
│ │ │ │ ├── blowfish.h
│ │ │ │ ├── bn.h
│ │ │ │ ├── buffer.h
│ │ │ │ ├── camellia.h
│ │ │ │ ├── cast.h
│ │ │ │ ├── cmac.h
│ │ │ │ ├── cms.h
│ │ │ │ ├── comp.h
│ │ │ │ ├── conf.h
│ │ │ │ ├── conf_api.h
│ │ │ │ ├── crypto.h
│ │ │ │ ├── des.h
│ │ │ │ ├── des_old.h
│ │ │ │ ├── dh.h
│ │ │ │ ├── dsa.h
│ │ │ │ ├── dso.h
│ │ │ │ ├── dtls1.h
│ │ │ │ ├── e_os2.h
│ │ │ │ ├── ebcdic.h
│ │ │ │ ├── ec.h
│ │ │ │ ├── ecdh.h
│ │ │ │ ├── ecdsa.h
│ │ │ │ ├── engine.h
│ │ │ │ ├── err.h
│ │ │ │ ├── evp.h
│ │ │ │ ├── hmac.h
│ │ │ │ ├── idea.h
│ │ │ │ ├── krb5_asn.h
│ │ │ │ ├── kssl.h
│ │ │ │ ├── lhash.h
│ │ │ │ ├── md4.h
│ │ │ │ ├── md5.h
│ │ │ │ ├── mdc2.h
│ │ │ │ ├── modes.h
│ │ │ │ ├── obj_mac.h
│ │ │ │ ├── objects.h
│ │ │ │ ├── ocsp.h
│ │ │ │ ├── opensslconf.h
│ │ │ │ ├── opensslv.h
│ │ │ │ ├── ossl_typ.h
│ │ │ │ ├── pem.h
│ │ │ │ ├── pem2.h
│ │ │ │ ├── pkcs12.h
│ │ │ │ ├── pkcs7.h
│ │ │ │ ├── pqueue.h
│ │ │ │ ├── rand.h
│ │ │ │ ├── rc2.h
│ │ │ │ ├── rc4.h
│ │ │ │ ├── ripemd.h
│ │ │ │ ├── rsa.h
│ │ │ │ ├── safestack.h
│ │ │ │ ├── seed.h
│ │ │ │ ├── sha.h
│ │ │ │ ├── srp.h
│ │ │ │ ├── srtp.h
│ │ │ │ ├── ssl.h
│ │ │ │ ├── ssl2.h
│ │ │ │ ├── ssl23.h
│ │ │ │ ├── ssl3.h
│ │ │ │ ├── stack.h
│ │ │ │ ├── symhacks.h
│ │ │ │ ├── tls1.h
│ │ │ │ ├── ts.h
│ │ │ │ ├── txt_db.h
│ │ │ │ ├── ui.h
│ │ │ │ ├── ui_compat.h
│ │ │ │ ├── whrlpool.h
│ │ │ │ ├── x509.h
│ │ │ │ ├── x509_vfy.h
│ │ │ │ └── x509v3.h
│ │ └── lib
│ │ │ ├── .DS_Store
│ │ │ ├── libcrypto.1.0.0.dylib
│ │ │ └── libssl.1.0.0.dylib
│ └── rfc6234
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── hkdf.c
│ │ ├── hmac.c
│ │ ├── rfc6234.txt
│ │ ├── sha-private.h
│ │ ├── sha.h
│ │ ├── sha1.c
│ │ ├── sha224-256.c
│ │ ├── sha384-512.c
│ │ ├── shatest.c
│ │ └── usha.c
├── ap2_sender.entitlements
└── main.m
└── pairing.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | ## macOS temporary files that should never be committed
2 | .DS_Store
3 |
4 | ## User settings
5 | xcuserdata/
6 |
7 | ## Obj-C/Swift specific
8 | *.hmap
9 |
10 | ## App packaging
11 | *.ipa
12 | *.dSYM.zip
13 | *.dSYM
14 |
15 | # CocoaPods
16 | #
17 | # We recommend against adding the Pods directory to your .gitignore. However
18 | # you should judge for yourself, the pros and cons are mentioned at:
19 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
20 | #
21 | # Pods/
22 | #
23 | # Add this line if you want to avoid checking in source code from the Xcode workspace
24 | # *.xcworkspace
25 |
26 | # Carthage
27 | #
28 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
29 | # Carthage/Checkouts
30 |
31 | Carthage/Build/
32 |
33 | # fastlane
34 | #
35 | # It is recommended to not store the screenshots in the git repo.
36 | # Instead, use fastlane to re-generate the screenshots whenever they are needed.
37 | # For more information about the recommended setup visit:
38 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
39 |
40 | fastlane/report.xml
41 | fastlane/Preview.html
42 | fastlane/screenshots/**/*.png
43 | fastlane/test_output
44 |
45 | # Code Injection
46 | #
47 | # After new code Injection tools there's a generated folder /iOSInjectionProject
48 | # https://github.com/johnno1962/injectionforxcode
49 |
50 | iOSInjectionProject/
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ap2-sender
2 |
3 | ## Acknowledgments
4 |
5 | - [airplay2-receiver](https://github.com/Argyropus/airplay2-receiver)
6 | - [libssl](https://www.openssl.org/source/openssl-1.0.2o.tar.gz)
7 | - [csrp](https://github.com/cocagne/csrp)
8 | - [curve25519-donna](https://github.com/agl/curve25519-donna/tree/master)
9 | - [ed25519](https://github.com/orlp/ed25519)
10 | - [chachapoly](https://github.com/grigorig/chachapoly)
11 | - [rfc6234](https://github.com/massar/rfc6234)
12 |
--------------------------------------------------------------------------------
/ap2-sender.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ap2-sender.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ap2-sender/AirPlaySenderConnection.h:
--------------------------------------------------------------------------------
1 | //
2 | // AirPlaySenderConnection.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, PairingState) {
12 | PairingStateM1 = 0x01,
13 | PairingStateM2 = 0x02,
14 | PairingStateM3 = 0x03,
15 | PairingStateM4 = 0x04,
16 | PairingStateM5 = 0x05,
17 | PairingStateM6 = 0x06
18 | };
19 |
20 | typedef NS_ENUM(NSUInteger, PairingMethod) {
21 | PairingMethodPairSetup = 0x00,
22 | PairingMethodPairSetupWithAuth = 0x01,
23 | PairingMethodPairVerify = 0x02,
24 | PairingMethodAddPairing = 0x03,
25 | PairingMethodRemovePairing = 0x04,
26 | PairingMethodListPairings = 0x05
27 | };
28 |
29 | @protocol AirPlaySenderConnectionDelegate
30 |
31 | - (NSString *)promptUserForPin;
32 |
33 | @end
34 |
35 | @interface AirPlaySenderConnection : NSObject
36 |
37 | @property (weak) id delegate;
38 |
39 | - (id)initWithHostAddress:(NSString *)address name:(NSString *)name port:(int)port;
40 |
41 | - (void)setup;
42 | - (void)close;
43 |
44 | - (void)startPairing;
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/ap2-sender/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : NSObject
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/ap2-sender/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "AirPlayServiceListener.h"
11 | #import "AirPlayService.h"
12 | #import "AirPlaySenderConnection.h"
13 | #import "AirPlayCodeWindowController.h"
14 |
15 | @interface AppDelegate ()
16 |
17 | @property (weak) IBOutlet NSWindow *window;
18 | @property (weak) IBOutlet NSPopUpButton *popUpBtnDevices;
19 |
20 | @property (strong) AirPlayServiceListener *airPlayServiceListener;
21 | @property (strong) AirPlaySenderConnection *airPlaySenderConnection;
22 |
23 | @end
24 |
25 | @implementation AppDelegate
26 |
27 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
28 | // Insert code here to initialize your application
29 | [self.popUpBtnDevices removeAllItems];
30 |
31 | self.airPlayServiceListener = [[AirPlayServiceListener alloc] init];
32 | [self.airPlayServiceListener startBrowsingForAirPlayServices];
33 | self.airPlayServiceListener.delegate = self;
34 | }
35 |
36 |
37 | - (void)applicationWillTerminate:(NSNotification *)aNotification {
38 | // Insert code here to tear down your application
39 |
40 | [self.airPlaySenderConnection close];
41 | [self.airPlayServiceListener stopBrowsingForAirPlayServices];
42 | }
43 |
44 | #pragma mark - AirPlayServiceListenerDelegate Protocol Support
45 |
46 | - (void)airPlayServiceListenerFoundDevicesDidChange:(AirPlayServiceListener *)listener {
47 | [self.popUpBtnDevices removeAllItems];
48 | NSMenu *menuDevices = [NSMenu new];
49 | for (int i = 0; i < listener.foundDevices.count; i++) {
50 | AirPlayService *airPlayService = [listener.foundDevices objectAtIndex:i];
51 | [menuDevices addItemWithTitle:airPlayService.name action:NULL keyEquivalent:@""];
52 | }
53 | [self.popUpBtnDevices setMenu:menuDevices];
54 | }
55 |
56 | #pragma mark - AirPlaySenderConnectionDelegate Protocol Support
57 |
58 | - (NSString *)promptUserForPin {
59 | [NSApp activateIgnoringOtherApps:YES];
60 | NSString *code = nil;
61 | AirPlayCodeWindowController *airPlayCodeController = [[AirPlayCodeWindowController alloc] initWithWindowNibName:@"AirPlayCodeWindowController"];
62 | NSInteger result = [NSApp runModalForWindow:airPlayCodeController.window];
63 | if (result == NSModalResponseOK) {
64 | code = airPlayCodeController.textFieldCode.stringValue;
65 | }
66 | return code;
67 | }
68 |
69 | #pragma mark - Sent Actions
70 |
71 | - (IBAction)pairDevice:(id)sender {
72 | NSInteger selectedDeviceIndex = [self.popUpBtnDevices indexOfSelectedItem];
73 | if (selectedDeviceIndex == -1 || selectedDeviceIndex >= self.airPlayServiceListener.foundDevices.count) {
74 | return;
75 | }
76 | AirPlayService *device = [self.airPlayServiceListener.foundDevices objectAtIndex:selectedDeviceIndex];
77 | self.airPlaySenderConnection = [[AirPlaySenderConnection alloc] initWithHostAddress:device.primaryIPv4Address name:nil port:(int)device.netService.port];
78 | self.airPlaySenderConnection.delegate = self;
79 | [self.airPlaySenderConnection setup];
80 | [self.airPlaySenderConnection startPairing];
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/ap2-sender/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "scale" : "1x",
6 | "size" : "16x16"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "scale" : "2x",
11 | "size" : "16x16"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "scale" : "1x",
16 | "size" : "32x32"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "scale" : "2x",
21 | "size" : "32x32"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "scale" : "1x",
26 | "size" : "128x128"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "scale" : "2x",
31 | "size" : "128x128"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "scale" : "1x",
36 | "size" : "256x256"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "scale" : "2x",
41 | "size" : "256x256"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "scale" : "1x",
46 | "size" : "512x512"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "scale" : "2x",
51 | "size" : "512x512"
52 | }
53 | ],
54 | "info" : {
55 | "author" : "xcode",
56 | "version" : 1
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ap2-sender/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/ap2-sender/Discovery/AirPlayService.h:
--------------------------------------------------------------------------------
1 | //
2 | // AirPlayService.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AirPlayService : NSObject
12 |
13 | @property (strong) NSNetService *netService;
14 | @property (strong) NSString *name;
15 | @property (strong) NSMutableArray *ipAddresses;
16 | @property (strong) NSString *macAddress;
17 | @property (strong) NSString *serverVersion;
18 | @property (strong) NSString *model;
19 | @property (assign) unsigned long features;
20 | @property (assign, getter=isPasswordProtected) BOOL passwordProtected;
21 | @property (assign, getter=isPasscodeProtected) BOOL passcodeProtected;
22 | @property (assign, getter=isDeviceVerificationEnabled) BOOL deviceVerificationEnabled;
23 | @property (assign) int protocolVersion;
24 |
25 | - (id)initWithNetService:(NSNetService *)service;
26 |
27 | - (NSString *)primaryIPv4Address;
28 |
29 | - (BOOL)isVideoSupported;
30 | - (BOOL)isPhotoSupported;
31 | - (BOOL)isVideoFairPlaySupported;
32 | - (BOOL)isVideoVolumeControlSupported;
33 | - (BOOL)isVideoHLSSupported;
34 | - (BOOL)isSlideshowSupported;
35 | - (BOOL)isScreenMirroringSupported;
36 | - (BOOL)isScreenRotationSupported;
37 | - (BOOL)isAudioSupported;
38 | - (BOOL)isAudioPacketRedundancySupported;
39 | - (BOOL)isFairPlaySecureAuthSupported;
40 | - (BOOL)isPhotoCachingSupported;
41 |
42 | - (NSString *)description;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/ap2-sender/Discovery/AirPlayService.m:
--------------------------------------------------------------------------------
1 | //
2 | // AirPlayService.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import "AirPlayService.h"
10 |
11 | @implementation AirPlayService
12 |
13 | - (id)initWithNetService:(NSNetService *)service {
14 | self = [super init];
15 | if (self) {
16 | _netService = service;
17 | _name = nil;
18 | _macAddress = nil;
19 | _ipAddresses = [[NSMutableArray alloc] init];
20 | _serverVersion = nil;
21 | _model = nil;
22 | _features = 0;
23 | _passwordProtected = NO;
24 | _passcodeProtected = NO;
25 | _deviceVerificationEnabled = NO;
26 | _protocolVersion = 1;
27 | }
28 | return self;
29 | }
30 |
31 | #pragma mark - Getting Addresses
32 |
33 | - (NSString *)primaryIPv4Address {
34 | NSString *host = nil;
35 | for (NSDictionary *addrInfo in self.ipAddresses) {
36 | if ([[addrInfo objectForKey:@"type"] isEqualToString:@"ipv4"]) {
37 | host = [addrInfo objectForKey:@"address"];
38 | break;
39 | }
40 | }
41 | return host;
42 | }
43 |
44 | #pragma mark - Features
45 |
46 | - (BOOL)isVideoSupported {
47 | return (0 < (self.features & (1 << 0)));
48 | }
49 |
50 | - (BOOL)isPhotoSupported {
51 | return (0 < (self.features & (1 << 1)));
52 | }
53 |
54 | - (BOOL)isVideoFairPlaySupported {
55 | return (0 < (self.features & (1 << 2)));
56 | }
57 |
58 | - (BOOL)isVideoVolumeControlSupported {
59 | return (0 < (self.features & (1 << 3)));
60 | }
61 |
62 | - (BOOL)isVideoHLSSupported {
63 | return (0 < (self.features & (1 << 4)));
64 | }
65 |
66 | - (BOOL)isSlideshowSupported {
67 | return (0 < (self.features & (1 << 5)));
68 | }
69 |
70 | - (BOOL)isScreenMirroringSupported {
71 | return (0 < (self.features & (1 << 7)));
72 | }
73 |
74 | - (BOOL)isScreenRotationSupported {
75 | return (0 < (self.features & (1 << 8)));
76 | }
77 |
78 | - (BOOL)isAudioSupported {
79 | return (0 < (self.features & (1 << 9)));
80 | }
81 |
82 | - (BOOL)isAudioPacketRedundancySupported {
83 | return (0 < (self.features & (1 << 11)));
84 | }
85 |
86 | - (BOOL)isFairPlaySecureAuthSupported {
87 | return (0 < (self.features & (1 << 12)));
88 | }
89 |
90 | - (BOOL)isPhotoCachingSupported {
91 | return (0 < (self.features & (1 << 13)));
92 | }
93 |
94 | - (BOOL)supportsCoreUtilsPairingAndEncryption {
95 | return (0 < (self.features & ((unsigned long)1 << 38)));
96 | }
97 |
98 | - (BOOL)supportsHKPairingAndAccessControl {
99 | return (0 < (self.features & ((unsigned long)1 << 46)));
100 | }
101 |
102 | - (BOOL)supportsUnifiedPairSetupAndMFi {
103 | return (0 < (self.features & ((unsigned long)1 << 51)));
104 | }
105 |
106 | - (BOOL)supportsMFiAuthentication {
107 | return (0 < (self.features & ((unsigned long)1 << 26)));
108 | }
109 |
110 | - (BOOL)supportsFairPlayAuthentication {
111 | return (0 < (self.features & ((unsigned long)1 << 14)));
112 | }
113 |
114 | - (NSString *)description {
115 | NSString *addr = @"";
116 | for (NSDictionary *addrInfo in self.ipAddresses) {
117 | addr = [addr stringByAppendingFormat:@"\t\t%@:%@\n", [addrInfo objectForKey:@"address"],
118 | [addrInfo objectForKey:@"port"]];
119 | }
120 | NSString *featuresString = [NSString stringWithFormat:@"0x%lX", (self.features & 0xffffffff)];;
121 | if ((self.features >> 32 & 0xffffffff) != 0) {
122 | featuresString = [featuresString stringByAppendingFormat:@",0x%lX", (self.features >> 32 & 0xffffffff)];
123 | }
124 | return [NSString stringWithFormat:@"%@:\n\t"
125 | "MAC address: %@\n\t"
126 | "model: %@\n\t"
127 | "server version: %@\n\t"
128 | "host name: %@\n\t"
129 | "IP addresses:\n%@\t"
130 | "Features: %@\n\t\t"
131 | "Video: %d\n\t\t"
132 | "Photo: %d\n\t\t"
133 | "VideoFairPlay: %d\n\t\t"
134 | "VideoVolumeControl: %d\n\t\t"
135 | "VideoHTTPLiveStreams: %d\n\t\t"
136 | "Slideshow: %d\n\t\t"
137 | "Screen: %d\n\t\t"
138 | "ScreenRotate: %d\n\t\t"
139 | "Audio: %d\n\t\t"
140 | "AudioRedundant: %d\n\t\t"
141 | "FPSAPv2pt5_AES_GCM: %d\n\t\t"
142 | "PhotoCaching: %d\n\t\t"
143 | "SupportsHKPairingAndAccessControl: %d\n\t\t"
144 | "SupportsUnifiedPairSetupAndMFi: %d\n\t\t"
145 | "MFi auth: %d\n\t\t"
146 | "FairPlay auth: %d\n\t"
147 | "Password protected: %d\n\t"
148 | "Passcode protected: %d\n\t"
149 | "Device verification enabled: %d\n\t"
150 | "Protocol version: %d\n",
151 | self.name,
152 | self.macAddress,
153 | self.model,
154 | self.serverVersion,
155 | self.netService.hostName,
156 | addr,
157 | featuresString,
158 | [self isVideoSupported],
159 | [self isPhotoSupported],
160 | [self isVideoFairPlaySupported],
161 | [self isVideoVolumeControlSupported],
162 | [self isVideoHLSSupported],
163 | [self isSlideshowSupported],
164 | [self isScreenMirroringSupported],
165 | [self isScreenRotationSupported],
166 | [self isAudioSupported],
167 | [self isAudioPacketRedundancySupported],
168 | [self isFairPlaySecureAuthSupported],
169 | [self isPhotoCachingSupported],
170 | [self supportsHKPairingAndAccessControl],
171 | [self supportsUnifiedPairSetupAndMFi],
172 | [self supportsMFiAuthentication],
173 | [self supportsFairPlayAuthentication],
174 | [self isPasswordProtected],
175 | [self isPasscodeProtected],
176 | self.isDeviceVerificationEnabled,
177 | self.protocolVersion];
178 | }
179 |
180 | @end
181 |
--------------------------------------------------------------------------------
/ap2-sender/Discovery/AirPlayServiceListener.h:
--------------------------------------------------------------------------------
1 | //
2 | // AirPlayServiceListener.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class AirPlayServiceListener;
12 | @protocol AirPlayServiceListenerDelegate
13 |
14 | - (void)airPlayServiceListenerFoundDevicesDidChange:(AirPlayServiceListener *)listener;
15 |
16 | @end
17 |
18 | @interface AirPlayServiceListener : NSObject
19 |
20 | @property (strong, readonly) NSMutableArray *foundDevices;
21 | @property (weak) id delegate;
22 |
23 | - (void)startBrowsingForAirPlayServices;
24 | - (void)stopBrowsingForAirPlayServices;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/ap2-sender/GUI/AirPlayCodeWindowController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AirPlayCodeWindowController.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AirPlayCodeWindowController : NSWindowController
12 |
13 | @property (assign) IBOutlet NSTextField *textFieldCode;
14 | @property (assign) IBOutlet NSButton *btnOK;
15 | @property (assign) IBOutlet NSButton *btnCancel;
16 |
17 | - (IBAction)btnOKAction:(id)sender;
18 | - (IBAction)btnCancelAction:(id)sender;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/ap2-sender/GUI/AirPlayCodeWindowController.m:
--------------------------------------------------------------------------------
1 | //
2 | // AirPlayCodeWindowController.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import "AirPlayCodeWindowController.h"
10 |
11 | @interface AirPlayCodeWindowController ()
12 |
13 | @end
14 |
15 | @implementation AirPlayCodeWindowController
16 |
17 | - (void)windowDidLoad {
18 | [super windowDidLoad];
19 |
20 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
21 | }
22 |
23 | - (IBAction)btnOKAction:(id)sender {
24 | [self.window close];
25 | [NSApp stopModalWithCode:NSModalResponseOK];
26 | }
27 |
28 | - (IBAction)btnCancelAction:(id)sender {
29 | [self.window close];
30 | [NSApp stopModalWithCode:NSModalResponseAbort];
31 | }
32 |
33 | #pragma mark - Control Editing Notifications
34 |
35 | - (void)controlTextDidChange:(NSNotification *)obj {
36 | id sender = [obj object];
37 | if (sender == self.textFieldCode) {
38 | if (self.textFieldCode.stringValue.length == 0)
39 | [self.btnOK setEnabled:NO];
40 | else
41 | [self.btnOK setEnabled:YES];
42 | }
43 | }
44 | @end
45 |
--------------------------------------------------------------------------------
/ap2-sender/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2020 Viktoriia. All rights reserved.
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 | NSSupportsAutomaticTermination
32 |
33 | NSSupportsSuddenTermination
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ap2-sender/TLV8/NSArray+TLV8Additions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+TLV8Additions.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 13.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "TLV8Item.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface NSArray (TLV8Additions)
15 |
16 | - (TLV8Item *)itemWithTag:(TLV8Tag)tag;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/ap2-sender/TLV8/NSArray+TLV8Additions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+TLV8Additions.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 13.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import "NSArray+TLV8Additions.h"
10 |
11 | @implementation NSArray (TLV8Additions)
12 |
13 | - (TLV8Item *)itemWithTag:(TLV8Tag)tag {
14 | for (TLV8Item *item in self) {
15 | if (item.tag == tag) {
16 | return item;
17 | }
18 | }
19 | return nil;
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ap2-sender/TLV8/TLV8.h:
--------------------------------------------------------------------------------
1 | //
2 | // TLV8.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 13.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "TLV8Item.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface TLV8 : NSObject
15 |
16 | + (NSArray *)decode:(NSData *)data;
17 | + (int)encode:(NSArray *)items toBytes:(uint8_t *_Nonnull*_Nonnull)stream_ptr;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/ap2-sender/TLV8/TLV8.m:
--------------------------------------------------------------------------------
1 | //
2 | // TLV8.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 13.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import "TLV8.h"
10 |
11 | @implementation TLV8
12 |
13 | + (NSArray *)decode:(NSData *)data {
14 | NSMutableArray *items = [[NSMutableArray alloc] init];
15 |
16 | NSUInteger offset = 0;
17 | NSUInteger dataLength = data.length;
18 | const uint8_t *bytes = data.bytes;
19 |
20 | uint8_t previous_type = 0xff; // Should be an unused type code, assume 0xFF
21 | uint16_t previous_size = 0;
22 |
23 | while (offset < dataLength) {
24 | uint8_t type = bytes[offset];
25 | offset += 1;
26 | uint8_t size = bytes[offset];
27 | offset += 1;
28 | NSData *itemData = [data subdataWithRange:NSMakeRange(offset, size)];
29 |
30 | // Check whether the data should be appended
31 | if (type == previous_type && previous_size == 255) {
32 | uint8_t index = items.count - 1;
33 | TLV8Item *oldItem = [items objectAtIndex:index];
34 | NSData *oldData = oldItem.value;
35 | NSMutableData *newData = [[NSMutableData alloc] initWithData:oldData];
36 | [newData appendData:itemData];
37 | oldItem.value = newData;
38 | } else {
39 | TLV8Item *newItem = [[TLV8Item alloc] initWithTag:type value:itemData];
40 | [items addObject:newItem];
41 | }
42 |
43 | offset += size;
44 |
45 | // Save previous values
46 | previous_type = type;
47 | previous_size = size;
48 | }
49 |
50 | return items;
51 | }
52 |
53 | + (int)encode:(NSArray *)items toBytes:(uint8_t **)stream_ptr {
54 | uint8_t * stream = *stream_ptr;
55 |
56 | uint32_t offset = 0;
57 | uint32_t data_offset = 0;
58 | uint8_t previous_type = 0xff; // Should be an unused type code, assume 0xFF
59 | uint16_t remaining_bytes = 0;
60 |
61 | NSUInteger count = items.count;
62 | for (int i = 0; i < count; i++) {
63 | TLV8Item *item = items[i];
64 | uint8_t type = item.tag;
65 | uint8_t *data = (uint8_t *)item.value.bytes;
66 | uint16_t size = item.value.length;
67 |
68 | // Split encoded object into two or more consecutive segments
69 | previous_type = type;
70 | remaining_bytes = size;
71 | data_offset = 0;
72 |
73 | while (remaining_bytes > 0) {
74 | // Initialize or reallocate the stream buffer as needed
75 | uint16_t data_size = (remaining_bytes >= 255) ? 255 : remaining_bytes;
76 | if (i == 0) {
77 | uint8_t *mem = (uint8_t *)malloc(data_size + 2);
78 | if (NULL == mem) {
79 | return 0;
80 | } else {
81 | stream = mem;
82 | }
83 | } else {
84 | uint8_t *mem = (uint8_t *)realloc(stream, offset + data_size + 2);
85 | if (NULL == mem) {
86 | return 0;
87 | } else {
88 | stream = mem;
89 | }
90 | }
91 |
92 | stream[offset] = type;
93 | stream[offset+1] = data_size;
94 | memcpy(stream + offset + 2, data + data_offset, data_size);
95 |
96 | offset += data_size + 2;
97 |
98 | remaining_bytes = remaining_bytes - data_size;
99 |
100 | data_offset += data_size;
101 | }
102 | }
103 |
104 | *stream_ptr = stream;
105 |
106 | return offset;
107 | }
108 |
109 | @end
110 |
--------------------------------------------------------------------------------
/ap2-sender/TLV8/TLV8Item.h:
--------------------------------------------------------------------------------
1 | //
2 | // TLV8Item.h
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 13.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | typedef NS_ENUM(NSUInteger, TLV8Tag) {
14 | TLV8TagMethod = 0,
15 | TLV8TagIdentifier = 1,
16 | TLV8TagSalt = 2,
17 | TLV8TagPublicKey = 3,
18 | TLV8TagProof = 4,
19 | TLV8TagEncryptedData = 5,
20 | TLV8TagState = 6,
21 | TLV8TagError = 7,
22 | TLV8TagRetryDelay = 8,
23 | TLV8TagCertificate = 9,
24 | TLV8TagSignature = 10,
25 | TLV8TagPermissions = 11,
26 | TLV8TagFragmentData = 12,
27 | TLV8TagFragmentLast = 13,
28 | TLV8TagFlags = 19,
29 | TLV8TagSeparator = 255
30 | };
31 |
32 | @interface TLV8Item : NSObject
33 |
34 | @property (assign) TLV8Tag tag;
35 | @property (strong) NSData *value;
36 |
37 | - (instancetype)initWithTag:(TLV8Tag)aTag value:(NSData *)aValue;
38 |
39 | @end
40 |
41 | NS_ASSUME_NONNULL_END
42 |
--------------------------------------------------------------------------------
/ap2-sender/TLV8/TLV8Item.m:
--------------------------------------------------------------------------------
1 | //
2 | // TLV8Item.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 13.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import "TLV8Item.h"
10 |
11 | @implementation TLV8Item
12 |
13 | - (instancetype)initWithTag:(TLV8Tag)aTag value:(NSData *)aValue {
14 | self = [super init];
15 | if (self) {
16 | self.tag = aTag;
17 | self.value = aValue;
18 | }
19 | return self;
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/Licenses/Credits.txt:
--------------------------------------------------------------------------------
1 | libssl - Copyright (c) 1998-2018 The OpenSSL Project
2 | Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
3 | (License https://www.openssl.org/source/license.txt) (Sources https://www.openssl.org/source/openssl-1.0.2o.tar.gz)
4 |
5 | curve25519-donna - Copyright 2008, Google Inc. All rights reserved.
6 | (License https://github.com/agl/curve25519-donna/blob/master/LICENSE.md)
7 | (Sources https://github.com/agl/curve25519-donna/tree/master)
8 |
9 | ed25519 - Copyright (c) 2015 Orson Peters
10 | (License https://github.com/orlp/ed25519/blob/master/license.txt)
11 | (Sources https://github.com/orlp/ed25519)
12 |
13 | csrp - Copyright (c) 2013 Tom Cocagne
14 | (License https://github.com/cocagne/csrp/blob/master/LICENSE)
15 | (Sources https://github.com/cocagne/csrp)
16 |
17 | chachapoly - Copyright (c) 2015 Grigori Goronzy
18 | (Sources https://github.com/grigorig/chachapoly)
19 |
20 | rfc6234 - Copyright (c) 2011 IETF Trust
21 | (Sources https://github.com/massar/rfc6234)
22 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/Licenses/chachapoly.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Grigori Goronzy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/Licenses/csrp.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Tom Cocagne
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/Licenses/curve25519-donna.txt:
--------------------------------------------------------------------------------
1 | Copyright 2008, Google Inc. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4 |
5 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7 | Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 |
10 | curve25519-donna: Curve25519 elliptic curve, public key function
11 |
12 | http://code.google.com/p/curve25519-donna/
13 |
14 | Adam Langley agl@imperialviolet.org
15 |
16 | Derived from public domain C code by Daniel J. Bernstein djb@cr.yp.to
17 |
18 | More information about curve25519 can be found here http://cr.yp.to/ecdh.html
19 |
20 | djb's sample implementation of curve25519 is written in a special assembly language called qhasm and uses the floating point registers.
21 |
22 | This is, almost, a clean room reimplementation from the curve25519 paper. It uses many of the tricks described therein. Only the crecip function is taken from the sample implementation.
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/Licenses/ed25519.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Orson Peters
2 |
3 | This software is provided 'as-is', without any express or implied warranty. In no event will the
4 | authors be held liable for any damages arising from the use of this software.
5 |
6 | Permission is granted to anyone to use this software for any purpose, including commercial
7 | applications, and to alter it and redistribute it freely, subject to the following restrictions:
8 |
9 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the
10 | original software. If you use this software in a product, an acknowledgment in the product
11 | documentation would be appreciated but is not required.
12 |
13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as
14 | being the original software.
15 |
16 | 3. This notice may not be removed or altered from any source distribution.
17 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/Licenses/openssl.txt:
--------------------------------------------------------------------------------
1 |
2 | LICENSE ISSUES
3 | ==============
4 |
5 | The OpenSSL toolkit stays under a double license, i.e. both the conditions of
6 | the OpenSSL License and the original SSLeay license apply to the toolkit.
7 | See below for the actual license texts. Actually both licenses are BSD-style
8 | Open Source licenses. In case of any license issues related to OpenSSL
9 | please contact openssl-core@openssl.org.
10 |
11 | OpenSSL License
12 | ---------------
13 |
14 | /* ====================================================================
15 | * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved.
16 | *
17 | * Redistribution and use in source and binary forms, with or without
18 | * modification, are permitted provided that the following conditions
19 | * are met:
20 | *
21 | * 1. Redistributions of source code must retain the above copyright
22 | * notice, this list of conditions and the following disclaimer.
23 | *
24 | * 2. Redistributions in binary form must reproduce the above copyright
25 | * notice, this list of conditions and the following disclaimer in
26 | * the documentation and/or other materials provided with the
27 | * distribution.
28 | *
29 | * 3. All advertising materials mentioning features or use of this
30 | * software must display the following acknowledgment:
31 | * "This product includes software developed by the OpenSSL Project
32 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
33 | *
34 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
35 | * endorse or promote products derived from this software without
36 | * prior written permission. For written permission, please contact
37 | * openssl-core@openssl.org.
38 | *
39 | * 5. Products derived from this software may not be called "OpenSSL"
40 | * nor may "OpenSSL" appear in their names without prior written
41 | * permission of the OpenSSL Project.
42 | *
43 | * 6. Redistributions of any form whatsoever must retain the following
44 | * acknowledgment:
45 | * "This product includes software developed by the OpenSSL Project
46 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
47 | *
48 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
49 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
51 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
52 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
53 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
54 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
55 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
57 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
58 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59 | * OF THE POSSIBILITY OF SUCH DAMAGE.
60 | * ====================================================================
61 | *
62 | * This product includes cryptographic software written by Eric Young
63 | * (eay@cryptsoft.com). This product includes software written by Tim
64 | * Hudson (tjh@cryptsoft.com).
65 | *
66 | */
67 |
68 | Original SSLeay License
69 | -----------------------
70 |
71 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
72 | * All rights reserved.
73 | *
74 | * This package is an SSL implementation written
75 | * by Eric Young (eay@cryptsoft.com).
76 | * The implementation was written so as to conform with Netscapes SSL.
77 | *
78 | * This library is free for commercial and non-commercial use as long as
79 | * the following conditions are aheared to. The following conditions
80 | * apply to all code found in this distribution, be it the RC4, RSA,
81 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
82 | * included with this distribution is covered by the same copyright terms
83 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
84 | *
85 | * Copyright remains Eric Young's, and as such any Copyright notices in
86 | * the code are not to be removed.
87 | * If this package is used in a product, Eric Young should be given attribution
88 | * as the author of the parts of the library used.
89 | * This can be in the form of a textual message at program startup or
90 | * in documentation (online or textual) provided with the package.
91 | *
92 | * Redistribution and use in source and binary forms, with or without
93 | * modification, are permitted provided that the following conditions
94 | * are met:
95 | * 1. Redistributions of source code must retain the copyright
96 | * notice, this list of conditions and the following disclaimer.
97 | * 2. Redistributions in binary form must reproduce the above copyright
98 | * notice, this list of conditions and the following disclaimer in the
99 | * documentation and/or other materials provided with the distribution.
100 | * 3. All advertising materials mentioning features or use of this software
101 | * must display the following acknowledgement:
102 | * "This product includes cryptographic software written by
103 | * Eric Young (eay@cryptsoft.com)"
104 | * The word 'cryptographic' can be left out if the rouines from the library
105 | * being used are not cryptographic related :-).
106 | * 4. If you include any Windows specific code (or a derivative thereof) from
107 | * the apps directory (application code) you must include an acknowledgement:
108 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
109 | *
110 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
111 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
112 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
113 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
114 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
115 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
116 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
117 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
118 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
119 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
120 | * SUCH DAMAGE.
121 | *
122 | * The licence and distribution terms for any publically available version or
123 | * derivative of this code cannot be changed. i.e. this code cannot simply be
124 | * copied and put under another distribution licence
125 | * [including the GNU Public Licence.]
126 | */
127 |
128 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/chachapoly/README.md:
--------------------------------------------------------------------------------
1 | # ChaChaPoly
2 |
3 | This is an RFC 7539 compliant ChaCha20-Poly1305 AEAD implementation. The underlying ChaCha20 implementation used is the original implementation from D. J. Bernstein with changes to the nonce/counter split as required by RFC7539. The Poly1305 implementation is poly1305-donna.
4 |
5 | The AEAD code has been designed to be as simple, easy to understand and small as possible. That means no particular architecture specific optimizations are included. The ChaCha20 and Poly1305 implementations were also chosen with this in mind.
6 |
7 | An additional AEAD construction is included that reuses 32 byte of keystream that are otherwise thrown away for encryption or decryption of small messages. Use this at your own risk!
8 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/chachapoly/chacha.h:
--------------------------------------------------------------------------------
1 | /*
2 | chacha-merged.c version 20080118
3 | D. J. Bernstein
4 | Public domain.
5 | */
6 |
7 | #ifndef CHACHA_H
8 | #define CHACHA_H
9 |
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | #define CHACHA_MINKEYLEN 16
16 | #define CHACHA_NONCELEN 8
17 | #define CHACHA_CTRLEN 8
18 | #define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN)
19 | #define CHACHA_BLOCKLEN 64
20 |
21 | /* use memcpy() to copy blocks of memory (typically faster) */
22 | #define USE_MEMCPY 1
23 | /* use unaligned little-endian load/store (can be faster) */
24 | #define USE_UNALIGNED 0
25 |
26 | struct chacha_ctx {
27 | uint32_t input[16];
28 | };
29 |
30 | void chacha_keysetup(struct chacha_ctx *x, const unsigned char *k,
31 | uint32_t kbits);
32 | void chacha_ivsetup(struct chacha_ctx *x, const unsigned char *iv,
33 | const unsigned char *ctr);
34 | void chacha_encrypt_bytes(struct chacha_ctx *x, const unsigned char *m,
35 | unsigned char *c, uint32_t bytes);
36 |
37 | #endif /* CHACHA_H */
38 |
39 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/chachapoly/chachapoly-test.c:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License (MIT)
3 | *
4 | * Copyright (c) 2015 Grigori Goronzy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #include
26 | #include "chachapoly.h"
27 |
28 | /* AEAD test vector from RFC 7539 */
29 | int chachapoly_test_rfc7539(void)
30 | {
31 | unsigned char tag[16];
32 | unsigned char ct[114];
33 | int i, ret;
34 | struct chachapoly_ctx ctx;
35 |
36 | unsigned char key[32] = {
37 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
38 | 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f
39 | };
40 | unsigned char ad[12] = {
41 | 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7
42 | };
43 | unsigned char pt[114];
44 | memcpy(pt, "Ladies and Gentlemen of the class of '99: If I could offer you "
45 | "only one tip for the future, sunscreen would be it.", 114);
46 | unsigned char nonce[12] = {
47 | 0x07, 0x00, 0x00, 0x00,
48 | 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47
49 | };
50 | unsigned char tag_verify[16] = {
51 | 0x1a, 0xe1, 0x0b, 0x59, 0x4f, 0x09, 0xe2, 0x6a, 0x7e, 0x90, 0x2e, 0xcb, 0xd0, 0x60, 0x06, 0x91
52 | };
53 | unsigned char ct_verify[114] = {
54 | 0xd3, 0x1a, 0x8d, 0x34, 0x64, 0x8e, 0x60, 0xdb, 0x7b, 0x86, 0xaf, 0xbc, 0x53, 0xef, 0x7e, 0xc2,
55 | 0xa4, 0xad, 0xed, 0x51, 0x29, 0x6e, 0x08, 0xfe, 0xa9, 0xe2, 0xb5, 0xa7, 0x36, 0xee, 0x62, 0xd6,
56 | 0x3d, 0xbe, 0xa4, 0x5e, 0x8c, 0xa9, 0x67, 0x12, 0x82, 0xfa, 0xfb, 0x69, 0xda, 0x92, 0x72, 0x8b,
57 | 0x1a, 0x71, 0xde, 0x0a, 0x9e, 0x06, 0x0b, 0x29, 0x05, 0xd6, 0xa5, 0xb6, 0x7e, 0xcd, 0x3b, 0x36,
58 | 0x92, 0xdd, 0xbd, 0x7f, 0x2d, 0x77, 0x8b, 0x8c, 0x98, 0x03, 0xae, 0xe3, 0x28, 0x09, 0x1b, 0x58,
59 | 0xfa, 0xb3, 0x24, 0xe4, 0xfa, 0xd6, 0x75, 0x94, 0x55, 0x85, 0x80, 0x8b, 0x48, 0x31, 0xd7, 0xbc,
60 | 0x3f, 0xf4, 0xde, 0xf0, 0x8e, 0x4b, 0x7a, 0x9d, 0xe5, 0x76, 0xd2, 0x65, 0x86, 0xce, 0xc6, 0x4b,
61 | 0x61, 0x16
62 | };
63 |
64 | chachapoly_init(&ctx, key, 256);
65 | chachapoly_crypt(&ctx, nonce, ad, 12, pt, 114, ct, tag, 16, 1);
66 |
67 | for (i = 0; i < 114; i++) {
68 | if (ct[i] != ct_verify[i]) {
69 | return -2;
70 | }
71 | }
72 |
73 | for (i = 0; i < 16; i++) {
74 | if (tag[i] != tag_verify[i]) {
75 | return -3;
76 | }
77 | }
78 |
79 | ret = chachapoly_crypt(&ctx, nonce, ad, 12, ct, 114, pt, tag, 16, 0);
80 |
81 | return ret;
82 | }
83 |
84 | /* AEAD auth-only case */
85 | int chachapoly_test_auth_only(void)
86 | {
87 | unsigned char tag[16];
88 | int i, ret;
89 | struct chachapoly_ctx ctx;
90 |
91 | unsigned char key[32] = {
92 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
93 | 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f
94 | };
95 | unsigned char pt[114];
96 | memcpy(pt, "Ladies and Gentlemen of the class of '99: If I could offer you "
97 | "only one tip for the future, sunscreen would be it.", 114);
98 | unsigned char nonce[12] = {
99 | 0x07, 0x00, 0x00, 0x00,
100 | 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47
101 | };
102 | unsigned char tag_verify[16] = {
103 | 0x03, 0xDC, 0xD0, 0x84, 0x04, 0x67, 0x80, 0xE6, 0x39, 0x50, 0x67, 0x0D, 0x3B, 0xBC, 0xC8, 0x95
104 | };
105 |
106 | chachapoly_init(&ctx, key, 256);
107 | chachapoly_crypt(&ctx, nonce, pt, 114, NULL, 0, NULL, tag, 16, 1);
108 |
109 | for (i = 0; i < 16; i++) {
110 | if (tag[i] != tag_verify[i]) {
111 | return -3;
112 | }
113 | }
114 |
115 | ret = chachapoly_crypt(&ctx, nonce, pt, 114, NULL, 0, NULL, tag, 16, 0);
116 |
117 | return ret;
118 | }
119 |
120 | int main(int argc, char **argv)
121 | {
122 | int res = chachapoly_test_rfc7539();
123 | printf("%s = %d\n", "rfc7539", res);
124 | res = chachapoly_test_auth_only();
125 | printf("%s = %d\n", "auth_only", res);
126 | }
127 |
128 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/chachapoly/chachapoly.c:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License (MIT)
3 | *
4 | * Copyright (c) 2015 Grigori Goronzy
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #include "chachapoly.h"
31 |
32 | /**
33 | * Constant-time memory compare. This should help to protect against
34 | * side-channel attacks.
35 | *
36 | * \param av input 1
37 | * \param bv input 2
38 | * \param n bytes to compare
39 | * \return 0 if inputs are equal
40 | */
41 | static int memcmp_eq(const void *av, const void *bv, int n)
42 | {
43 | const unsigned char *a = (const unsigned char*) av;
44 | const unsigned char *b = (const unsigned char*) bv;
45 | unsigned char res = 0;
46 | int i;
47 |
48 | for (i = 0; i < n; i++) {
49 | res |= *a ^ *b;
50 | a++;
51 | b++;
52 | }
53 |
54 | return res;
55 | }
56 |
57 | /**
58 | * Poly1305 tag generation. This concatenates a string according to the rules
59 | * outlined in RFC 7539 and calculates the tag.
60 | *
61 | * \param poly_key 32 byte secret one-time key for poly1305
62 | * \param ad associated data
63 | * \param ad_len associated data length in bytes
64 | * \param ct ciphertext
65 | * \param ct_len ciphertext length in bytes
66 | * \param tag pointer to 16 bytes for tag storage
67 | */
68 | static void poly1305_get_tag(unsigned char *poly_key, const void *ad,
69 | int ad_len, const void *ct, int ct_len, unsigned char *tag)
70 | {
71 | struct poly1305_context poly;
72 | unsigned left_over;
73 | uint64_t len;
74 | unsigned char pad[16];
75 |
76 | poly1305_init(&poly, poly_key);
77 | memset(&pad, 0, sizeof(pad));
78 |
79 | /* associated data and padding */
80 | poly1305_update(&poly, ad, ad_len);
81 | left_over = ad_len % 16;
82 | if (left_over)
83 | poly1305_update(&poly, pad, 16 - left_over);
84 |
85 | /* payload and padding */
86 | poly1305_update(&poly, ct, ct_len);
87 | left_over = ct_len % 16;
88 | if (left_over)
89 | poly1305_update(&poly, pad, 16 - left_over);
90 |
91 | /* lengths */
92 | len = ad_len;
93 | poly1305_update(&poly, (unsigned char *)&len, 8);
94 | len = ct_len;
95 | poly1305_update(&poly, (unsigned char *)&len, 8);
96 |
97 | poly1305_finish(&poly, tag);
98 | }
99 |
100 | int chachapoly_init(struct chachapoly_ctx *ctx, const void *key, int key_len)
101 | {
102 | assert (key_len == 128 || key_len == 256);
103 |
104 | memset(ctx, 0, sizeof(*ctx));
105 | chacha_keysetup(&ctx->cha_ctx, key, key_len);
106 | return CHACHAPOLY_OK;
107 | }
108 |
109 | int chachapoly_crypt(struct chachapoly_ctx *ctx, const void *nonce,
110 | const void *ad, int ad_len, void *input, int input_len,
111 | void *output, void *tag, int tag_len, int encrypt)
112 | {
113 | unsigned char poly_key[CHACHA_BLOCKLEN];
114 | unsigned char calc_tag[POLY1305_TAGLEN];
115 | const unsigned char one[4] = { 1, 0, 0, 0 };
116 |
117 | /* initialize keystream and generate poly1305 key */
118 | memset(poly_key, 0, sizeof(poly_key));
119 | chacha_ivsetup(&ctx->cha_ctx, nonce, NULL);
120 | chacha_encrypt_bytes(&ctx->cha_ctx, poly_key, poly_key, sizeof(poly_key));
121 |
122 | /* check tag if decrypting */
123 | if (encrypt == 0 && tag_len) {
124 | poly1305_get_tag(poly_key, ad, ad_len, input, input_len, calc_tag);
125 | if (memcmp_eq(calc_tag, tag, tag_len) != 0) {
126 | return CHACHAPOLY_INVALID_MAC;
127 | }
128 | }
129 |
130 | /* crypt data */
131 | chacha_ivsetup(&ctx->cha_ctx, nonce, one);
132 | chacha_encrypt_bytes(&ctx->cha_ctx, (unsigned char *)input,
133 | (unsigned char *)output, input_len);
134 |
135 | /* add tag if encrypting */
136 | if (encrypt && tag_len) {
137 | poly1305_get_tag(poly_key, ad, ad_len, output, input_len, calc_tag);
138 | memcpy(tag, calc_tag, tag_len);
139 | }
140 |
141 | return CHACHAPOLY_OK;
142 | }
143 |
144 | int chachapoly_crypt_short(struct chachapoly_ctx *ctx, const void *nonce,
145 | const void *ad, int ad_len, void *input, int input_len,
146 | void *output, void *tag, int tag_len, int encrypt)
147 | {
148 | unsigned char keystream[CHACHA_BLOCKLEN];
149 | unsigned char calc_tag[POLY1305_TAGLEN];
150 | int i;
151 |
152 | assert(input_len <= 32);
153 |
154 | /* initialize keystream and generate poly1305 key */
155 | memset(keystream, 0, sizeof(keystream));
156 | chacha_ivsetup(&ctx->cha_ctx, nonce, NULL);
157 | chacha_encrypt_bytes(&ctx->cha_ctx, keystream, keystream,
158 | sizeof(keystream));
159 |
160 | /* check tag if decrypting */
161 | if (encrypt == 0 && tag_len) {
162 | poly1305_get_tag(keystream, ad, ad_len, input, input_len, calc_tag);
163 | if (memcmp_eq(calc_tag, tag, tag_len) != 0) {
164 | return CHACHAPOLY_INVALID_MAC;
165 | }
166 | }
167 |
168 | /* crypt data */
169 | for (i = 0; i < input_len; i++) {
170 | ((unsigned char *)output)[i] =
171 | ((unsigned char *)input)[i] ^ keystream[32 + i];
172 | }
173 |
174 | /* add tag if encrypting */
175 | if (encrypt && tag_len) {
176 | poly1305_get_tag(keystream, ad, ad_len, output, input_len, calc_tag);
177 | memcpy(tag, calc_tag, tag_len);
178 | }
179 |
180 | return CHACHAPOLY_OK;
181 | }
182 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/chachapoly/chachapoly.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifndef CHACHAPOLY_H
4 | #define CHACHAPOLY_H
5 |
6 | #include "chacha.h"
7 | #include "poly1305.h"
8 |
9 | #define CHACHAPOLY_OK 0
10 | #define CHACHAPOLY_INVALID_MAC -1
11 |
12 | struct chachapoly_ctx {
13 | struct chacha_ctx cha_ctx;
14 | };
15 |
16 | /**
17 | * Initialize ChaCha20-Poly1305 AEAD.
18 | * For RFC 7539 conformant AEAD, 256 bit keys must be used.
19 | *
20 | * \param ctx context data
21 | * \param key 16 or 32 bytes of key material
22 | * \param key_len key length, 256 or 512 bits
23 | * \return success if 0
24 | */
25 | int chachapoly_init(struct chachapoly_ctx *ctx, const void *key, int key_len);
26 |
27 | /**
28 | * Encrypt or decrypt with ChaCha20-Poly1305. The AEAD construction conforms
29 | * to RFC 7539.
30 | *
31 | * \param ctx context data
32 | * \param nonce nonce (12 bytes)
33 | * \param ad associated data
34 | * \param ad_len associated data length in bytes
35 | * \param input plaintext/ciphertext input
36 | * \param input_len input length in bytes;
37 | * \param output plaintext/ciphertext output
38 | * \param tag tag output
39 | * \param tag_len tag length in bytes (0-16);
40 | if 0, authentification is skipped
41 | * \param encrypt decrypt if 0, else encrypt
42 | * \return CHACHAPOLY_OK if no error, CHACHAPOLY_INVALID_MAC if auth
43 | * failed when decrypting
44 | */
45 | int chachapoly_crypt(struct chachapoly_ctx *ctx, const void *nonce,
46 | const void *ad, int ad_len, void *input, int input_len,
47 | void *output, void *tag, int tag_len, int encrypt);
48 |
49 | /**
50 | * Encrypt or decrypt with Chacha20-Poly1305 for short messages.
51 | * The AEAD construction is different from chachapoly_crypt, but more
52 | * efficient for small messages. Up to 32 bytes can be encrypted. The size
53 | * of associated data is not restricted. The interface is similar to
54 | * chachapoly_crypt.
55 | */
56 | int chachapoly_crypt_short(struct chachapoly_ctx *ctx, const void *nonce,
57 | const void *ad, int ad_len, void *input, int input_len,
58 | void *output, void *tag, int tag_len, int encrypt);
59 |
60 | #endif
61 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/chachapoly/poly1305.h:
--------------------------------------------------------------------------------
1 | #ifndef POLY1305_H
2 | #define POLY1305_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #define POLY1305_KEYLEN 32
9 | #define POLY1305_TAGLEN 16
10 | #define POLY1305_BLOCK_SIZE 16
11 |
12 | /* use memcpy() to copy blocks of memory (typically faster) */
13 | #define USE_MEMCPY 1
14 | /* use unaligned little-endian load/store (can be faster) */
15 | #define USE_UNALIGNED 0
16 |
17 | struct poly1305_context {
18 | uint32_t r[5];
19 | uint32_t h[5];
20 | uint32_t pad[4];
21 | size_t leftover;
22 | unsigned char buffer[POLY1305_BLOCK_SIZE];
23 | unsigned char final;
24 | };
25 |
26 | void poly1305_init(struct poly1305_context *ctx, const unsigned char key[32]);
27 | void poly1305_update(struct poly1305_context *ctx, const unsigned char *m, size_t bytes);
28 | void poly1305_finish(struct poly1305_context *ctx, unsigned char mac[16]);
29 | void poly1305_auth(unsigned char mac[16], const unsigned char *m, size_t bytes, const unsigned char key[32]);
30 |
31 | #endif /* POLY1305_H */
32 |
33 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/csrp/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Tom Cocagne
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 | of the Software, and to permit persons to whom the Software is furnished to do
10 | so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/csrp/README.md:
--------------------------------------------------------------------------------
1 | csrp
2 | ====
3 | Tom Cocagne <tom.cocagne@gmail.com>
4 |
5 | csrp is a minimal C implementation of the [Secure Remote Password
6 | protocol](http://srp.stanford.edu/). The project consists of a single
7 | C file and is intended for direct inclusion into utilizing programs.
8 | It's only dependency is OpenSSL.
9 |
10 | *NOTE* This SRP implementation was created before the hashing algoritim specified
11 | in RFC 5054 became the de-facto standard for interoperable SRP implementations.
12 | The rfc5054_compat branch of this repository uses the RFC 5054 hashing algorithms
13 | and is known to be compatible with other SRP implementations. If this version works
14 | for you, please consider submitting a patch to this library that implements both the
15 | original default and the RFC 5054 implementation to allow a single mainline version
16 | of this library going forward.
17 |
18 |
19 | SRP Overview
20 | ------------
21 |
22 | SRP is a cryptographically strong authentication
23 | protocol for password-based, mutual authentication over an insecure
24 | network connection.
25 |
26 | Unlike other common challenge-response autentication protocols, such
27 | as Kerberos and SSL, SRP does not rely on an external infrastructure
28 | of trusted key servers or certificate management. Instead, SRP server
29 | applications use verification keys derived from each user's password
30 | to determine the authenticity of a network connection.
31 |
32 | SRP provides mutual-authentication in that successful authentication
33 | requires both sides of the connection to have knowledge of the
34 | user's password. If the client side lacks the user's password or the
35 | server side lacks the proper verification key, the authentication will
36 | fail.
37 |
38 | Unlike SSL, SRP does not directly encrypt all data flowing through
39 | the authenticated connection. However, successful authentication does
40 | result in a cryptographically strong shared key that can be used
41 | for symmetric-key encryption.
42 |
43 | This library serves as the basis for a compatible Python module called
44 | [pysrp](https://github.com/cocagne/pysrp). The
45 | [pysrp](https://github.com/cocagne/pysrp) project contains complete,
46 | user-friendly API documentation as well as a comprehensive overview of the SRP
47 | protocol. As the APIs are virtually identical, the [pysrp
48 | documentation](http://pythonhosted.org/srp/) is an excellent reference for
49 | understanding this library.
50 |
51 |
52 | Usage Example
53 | -------------
54 |
55 | ```c
56 | #include
57 | #include
58 | #include
59 |
60 | #include "srp.h"
61 |
62 |
63 | int main( int argc, char * argv[] )
64 | {
65 | int auth_failed = 1;
66 |
67 | struct SRPVerifier * ver;
68 | struct SRPUser * usr;
69 |
70 | const unsigned char * bytes_s = 0;
71 | const unsigned char * bytes_v = 0;
72 | const unsigned char * bytes_A = 0;
73 | const unsigned char * bytes_B = 0;
74 |
75 | const unsigned char * bytes_M = 0;
76 | const unsigned char * bytes_HAMK = 0;
77 |
78 | int len_s = 0;
79 | int len_v = 0;
80 | int len_A = 0;
81 | int len_B = 0;
82 | int len_M = 0;
83 |
84 | const char * username = "testuser";
85 | const char * password = "password";
86 |
87 | const char * auth_username = 0;
88 |
89 | SRP_HashAlgorithm alg = SRP_SHA1;
90 | SRP_NGType ng_type = SRP_NG_2048;
91 |
92 | /* Create a salt+verification key for the user's password. The salt and
93 | * key need to be computed at the time the user's password is set and
94 | * must be stored by the server-side application for use during the
95 | * authentication process.
96 | */
97 | srp_create_salted_verification_key( alg, ng_type, username,
98 | (const unsigned char *)password,
99 | strlen(password),
100 | &bytes_s, &len_s,
101 | &bytes_v, &len_v,
102 | NULL, NULL );
103 |
104 | /* Begin authentication process */
105 | usr = srp_user_new( alg, ng_type, username,
106 | (const unsigned char *)password,
107 | strlen(password), NULL, NULL );
108 |
109 | srp_user_start_authentication( usr, &auth_username, &bytes_A, &len_A );
110 |
111 | /* User -> Host: (username, bytes_A) */
112 | ver = srp_verifier_new( alg, ng_type, username, bytes_s, len_s, bytes_v, len_v,
113 | bytes_A, len_A, & bytes_B, &len_B, NULL, NULL );
114 |
115 | if ( !bytes_B ) {
116 | printf("Verifier SRP-6a safety check violated!\n");
117 | goto auth_failed;
118 | }
119 |
120 | /* Host -> User: (bytes_s, bytes_B) */
121 | srp_user_process_challenge( usr, bytes_s, len_s, bytes_B, len_B, &bytes_M, &len_M );
122 |
123 | if ( !bytes_M ) {
124 | printf("User SRP-6a safety check violation!\n");
125 | goto auth_failed;
126 | }
127 |
128 | /* User -> Host: (bytes_M) */
129 | srp_verifier_verify_session( ver, bytes_M, &bytes_HAMK );
130 |
131 | if ( !bytes_HAMK ) {
132 | printf("User authentication failed!\n");
133 | goto auth_failed;
134 | }
135 |
136 | /* Host -> User: (HAMK) */
137 | srp_user_verify_session( usr, bytes_HAMK );
138 |
139 | if ( !srp_user_is_authenticated(usr) ) {
140 | printf("Server authentication failed!\n");
141 | goto auth_failed;
142 | }
143 |
144 | auth_failed = 0; /* auth success! */
145 |
146 | auth_failed:
147 | srp_verifier_delete( ver );
148 | srp_user_delete( usr );
149 |
150 | free( (char *)bytes_s );
151 | free( (char *)bytes_v );
152 |
153 | return auth_failed;
154 | }
155 | ```
156 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/csrp/test_srp.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 |
7 | #include "srp.h"
8 |
9 |
10 | #define NITER 100
11 | #define TEST_HASH SRP_SHA1
12 | #define TEST_NG SRP_NG_1024
13 |
14 | unsigned long long get_usec()
15 | {
16 | struct timeval t;
17 | gettimeofday(&t, NULL);
18 | return (((unsigned long long)t.tv_sec) * 1000000) + t.tv_usec;
19 | }
20 |
21 | const char * test_n_hex = "EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496"
22 | "EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD15DC7D7B46154D6B6CE8E"
23 | "F4AD69B15D4982559B297BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA"
24 | "9AFD5138FE8376435B9FC61D2FC0EB06E3";
25 | const char * test_g_hex = "2";
26 |
27 |
28 | int main( int argc, char * argv[] )
29 | {
30 | struct SRPVerifier * ver;
31 | struct SRPUser * usr;
32 |
33 | const unsigned char * bytes_s = 0;
34 | const unsigned char * bytes_v = 0;
35 | const unsigned char * bytes_A = 0;
36 | const unsigned char * bytes_B = 0;
37 |
38 | const unsigned char * bytes_M = 0;
39 | const unsigned char * bytes_HAMK = 0;
40 |
41 | int len_s = 0;
42 | int len_v = 0;
43 | int len_A = 0;
44 | int len_B = 0;
45 | int len_M = 0;
46 | int i;
47 |
48 | unsigned long long start;
49 | unsigned long long duration;
50 |
51 | const char * username = "testuser";
52 | const char * password = "password";
53 |
54 | const char * auth_username = 0;
55 | const char * n_hex = 0;
56 | const char * g_hex = 0;
57 |
58 | SRP_HashAlgorithm alg = TEST_HASH;
59 | SRP_NGType ng_type = SRP_NG_8192; //TEST_NG;
60 |
61 | if (ng_type == SRP_NG_CUSTOM)
62 | {
63 | n_hex = test_n_hex;
64 | g_hex = test_g_hex;
65 | }
66 |
67 |
68 | srp_create_salted_verification_key( alg, ng_type, username,
69 | (const unsigned char *)password,
70 | strlen(password),
71 | &bytes_s, &len_s, &bytes_v, &len_v, n_hex, g_hex );
72 |
73 |
74 |
75 | start = get_usec();
76 |
77 | for( i = 0; i < NITER; i++ )
78 | {
79 | usr = srp_user_new( alg, ng_type, username,
80 | (const unsigned char *)password,
81 | strlen(password), n_hex, g_hex );
82 |
83 | srp_user_start_authentication( usr, &auth_username, &bytes_A, &len_A );
84 |
85 | /* User -> Host: (username, bytes_A) */
86 | ver = srp_verifier_new( alg, ng_type, username, bytes_s, len_s, bytes_v, len_v,
87 | bytes_A, len_A, & bytes_B, &len_B, n_hex, g_hex );
88 |
89 | if ( !bytes_B )
90 | {
91 | printf("Verifier SRP-6a safety check violated!\n");
92 | goto cleanup;
93 | }
94 |
95 | /* Host -> User: (bytes_s, bytes_B) */
96 | srp_user_process_challenge( usr, bytes_s, len_s, bytes_B, len_B, &bytes_M, &len_M );
97 |
98 | if ( !bytes_M )
99 | {
100 | printf("User SRP-6a safety check violation!\n");
101 | goto cleanup;
102 | }
103 |
104 | /* User -> Host: (bytes_M) */
105 | srp_verifier_verify_session( ver, bytes_M, &bytes_HAMK );
106 |
107 | if ( !bytes_HAMK )
108 | {
109 | printf("User authentication failed!\n");
110 | goto cleanup;
111 | }
112 |
113 | /* Host -> User: (HAMK) */
114 | srp_user_verify_session( usr, bytes_HAMK );
115 |
116 | if ( !srp_user_is_authenticated(usr) )
117 | {
118 | printf("Server authentication failed!\n");
119 | }
120 |
121 | cleanup:
122 | srp_verifier_delete( ver );
123 | srp_user_delete( usr );
124 | }
125 |
126 | duration = get_usec() - start;
127 |
128 | printf("Usec per call: %d\n", (int)(duration / NITER));
129 |
130 |
131 | free( (char *)bytes_s );
132 | free( (char *)bytes_v );
133 |
134 | return 0;
135 | }
136 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/curve25519/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.4.1)
2 | aux_source_directory(. curve25519_src)
3 | set(DIR_SRCS ${curve25519_src})
4 | add_library( curve25519
5 | STATIC
6 | ${DIR_SRCS})
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/curve25519/curve25519.h:
--------------------------------------------------------------------------------
1 | #ifndef CURVE25519_DONNA_H
2 | #define CURVE25519_DONNA_H
3 |
4 | static const unsigned char kCurve25519BasePoint[32] = { 9 };
5 |
6 | int curve25519_donna(unsigned char *mypublic, const unsigned char *secret, const unsigned char *basepoint);
7 |
8 | #endif
9 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.4.1)
2 | aux_source_directory(. ed25519_src)
3 | set(DIR_SRCS ${ed25519_src})
4 | add_library( ed25519
5 | STATIC
6 | ${DIR_SRCS})
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/add_scalar.c:
--------------------------------------------------------------------------------
1 | #include "ed25519.h"
2 | #include "ge.h"
3 | #include "sc.h"
4 | #include "sha512.h"
5 |
6 |
7 | /* see http://crypto.stackexchange.com/a/6215/4697 */
8 | void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar) {
9 | const unsigned char SC_1[32] = {1}; /* scalar with value 1 */
10 |
11 | unsigned char n[32];
12 | ge_p3 nB;
13 | ge_p1p1 A_p1p1;
14 | ge_p3 A;
15 | ge_p3 public_key_unpacked;
16 | ge_cached T;
17 |
18 | sha512_context hash;
19 | unsigned char hashbuf[64];
20 |
21 | int i;
22 |
23 | /* copy the scalar and clear highest bit */
24 | for (i = 0; i < 31; ++i) {
25 | n[i] = scalar[i];
26 | }
27 | n[31] = scalar[31] & 127;
28 |
29 | /* private key: a = n + t */
30 | if (private_key) {
31 | sc_muladd(private_key, SC_1, n, private_key);
32 |
33 | // https://github.com/orlp/ed25519/issues/3
34 | sha512_init(&hash);
35 | sha512_update(&hash, private_key + 32, 32);
36 | sha512_update(&hash, scalar, 32);
37 | sha512_final(&hash, hashbuf);
38 | for (i = 0; i < 32; ++i) {
39 | private_key[32 + i] = hashbuf[i];
40 | }
41 | }
42 |
43 | /* public key: A = nB + T */
44 | if (public_key) {
45 | /* if we know the private key we don't need a point addition, which is faster */
46 | /* using a "timing attack" you could find out wether or not we know the private
47 | key, but this information seems rather useless - if this is important pass
48 | public_key and private_key seperately in 2 function calls */
49 | if (private_key) {
50 | ge_scalarmult_base(&A, private_key);
51 | } else {
52 | /* unpack public key into T */
53 | ge_frombytes_negate_vartime(&public_key_unpacked, public_key);
54 | fe_neg(public_key_unpacked.X, public_key_unpacked.X); /* undo negate */
55 | fe_neg(public_key_unpacked.T, public_key_unpacked.T); /* undo negate */
56 | ge_p3_to_cached(&T, &public_key_unpacked);
57 |
58 | /* calculate n*B */
59 | ge_scalarmult_base(&nB, n);
60 |
61 | /* A = n*B + T */
62 | ge_add(&A_p1p1, &nB, &T);
63 | ge_p1p1_to_p3(&A, &A_p1p1);
64 | }
65 |
66 | /* pack public key */
67 | ge_p3_tobytes(public_key, &A);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/ed25519.h:
--------------------------------------------------------------------------------
1 | #ifndef ED25519_H
2 | #define ED25519_H
3 |
4 | #include
5 |
6 | #if defined(_WIN32)
7 | #if defined(ED25519_BUILD_DLL)
8 | #define ED25519_DECLSPEC __declspec(dllexport)
9 | #elif defined(ED25519_DLL)
10 | #define ED25519_DECLSPEC __declspec(dllimport)
11 | #else
12 | #define ED25519_DECLSPEC
13 | #endif
14 | #else
15 | #define ED25519_DECLSPEC
16 | #endif
17 |
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | #ifndef ED25519_NO_SEED
24 | int ED25519_DECLSPEC ed25519_create_seed(unsigned char *seed);
25 | #endif
26 |
27 | void ED25519_DECLSPEC ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed);
28 | void ED25519_DECLSPEC ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key);
29 | int ED25519_DECLSPEC ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key);
30 | void ED25519_DECLSPEC ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar);
31 | void ED25519_DECLSPEC ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key);
32 |
33 |
34 | #ifdef __cplusplus
35 | }
36 | #endif
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/fe.h:
--------------------------------------------------------------------------------
1 | #ifndef FE_H
2 | #define FE_H
3 |
4 | #include "fixedint.h"
5 |
6 |
7 | /*
8 | fe means field element.
9 | Here the field is \Z/(2^255-19).
10 | An element t, entries t[0]...t[9], represents the integer
11 | t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
12 | Bounds on each t[i] vary depending on context.
13 | */
14 |
15 |
16 | typedef int32_t fe[10];
17 |
18 |
19 | void fe_0(fe h);
20 | void fe_1(fe h);
21 |
22 | void fe_frombytes(fe h, const unsigned char *s);
23 | void fe_tobytes(unsigned char *s, const fe h);
24 |
25 | void fe_copy(fe h, const fe f);
26 | int fe_isnegative(const fe f);
27 | int fe_isnonzero(const fe f);
28 | void fe_cmov(fe f, const fe g, unsigned int b);
29 | void fe_cswap(fe f, fe g, unsigned int b);
30 |
31 | void fe_neg(fe h, const fe f);
32 | void fe_add(fe h, const fe f, const fe g);
33 | void fe_invert(fe out, const fe z);
34 | void fe_sq(fe h, const fe f);
35 | void fe_sq2(fe h, const fe f);
36 | void fe_mul(fe h, const fe f, const fe g);
37 | void fe_mul121666(fe h, fe f);
38 | void fe_pow22523(fe out, const fe z);
39 | void fe_sub(fe h, const fe f, const fe g);
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/fixedint.h:
--------------------------------------------------------------------------------
1 | /*
2 | Portable header to provide the 32 and 64 bits type.
3 |
4 | Not a compatible replacement for , do not blindly use it as such.
5 | */
6 |
7 | #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined(__UINT_FAST64_TYPE__)) )) && !defined(FIXEDINT_H_INCLUDED)
8 | #include
9 | #define FIXEDINT_H_INCLUDED
10 |
11 | #if defined(__WATCOMC__) && __WATCOMC__ >= 1250 && !defined(UINT64_C)
12 | #include
13 | #define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
14 | #endif
15 | #endif
16 |
17 |
18 | #ifndef FIXEDINT_H_INCLUDED
19 | #define FIXEDINT_H_INCLUDED
20 |
21 | #include
22 |
23 | /* (u)int32_t */
24 | #ifndef uint32_t
25 | #if (ULONG_MAX == 0xffffffffUL)
26 | typedef unsigned long uint32_t;
27 | #elif (UINT_MAX == 0xffffffffUL)
28 | typedef unsigned int uint32_t;
29 | #elif (USHRT_MAX == 0xffffffffUL)
30 | typedef unsigned short uint32_t;
31 | #endif
32 | #endif
33 |
34 |
35 | #ifndef int32_t
36 | #if (LONG_MAX == 0x7fffffffL)
37 | typedef signed long int32_t;
38 | #elif (INT_MAX == 0x7fffffffL)
39 | typedef signed int int32_t;
40 | #elif (SHRT_MAX == 0x7fffffffL)
41 | typedef signed short int32_t;
42 | #endif
43 | #endif
44 |
45 |
46 | /* (u)int64_t */
47 | #if (defined(__STDC__) && defined(__STDC_VERSION__) && __STDC__ && __STDC_VERSION__ >= 199901L)
48 | typedef long long int64_t;
49 | typedef unsigned long long uint64_t;
50 |
51 | #define UINT64_C(v) v ##ULL
52 | #define INT64_C(v) v ##LL
53 | #elif defined(__GNUC__)
54 | __extension__ typedef long long int64_t;
55 | __extension__ typedef unsigned long long uint64_t;
56 |
57 | #define UINT64_C(v) v ##ULL
58 | #define INT64_C(v) v ##LL
59 | #elif defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__APPLE_CC__) || defined(_LONG_LONG) || defined(_CRAYC)
60 | typedef long long int64_t;
61 | typedef unsigned long long uint64_t;
62 |
63 | #define UINT64_C(v) v ##ULL
64 | #define INT64_C(v) v ##LL
65 | #elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined(__BORLANDC__) && __BORLANDC__ > 0x460) || defined(__alpha) || defined(__DECC)
66 | typedef __int64 int64_t;
67 | typedef unsigned __int64 uint64_t;
68 |
69 | #define UINT64_C(v) v ##UI64
70 | #define INT64_C(v) v ##I64
71 | #endif
72 | #endif
73 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/ge.h:
--------------------------------------------------------------------------------
1 | #ifndef GE_H
2 | #define GE_H
3 |
4 | #include "fe.h"
5 |
6 |
7 | /*
8 | ge means group element.
9 |
10 | Here the group is the set of pairs (x,y) of field elements (see fe.h)
11 | satisfying -x^2 + y^2 = 1 + d x^2y^2
12 | where d = -121665/121666.
13 |
14 | Representations:
15 | ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z
16 | ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT
17 | ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
18 | ge_precomp (Duif): (y+x,y-x,2dxy)
19 | */
20 |
21 | typedef struct {
22 | fe X;
23 | fe Y;
24 | fe Z;
25 | } ge_p2;
26 |
27 | typedef struct {
28 | fe X;
29 | fe Y;
30 | fe Z;
31 | fe T;
32 | } ge_p3;
33 |
34 | typedef struct {
35 | fe X;
36 | fe Y;
37 | fe Z;
38 | fe T;
39 | } ge_p1p1;
40 |
41 | typedef struct {
42 | fe yplusx;
43 | fe yminusx;
44 | fe xy2d;
45 | } ge_precomp;
46 |
47 | typedef struct {
48 | fe YplusX;
49 | fe YminusX;
50 | fe Z;
51 | fe T2d;
52 | } ge_cached;
53 |
54 | void ge_p3_tobytes(unsigned char *s, const ge_p3 *h);
55 | void ge_tobytes(unsigned char *s, const ge_p2 *h);
56 | int ge_frombytes_negate_vartime(ge_p3 *h, const unsigned char *s);
57 |
58 | void ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q);
59 | void ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q);
60 | void ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A, const unsigned char *b);
61 | void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q);
62 | void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q);
63 | void ge_scalarmult_base(ge_p3 *h, const unsigned char *a);
64 |
65 | void ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p);
66 | void ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p);
67 | void ge_p2_0(ge_p2 *h);
68 | void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p);
69 | void ge_p3_0(ge_p3 *h);
70 | void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p);
71 | void ge_p3_to_cached(ge_cached *r, const ge_p3 *p);
72 | void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p);
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/key_exchange.c:
--------------------------------------------------------------------------------
1 | #include "ed25519.h"
2 | #include "fe.h"
3 |
4 | void ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key) {
5 | unsigned char e[32];
6 | unsigned int i;
7 |
8 | fe x1;
9 | fe x2;
10 | fe z2;
11 | fe x3;
12 | fe z3;
13 | fe tmp0;
14 | fe tmp1;
15 |
16 | int pos;
17 | unsigned int swap;
18 | unsigned int b;
19 |
20 | /* copy the private key and make sure it's valid */
21 | for (i = 0; i < 32; ++i) {
22 | e[i] = private_key[i];
23 | }
24 |
25 | e[0] &= 248;
26 | e[31] &= 63;
27 | e[31] |= 64;
28 |
29 | /* unpack the public key and convert edwards to montgomery */
30 | /* due to CodesInChaos: montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p */
31 | fe_frombytes(x1, public_key);
32 | fe_1(tmp1);
33 | fe_add(tmp0, x1, tmp1);
34 | fe_sub(tmp1, tmp1, x1);
35 | fe_invert(tmp1, tmp1);
36 | fe_mul(x1, tmp0, tmp1);
37 |
38 | fe_1(x2);
39 | fe_0(z2);
40 | fe_copy(x3, x1);
41 | fe_1(z3);
42 |
43 | swap = 0;
44 | for (pos = 254; pos >= 0; --pos) {
45 | b = e[pos / 8] >> (pos & 7);
46 | b &= 1;
47 | swap ^= b;
48 | fe_cswap(x2, x3, swap);
49 | fe_cswap(z2, z3, swap);
50 | swap = b;
51 |
52 | /* from montgomery.h */
53 | fe_sub(tmp0, x3, z3);
54 | fe_sub(tmp1, x2, z2);
55 | fe_add(x2, x2, z2);
56 | fe_add(z2, x3, z3);
57 | fe_mul(z3, tmp0, x2);
58 | fe_mul(z2, z2, tmp1);
59 | fe_sq(tmp0, tmp1);
60 | fe_sq(tmp1, x2);
61 | fe_add(x3, z3, z2);
62 | fe_sub(z2, z3, z2);
63 | fe_mul(x2, tmp1, tmp0);
64 | fe_sub(tmp1, tmp1, tmp0);
65 | fe_sq(z2, z2);
66 | fe_mul121666(z3, tmp1);
67 | fe_sq(x3, x3);
68 | fe_add(tmp0, tmp0, z3);
69 | fe_mul(z3, x1, z2);
70 | fe_mul(z2, tmp1, tmp0);
71 | }
72 |
73 | fe_cswap(x2, x3, swap);
74 | fe_cswap(z2, z3, swap);
75 |
76 | fe_invert(z2, z2);
77 | fe_mul(x2, x2, z2);
78 | fe_tobytes(shared_secret, x2);
79 | }
80 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/keypair.c:
--------------------------------------------------------------------------------
1 | #include "ed25519.h"
2 | #include "sha512.h"
3 | #include "ge.h"
4 |
5 |
6 | void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed) {
7 | ge_p3 A;
8 |
9 | sha512(seed, 32, private_key);
10 | private_key[0] &= 248;
11 | private_key[31] &= 63;
12 | private_key[31] |= 64;
13 |
14 | ge_scalarmult_base(&A, private_key);
15 | ge_p3_tobytes(public_key, &A);
16 | }
17 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/sc.h:
--------------------------------------------------------------------------------
1 | #ifndef SC_H
2 | #define SC_H
3 |
4 | /*
5 | The set of scalars is \Z/l
6 | where l = 2^252 + 27742317777372353535851937790883648493.
7 | */
8 |
9 | void sc_reduce(unsigned char *s);
10 | void sc_muladd(unsigned char *s, const unsigned char *a, const unsigned char *b, const unsigned char *c);
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/seed.c:
--------------------------------------------------------------------------------
1 | #include "ed25519.h"
2 |
3 | #ifndef ED25519_NO_SEED
4 |
5 | #ifdef _WIN32
6 | #include
7 | #include
8 | #else
9 | #include
10 | #endif
11 |
12 | int ed25519_create_seed(unsigned char *seed) {
13 | #ifdef _WIN32
14 | HCRYPTPROV prov;
15 |
16 | if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
17 | return 1;
18 | }
19 |
20 | if (!CryptGenRandom(prov, 32, seed)) {
21 | CryptReleaseContext(prov, 0);
22 | return 1;
23 | }
24 |
25 | CryptReleaseContext(prov, 0);
26 | #else
27 | FILE *f = fopen("/dev/urandom", "rb");
28 |
29 | if (f == NULL) {
30 | return 1;
31 | }
32 |
33 | fread(seed, 1, 32, f);
34 | fclose(f);
35 | #endif
36 |
37 | return 0;
38 | }
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/sha512.h:
--------------------------------------------------------------------------------
1 | #ifndef SHA512_H
2 | #define SHA512_H
3 |
4 | #include
5 |
6 | #include "fixedint.h"
7 |
8 | /* state */
9 | typedef struct sha512_context_ {
10 | uint64_t length, state[8];
11 | size_t curlen;
12 | unsigned char buf[128];
13 | } sha512_context;
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | int sha512_init(sha512_context * md);
20 | int sha512_final(sha512_context * md, unsigned char *out);
21 | int sha512_update(sha512_context * md, const unsigned char *in, size_t inlen);
22 | int sha512(const unsigned char *message, size_t message_len, unsigned char *out);
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/sign.c:
--------------------------------------------------------------------------------
1 | #include "ed25519.h"
2 | #include "sha512.h"
3 | #include "ge.h"
4 | #include "sc.h"
5 |
6 |
7 | void ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key) {
8 | sha512_context hash;
9 | unsigned char hram[64];
10 | unsigned char r[64];
11 | ge_p3 R;
12 |
13 |
14 | sha512_init(&hash);
15 | sha512_update(&hash, private_key + 32, 32);
16 | sha512_update(&hash, message, message_len);
17 | sha512_final(&hash, r);
18 |
19 | sc_reduce(r);
20 | ge_scalarmult_base(&R, r);
21 | ge_p3_tobytes(signature, &R);
22 |
23 | sha512_init(&hash);
24 | sha512_update(&hash, signature, 32);
25 | sha512_update(&hash, public_key, 32);
26 | sha512_update(&hash, message, message_len);
27 | sha512_final(&hash, hram);
28 |
29 | sc_reduce(hram);
30 | sc_muladd(signature + 32, hram, private_key, r);
31 | }
32 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/ed25519/verify.c:
--------------------------------------------------------------------------------
1 | #include "ed25519.h"
2 | #include "sha512.h"
3 | #include "ge.h"
4 | #include "sc.h"
5 |
6 | static int consttime_equal(const unsigned char *x, const unsigned char *y) {
7 | unsigned char r = 0;
8 |
9 | r = x[0] ^ y[0];
10 | #define F(i) r |= x[i] ^ y[i]
11 | F(1);
12 | F(2);
13 | F(3);
14 | F(4);
15 | F(5);
16 | F(6);
17 | F(7);
18 | F(8);
19 | F(9);
20 | F(10);
21 | F(11);
22 | F(12);
23 | F(13);
24 | F(14);
25 | F(15);
26 | F(16);
27 | F(17);
28 | F(18);
29 | F(19);
30 | F(20);
31 | F(21);
32 | F(22);
33 | F(23);
34 | F(24);
35 | F(25);
36 | F(26);
37 | F(27);
38 | F(28);
39 | F(29);
40 | F(30);
41 | F(31);
42 | #undef F
43 |
44 | return !r;
45 | }
46 |
47 | int ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key) {
48 | unsigned char h[64];
49 | unsigned char checker[32];
50 | sha512_context hash;
51 | ge_p3 A;
52 | ge_p2 R;
53 |
54 | if (signature[63] & 224) {
55 | return 0;
56 | }
57 |
58 | if (ge_frombytes_negate_vartime(&A, public_key) != 0) {
59 | return 0;
60 | }
61 |
62 | sha512_init(&hash);
63 | sha512_update(&hash, signature, 32);
64 | sha512_update(&hash, public_key, 32);
65 | sha512_update(&hash, message, message_len);
66 | sha512_final(&hash, h);
67 |
68 | sc_reduce(h);
69 | ge_double_scalarmult_vartime(&R, h, &A, signature + 32);
70 | ge_tobytes(checker, &R);
71 |
72 | if (!consttime_equal(checker, signature)) {
73 | return 0;
74 | }
75 |
76 | return 1;
77 | }
78 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openairplay/ap2-sender/6637411cc2c3f09d59369339e7a494a37ac13c23/ap2-sender/ThirdParty/prebuilt/include/.DS_Store
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/blowfish.h:
--------------------------------------------------------------------------------
1 | /* crypto/bf/blowfish.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_BLOWFISH_H
60 | # define HEADER_BLOWFISH_H
61 |
62 | # include
63 |
64 | #ifdef __cplusplus
65 | extern "C" {
66 | #endif
67 |
68 | # ifdef OPENSSL_NO_BF
69 | # error BF is disabled.
70 | # endif
71 |
72 | # define BF_ENCRYPT 1
73 | # define BF_DECRYPT 0
74 |
75 | /*-
76 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
77 | * ! BF_LONG has to be at least 32 bits wide. If it's wider, then !
78 | * ! BF_LONG_LOG2 has to be defined along. !
79 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
80 | */
81 |
82 | # if defined(__LP32__)
83 | # define BF_LONG unsigned long
84 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
85 | # define BF_LONG unsigned long
86 | # define BF_LONG_LOG2 3
87 | /*
88 | * _CRAY note. I could declare short, but I have no idea what impact
89 | * does it have on performance on none-T3E machines. I could declare
90 | * int, but at least on C90 sizeof(int) can be chosen at compile time.
91 | * So I've chosen long...
92 | *
93 | */
94 | # else
95 | # define BF_LONG unsigned int
96 | # endif
97 |
98 | # define BF_ROUNDS 16
99 | # define BF_BLOCK 8
100 |
101 | typedef struct bf_key_st {
102 | BF_LONG P[BF_ROUNDS + 2];
103 | BF_LONG S[4 * 256];
104 | } BF_KEY;
105 |
106 | # ifdef OPENSSL_FIPS
107 | void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
108 | # endif
109 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
110 |
111 | void BF_encrypt(BF_LONG *data, const BF_KEY *key);
112 | void BF_decrypt(BF_LONG *data, const BF_KEY *key);
113 |
114 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
115 | const BF_KEY *key, int enc);
116 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
117 | const BF_KEY *schedule, unsigned char *ivec, int enc);
118 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
119 | long length, const BF_KEY *schedule,
120 | unsigned char *ivec, int *num, int enc);
121 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
122 | long length, const BF_KEY *schedule,
123 | unsigned char *ivec, int *num);
124 | const char *BF_options(void);
125 |
126 | #ifdef __cplusplus
127 | }
128 | #endif
129 |
130 | #endif
131 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/buffer.h:
--------------------------------------------------------------------------------
1 | /* crypto/buffer/buffer.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_BUFFER_H
60 | # define HEADER_BUFFER_H
61 |
62 | # include
63 |
64 | #ifdef __cplusplus
65 | extern "C" {
66 | #endif
67 |
68 | # include
69 |
70 | # if !defined(NO_SYS_TYPES_H)
71 | # include
72 | # endif
73 |
74 | /* Already declared in ossl_typ.h */
75 | /* typedef struct buf_mem_st BUF_MEM; */
76 |
77 | struct buf_mem_st {
78 | size_t length; /* current number of bytes */
79 | char *data;
80 | size_t max; /* size of buffer */
81 | };
82 |
83 | BUF_MEM *BUF_MEM_new(void);
84 | void BUF_MEM_free(BUF_MEM *a);
85 | int BUF_MEM_grow(BUF_MEM *str, size_t len);
86 | int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
87 | size_t BUF_strnlen(const char *str, size_t maxlen);
88 | char *BUF_strdup(const char *str);
89 |
90 | /*
91 | * Like strndup, but in addition, explicitly guarantees to never read past the
92 | * first |siz| bytes of |str|.
93 | */
94 | char *BUF_strndup(const char *str, size_t siz);
95 |
96 | void *BUF_memdup(const void *data, size_t siz);
97 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
98 |
99 | /* safe string functions */
100 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz);
101 | size_t BUF_strlcat(char *dst, const char *src, size_t siz);
102 |
103 | /* BEGIN ERROR CODES */
104 | /*
105 | * The following lines are auto generated by the script mkerr.pl. Any changes
106 | * made after this point may be overwritten when the script is next run.
107 | */
108 | void ERR_load_BUF_strings(void);
109 |
110 | /* Error codes for the BUF functions. */
111 |
112 | /* Function codes. */
113 | # define BUF_F_BUF_MEMDUP 103
114 | # define BUF_F_BUF_MEM_GROW 100
115 | # define BUF_F_BUF_MEM_GROW_CLEAN 105
116 | # define BUF_F_BUF_MEM_NEW 101
117 | # define BUF_F_BUF_STRDUP 102
118 | # define BUF_F_BUF_STRNDUP 104
119 |
120 | /* Reason codes. */
121 |
122 | #ifdef __cplusplus
123 | }
124 | #endif
125 | #endif
126 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/camellia.h:
--------------------------------------------------------------------------------
1 | /* crypto/camellia/camellia.h */
2 | /* ====================================================================
3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in
14 | * the documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * 3. All advertising materials mentioning features or use of this
18 | * software must display the following acknowledgment:
19 | * "This product includes software developed by the OpenSSL Project
20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
21 | *
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23 | * endorse or promote products derived from this software without
24 | * prior written permission. For written permission, please contact
25 | * openssl-core@openssl.org.
26 | *
27 | * 5. Products derived from this software may not be called "OpenSSL"
28 | * nor may "OpenSSL" appear in their names without prior written
29 | * permission of the OpenSSL Project.
30 | *
31 | * 6. Redistributions of any form whatsoever must retain the following
32 | * acknowledgment:
33 | * "This product includes software developed by the OpenSSL Project
34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
35 | *
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 | * OF THE POSSIBILITY OF SUCH DAMAGE.
48 | * ====================================================================
49 | *
50 | */
51 |
52 | #ifndef HEADER_CAMELLIA_H
53 | # define HEADER_CAMELLIA_H
54 |
55 | # include
56 |
57 | # ifdef OPENSSL_NO_CAMELLIA
58 | # error CAMELLIA is disabled.
59 | # endif
60 |
61 | # include
62 |
63 | # define CAMELLIA_ENCRYPT 1
64 | # define CAMELLIA_DECRYPT 0
65 |
66 | /*
67 | * Because array size can't be a const in C, the following two are macros.
68 | * Both sizes are in bytes.
69 | */
70 |
71 | #ifdef __cplusplus
72 | extern "C" {
73 | #endif
74 |
75 | /* This should be a hidden type, but EVP requires that the size be known */
76 |
77 | # define CAMELLIA_BLOCK_SIZE 16
78 | # define CAMELLIA_TABLE_BYTE_LEN 272
79 | # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
80 |
81 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match
82 | * with WORD */
83 |
84 | struct camellia_key_st {
85 | union {
86 | double d; /* ensures 64-bit align */
87 | KEY_TABLE_TYPE rd_key;
88 | } u;
89 | int grand_rounds;
90 | };
91 | typedef struct camellia_key_st CAMELLIA_KEY;
92 |
93 | # ifdef OPENSSL_FIPS
94 | int private_Camellia_set_key(const unsigned char *userKey, const int bits,
95 | CAMELLIA_KEY *key);
96 | # endif
97 | int Camellia_set_key(const unsigned char *userKey, const int bits,
98 | CAMELLIA_KEY *key);
99 |
100 | void Camellia_encrypt(const unsigned char *in, unsigned char *out,
101 | const CAMELLIA_KEY *key);
102 | void Camellia_decrypt(const unsigned char *in, unsigned char *out,
103 | const CAMELLIA_KEY *key);
104 |
105 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
106 | const CAMELLIA_KEY *key, const int enc);
107 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
108 | size_t length, const CAMELLIA_KEY *key,
109 | unsigned char *ivec, const int enc);
110 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
111 | size_t length, const CAMELLIA_KEY *key,
112 | unsigned char *ivec, int *num, const int enc);
113 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
114 | size_t length, const CAMELLIA_KEY *key,
115 | unsigned char *ivec, int *num, const int enc);
116 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
117 | size_t length, const CAMELLIA_KEY *key,
118 | unsigned char *ivec, int *num, const int enc);
119 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,
120 | size_t length, const CAMELLIA_KEY *key,
121 | unsigned char *ivec, int *num);
122 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
123 | size_t length, const CAMELLIA_KEY *key,
124 | unsigned char ivec[CAMELLIA_BLOCK_SIZE],
125 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
126 | unsigned int *num);
127 |
128 | #ifdef __cplusplus
129 | }
130 | #endif
131 |
132 | #endif /* !HEADER_Camellia_H */
133 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/cast.h:
--------------------------------------------------------------------------------
1 | /* crypto/cast/cast.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_CAST_H
60 | # define HEADER_CAST_H
61 |
62 | #ifdef __cplusplus
63 | extern "C" {
64 | #endif
65 |
66 | # include
67 |
68 | # ifdef OPENSSL_NO_CAST
69 | # error CAST is disabled.
70 | # endif
71 |
72 | # define CAST_ENCRYPT 1
73 | # define CAST_DECRYPT 0
74 |
75 | # define CAST_LONG unsigned int
76 |
77 | # define CAST_BLOCK 8
78 | # define CAST_KEY_LENGTH 16
79 |
80 | typedef struct cast_key_st {
81 | CAST_LONG data[32];
82 | int short_key; /* Use reduced rounds for short key */
83 | } CAST_KEY;
84 |
85 | # ifdef OPENSSL_FIPS
86 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
87 | # endif
88 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
89 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
90 | const CAST_KEY *key, int enc);
91 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
92 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
93 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
94 | long length, const CAST_KEY *ks, unsigned char *iv,
95 | int enc);
96 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
97 | long length, const CAST_KEY *schedule,
98 | unsigned char *ivec, int *num, int enc);
99 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
100 | long length, const CAST_KEY *schedule,
101 | unsigned char *ivec, int *num);
102 |
103 | #ifdef __cplusplus
104 | }
105 | #endif
106 |
107 | #endif
108 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/cmac.h:
--------------------------------------------------------------------------------
1 | /* crypto/cmac/cmac.h */
2 | /*
3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
4 | * project.
5 | */
6 | /* ====================================================================
7 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * 1. Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above copyright
17 | * notice, this list of conditions and the following disclaimer in
18 | * the documentation and/or other materials provided with the
19 | * distribution.
20 | *
21 | * 3. All advertising materials mentioning features or use of this
22 | * software must display the following acknowledgment:
23 | * "This product includes software developed by the OpenSSL Project
24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 | *
26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 | * endorse or promote products derived from this software without
28 | * prior written permission. For written permission, please contact
29 | * licensing@OpenSSL.org.
30 | *
31 | * 5. Products derived from this software may not be called "OpenSSL"
32 | * nor may "OpenSSL" appear in their names without prior written
33 | * permission of the OpenSSL Project.
34 | *
35 | * 6. Redistributions of any form whatsoever must retain the following
36 | * acknowledgment:
37 | * "This product includes software developed by the OpenSSL Project
38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 | *
40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 | * OF THE POSSIBILITY OF SUCH DAMAGE.
52 | * ====================================================================
53 | */
54 |
55 | #ifndef HEADER_CMAC_H
56 | # define HEADER_CMAC_H
57 |
58 | #ifdef __cplusplus
59 | extern "C" {
60 | #endif
61 |
62 | # include
63 |
64 | /* Opaque */
65 | typedef struct CMAC_CTX_st CMAC_CTX;
66 |
67 | CMAC_CTX *CMAC_CTX_new(void);
68 | void CMAC_CTX_cleanup(CMAC_CTX *ctx);
69 | void CMAC_CTX_free(CMAC_CTX *ctx);
70 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
71 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
72 |
73 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
74 | const EVP_CIPHER *cipher, ENGINE *impl);
75 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
76 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
77 | int CMAC_resume(CMAC_CTX *ctx);
78 |
79 | #ifdef __cplusplus
80 | }
81 | #endif
82 | #endif
83 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/comp.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef HEADER_COMP_H
3 | # define HEADER_COMP_H
4 |
5 | # include
6 |
7 | # ifdef OPENSSL_NO_COMP
8 | # error COMP is disabled.
9 | # endif
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif
14 |
15 | typedef struct comp_ctx_st COMP_CTX;
16 |
17 | struct comp_method_st {
18 | int type; /* NID for compression library */
19 | const char *name; /* A text string to identify the library */
20 | int (*init) (COMP_CTX *ctx);
21 | void (*finish) (COMP_CTX *ctx);
22 | int (*compress) (COMP_CTX *ctx,
23 | unsigned char *out, unsigned int olen,
24 | unsigned char *in, unsigned int ilen);
25 | int (*expand) (COMP_CTX *ctx,
26 | unsigned char *out, unsigned int olen,
27 | unsigned char *in, unsigned int ilen);
28 | /*
29 | * The following two do NOTHING, but are kept for backward compatibility
30 | */
31 | long (*ctrl) (void);
32 | long (*callback_ctrl) (void);
33 | };
34 |
35 | struct comp_ctx_st {
36 | COMP_METHOD *meth;
37 | unsigned long compress_in;
38 | unsigned long compress_out;
39 | unsigned long expand_in;
40 | unsigned long expand_out;
41 | CRYPTO_EX_DATA ex_data;
42 | };
43 |
44 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
45 | void COMP_CTX_free(COMP_CTX *ctx);
46 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
47 | unsigned char *in, int ilen);
48 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
49 | unsigned char *in, int ilen);
50 | COMP_METHOD *COMP_rle(void);
51 | COMP_METHOD *COMP_zlib(void);
52 | void COMP_zlib_cleanup(void);
53 |
54 | # ifdef HEADER_BIO_H
55 | # ifdef ZLIB
56 | BIO_METHOD *BIO_f_zlib(void);
57 | # endif
58 | # endif
59 |
60 | /* BEGIN ERROR CODES */
61 | /*
62 | * The following lines are auto generated by the script mkerr.pl. Any changes
63 | * made after this point may be overwritten when the script is next run.
64 | */
65 | void ERR_load_COMP_strings(void);
66 |
67 | /* Error codes for the COMP functions. */
68 |
69 | /* Function codes. */
70 | # define COMP_F_BIO_ZLIB_FLUSH 99
71 | # define COMP_F_BIO_ZLIB_NEW 100
72 | # define COMP_F_BIO_ZLIB_READ 101
73 | # define COMP_F_BIO_ZLIB_WRITE 102
74 |
75 | /* Reason codes. */
76 | # define COMP_R_ZLIB_DEFLATE_ERROR 99
77 | # define COMP_R_ZLIB_INFLATE_ERROR 100
78 | # define COMP_R_ZLIB_NOT_SUPPORTED 101
79 |
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 | #endif
84 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/conf_api.h:
--------------------------------------------------------------------------------
1 | /* conf_api.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_CONF_API_H
60 | # define HEADER_CONF_API_H
61 |
62 | # include
63 | # include
64 |
65 | #ifdef __cplusplus
66 | extern "C" {
67 | #endif
68 |
69 | /* Up until OpenSSL 0.9.5a, this was new_section */
70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
71 | /* Up until OpenSSL 0.9.5a, this was get_section */
72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
75 | const char *section);
76 |
77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
78 | char *_CONF_get_string(const CONF *conf, const char *section,
79 | const char *name);
80 | long _CONF_get_number(const CONF *conf, const char *section,
81 | const char *name);
82 |
83 | int _CONF_new_data(CONF *conf);
84 | void _CONF_free_data(CONF *conf);
85 |
86 | #ifdef __cplusplus
87 | }
88 | #endif
89 | #endif
90 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/ebcdic.h:
--------------------------------------------------------------------------------
1 | /* crypto/ebcdic.h */
2 |
3 | #ifndef HEADER_EBCDIC_H
4 | # define HEADER_EBCDIC_H
5 |
6 | # include
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | /* Avoid name clashes with other applications */
13 | # define os_toascii _openssl_os_toascii
14 | # define os_toebcdic _openssl_os_toebcdic
15 | # define ebcdic2ascii _openssl_ebcdic2ascii
16 | # define ascii2ebcdic _openssl_ascii2ebcdic
17 |
18 | extern const unsigned char os_toascii[256];
19 | extern const unsigned char os_toebcdic[256];
20 | void *ebcdic2ascii(void *dest, const void *srce, size_t count);
21 | void *ascii2ebcdic(void *dest, const void *srce, size_t count);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 | #endif
27 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/ecdh.h:
--------------------------------------------------------------------------------
1 | /* crypto/ecdh/ecdh.h */
2 | /* ====================================================================
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 | *
5 | * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
6 | * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
7 | * to the OpenSSL project.
8 | *
9 | * The ECC Code is licensed pursuant to the OpenSSL open source
10 | * license provided below.
11 | *
12 | * The ECDH software is originally written by Douglas Stebila of
13 | * Sun Microsystems Laboratories.
14 | *
15 | */
16 | /* ====================================================================
17 | * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
18 | *
19 | * Redistribution and use in source and binary forms, with or without
20 | * modification, are permitted provided that the following conditions
21 | * are met:
22 | *
23 | * 1. Redistributions of source code must retain the above copyright
24 | * notice, this list of conditions and the following disclaimer.
25 | *
26 | * 2. Redistributions in binary form must reproduce the above copyright
27 | * notice, this list of conditions and the following disclaimer in
28 | * the documentation and/or other materials provided with the
29 | * distribution.
30 | *
31 | * 3. All advertising materials mentioning features or use of this
32 | * software must display the following acknowledgment:
33 | * "This product includes software developed by the OpenSSL Project
34 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
35 | *
36 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
37 | * endorse or promote products derived from this software without
38 | * prior written permission. For written permission, please contact
39 | * licensing@OpenSSL.org.
40 | *
41 | * 5. Products derived from this software may not be called "OpenSSL"
42 | * nor may "OpenSSL" appear in their names without prior written
43 | * permission of the OpenSSL Project.
44 | *
45 | * 6. Redistributions of any form whatsoever must retain the following
46 | * acknowledgment:
47 | * "This product includes software developed by the OpenSSL Project
48 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
49 | *
50 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
51 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
53 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
54 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
56 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
57 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
59 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
60 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
61 | * OF THE POSSIBILITY OF SUCH DAMAGE.
62 | * ====================================================================
63 | *
64 | * This product includes cryptographic software written by Eric Young
65 | * (eay@cryptsoft.com). This product includes software written by Tim
66 | * Hudson (tjh@cryptsoft.com).
67 | *
68 | */
69 | #ifndef HEADER_ECDH_H
70 | # define HEADER_ECDH_H
71 |
72 | # include
73 |
74 | # ifdef OPENSSL_NO_ECDH
75 | # error ECDH is disabled.
76 | # endif
77 |
78 | # include
79 | # include
80 | # ifndef OPENSSL_NO_DEPRECATED
81 | # include
82 | # endif
83 |
84 | #ifdef __cplusplus
85 | extern "C" {
86 | #endif
87 |
88 | # define EC_FLAG_COFACTOR_ECDH 0x1000
89 |
90 | const ECDH_METHOD *ECDH_OpenSSL(void);
91 |
92 | void ECDH_set_default_method(const ECDH_METHOD *);
93 | const ECDH_METHOD *ECDH_get_default_method(void);
94 | int ECDH_set_method(EC_KEY *, const ECDH_METHOD *);
95 |
96 | int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
97 | EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen,
98 | void *out, size_t *outlen));
99 |
100 | int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
101 | *new_func, CRYPTO_EX_dup *dup_func,
102 | CRYPTO_EX_free *free_func);
103 | int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);
104 | void *ECDH_get_ex_data(EC_KEY *d, int idx);
105 |
106 | int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
107 | const unsigned char *Z, size_t Zlen,
108 | const unsigned char *sinfo, size_t sinfolen,
109 | const EVP_MD *md);
110 |
111 | /* BEGIN ERROR CODES */
112 | /*
113 | * The following lines are auto generated by the script mkerr.pl. Any changes
114 | * made after this point may be overwritten when the script is next run.
115 | */
116 | void ERR_load_ECDH_strings(void);
117 |
118 | /* Error codes for the ECDH functions. */
119 |
120 | /* Function codes. */
121 | # define ECDH_F_ECDH_CHECK 102
122 | # define ECDH_F_ECDH_COMPUTE_KEY 100
123 | # define ECDH_F_ECDH_DATA_NEW_METHOD 101
124 |
125 | /* Reason codes. */
126 | # define ECDH_R_KDF_FAILED 102
127 | # define ECDH_R_NON_FIPS_METHOD 103
128 | # define ECDH_R_NO_PRIVATE_VALUE 100
129 | # define ECDH_R_POINT_ARITHMETIC_FAILURE 101
130 |
131 | #ifdef __cplusplus
132 | }
133 | #endif
134 | #endif
135 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/hmac.h:
--------------------------------------------------------------------------------
1 | /* crypto/hmac/hmac.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 | #ifndef HEADER_HMAC_H
59 | # define HEADER_HMAC_H
60 |
61 | # include
62 |
63 | # ifdef OPENSSL_NO_HMAC
64 | # error HMAC is disabled.
65 | # endif
66 |
67 | # include
68 |
69 | # define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */
70 |
71 | #ifdef __cplusplus
72 | extern "C" {
73 | #endif
74 |
75 | typedef struct hmac_ctx_st {
76 | const EVP_MD *md;
77 | EVP_MD_CTX md_ctx;
78 | EVP_MD_CTX i_ctx;
79 | EVP_MD_CTX o_ctx;
80 | unsigned int key_length;
81 | unsigned char key[HMAC_MAX_MD_CBLOCK];
82 | } HMAC_CTX;
83 |
84 | # define HMAC_size(e) (EVP_MD_size((e)->md))
85 |
86 | void HMAC_CTX_init(HMAC_CTX *ctx);
87 | void HMAC_CTX_cleanup(HMAC_CTX *ctx);
88 |
89 | /* deprecated */
90 | # define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
91 |
92 | /* deprecated */
93 | int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);
94 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
95 | const EVP_MD *md, ENGINE *impl);
96 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
97 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
98 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
99 | const unsigned char *d, size_t n, unsigned char *md,
100 | unsigned int *md_len);
101 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
102 |
103 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
104 |
105 | #ifdef __cplusplus
106 | }
107 | #endif
108 |
109 | #endif
110 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/idea.h:
--------------------------------------------------------------------------------
1 | /* crypto/idea/idea.h */
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_IDEA_H
60 | # define HEADER_IDEA_H
61 |
62 | # include /* IDEA_INT, OPENSSL_NO_IDEA */
63 |
64 | # ifdef OPENSSL_NO_IDEA
65 | # error IDEA is disabled.
66 | # endif
67 |
68 | # define IDEA_ENCRYPT 1
69 | # define IDEA_DECRYPT 0
70 |
71 | # define IDEA_BLOCK 8
72 | # define IDEA_KEY_LENGTH 16
73 |
74 | #ifdef __cplusplus
75 | extern "C" {
76 | #endif
77 |
78 | typedef struct idea_key_st {
79 | IDEA_INT data[9][6];
80 | } IDEA_KEY_SCHEDULE;
81 |
82 | const char *idea_options(void);
83 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
84 | IDEA_KEY_SCHEDULE *ks);
85 | # ifdef OPENSSL_FIPS
86 | void private_idea_set_encrypt_key(const unsigned char *key,
87 | IDEA_KEY_SCHEDULE *ks);
88 | # endif
89 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
90 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
91 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
92 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
93 | int enc);
94 | void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
95 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
96 | int *num, int enc);
97 | void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
98 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
99 | int *num);
100 | void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
101 | #ifdef __cplusplus
102 | }
103 | #endif
104 |
105 | #endif
106 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/md4.h:
--------------------------------------------------------------------------------
1 | /* crypto/md4/md4.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_MD4_H
60 | # define HEADER_MD4_H
61 |
62 | # include
63 | # include
64 |
65 | #ifdef __cplusplus
66 | extern "C" {
67 | #endif
68 |
69 | # ifdef OPENSSL_NO_MD4
70 | # error MD4 is disabled.
71 | # endif
72 |
73 | /*-
74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 | * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !
76 | * ! MD4_LONG_LOG2 has to be defined along. !
77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
78 | */
79 |
80 | # if defined(__LP32__)
81 | # define MD4_LONG unsigned long
82 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
83 | # define MD4_LONG unsigned long
84 | # define MD4_LONG_LOG2 3
85 | /*
86 | * _CRAY note. I could declare short, but I have no idea what impact
87 | * does it have on performance on none-T3E machines. I could declare
88 | * int, but at least on C90 sizeof(int) can be chosen at compile time.
89 | * So I've chosen long...
90 | *
91 | */
92 | # else
93 | # define MD4_LONG unsigned int
94 | # endif
95 |
96 | # define MD4_CBLOCK 64
97 | # define MD4_LBLOCK (MD4_CBLOCK/4)
98 | # define MD4_DIGEST_LENGTH 16
99 |
100 | typedef struct MD4state_st {
101 | MD4_LONG A, B, C, D;
102 | MD4_LONG Nl, Nh;
103 | MD4_LONG data[MD4_LBLOCK];
104 | unsigned int num;
105 | } MD4_CTX;
106 |
107 | # ifdef OPENSSL_FIPS
108 | int private_MD4_Init(MD4_CTX *c);
109 | # endif
110 | int MD4_Init(MD4_CTX *c);
111 | int MD4_Update(MD4_CTX *c, const void *data, size_t len);
112 | int MD4_Final(unsigned char *md, MD4_CTX *c);
113 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);
114 | void MD4_Transform(MD4_CTX *c, const unsigned char *b);
115 | #ifdef __cplusplus
116 | }
117 | #endif
118 |
119 | #endif
120 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/md5.h:
--------------------------------------------------------------------------------
1 | /* crypto/md5/md5.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_MD5_H
60 | # define HEADER_MD5_H
61 |
62 | # include
63 | # include
64 |
65 | #ifdef __cplusplus
66 | extern "C" {
67 | #endif
68 |
69 | # ifdef OPENSSL_NO_MD5
70 | # error MD5 is disabled.
71 | # endif
72 |
73 | /*
74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 | * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
76 | * ! MD5_LONG_LOG2 has to be defined along. !
77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
78 | */
79 |
80 | # if defined(__LP32__)
81 | # define MD5_LONG unsigned long
82 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
83 | # define MD5_LONG unsigned long
84 | # define MD5_LONG_LOG2 3
85 | /*
86 | * _CRAY note. I could declare short, but I have no idea what impact
87 | * does it have on performance on none-T3E machines. I could declare
88 | * int, but at least on C90 sizeof(int) can be chosen at compile time.
89 | * So I've chosen long...
90 | *
91 | */
92 | # else
93 | # define MD5_LONG unsigned int
94 | # endif
95 |
96 | # define MD5_CBLOCK 64
97 | # define MD5_LBLOCK (MD5_CBLOCK/4)
98 | # define MD5_DIGEST_LENGTH 16
99 |
100 | typedef struct MD5state_st {
101 | MD5_LONG A, B, C, D;
102 | MD5_LONG Nl, Nh;
103 | MD5_LONG data[MD5_LBLOCK];
104 | unsigned int num;
105 | } MD5_CTX;
106 |
107 | # ifdef OPENSSL_FIPS
108 | int private_MD5_Init(MD5_CTX *c);
109 | # endif
110 | int MD5_Init(MD5_CTX *c);
111 | int MD5_Update(MD5_CTX *c, const void *data, size_t len);
112 | int MD5_Final(unsigned char *md, MD5_CTX *c);
113 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
114 | void MD5_Transform(MD5_CTX *c, const unsigned char *b);
115 | #ifdef __cplusplus
116 | }
117 | #endif
118 |
119 | #endif
120 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/mdc2.h:
--------------------------------------------------------------------------------
1 | /* crypto/mdc2/mdc2.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_MDC2_H
60 | # define HEADER_MDC2_H
61 |
62 | # include
63 |
64 | #ifdef __cplusplus
65 | extern "C" {
66 | #endif
67 |
68 | # ifdef OPENSSL_NO_MDC2
69 | # error MDC2 is disabled.
70 | # endif
71 |
72 | # define MDC2_BLOCK 8
73 | # define MDC2_DIGEST_LENGTH 16
74 |
75 | typedef struct mdc2_ctx_st {
76 | unsigned int num;
77 | unsigned char data[MDC2_BLOCK];
78 | DES_cblock h, hh;
79 | int pad_type; /* either 1 or 2, default 1 */
80 | } MDC2_CTX;
81 |
82 | # ifdef OPENSSL_FIPS
83 | int private_MDC2_Init(MDC2_CTX *c);
84 | # endif
85 | int MDC2_Init(MDC2_CTX *c);
86 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
87 | int MDC2_Final(unsigned char *md, MDC2_CTX *c);
88 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);
89 |
90 | #ifdef __cplusplus
91 | }
92 | #endif
93 |
94 | #endif
95 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/opensslv.h:
--------------------------------------------------------------------------------
1 | #ifndef HEADER_OPENSSLV_H
2 | # define HEADER_OPENSSLV_H
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | /*-
9 | * Numeric release version identifier:
10 | * MNNFFPPS: major minor fix patch status
11 | * The status nibble has one of the values 0 for development, 1 to e for betas
12 | * 1 to 14, and f for release. The patch level is exactly that.
13 | * For example:
14 | * 0.9.3-dev 0x00903000
15 | * 0.9.3-beta1 0x00903001
16 | * 0.9.3-beta2-dev 0x00903002
17 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
18 | * 0.9.3 0x0090300f
19 | * 0.9.3a 0x0090301f
20 | * 0.9.4 0x0090400f
21 | * 1.2.3z 0x102031af
22 | *
23 | * For continuity reasons (because 0.9.5 is already out, and is coded
24 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
25 | * part is slightly different, by setting the highest bit. This means
26 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start
27 | * with 0x0090600S...
28 | *
29 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
30 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
31 | * major minor fix final patch/beta)
32 | */
33 | # define OPENSSL_VERSION_NUMBER 0x100020ffL
34 | # ifdef OPENSSL_FIPS
35 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2o-fips 27 Mar 2018"
36 | # else
37 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2o 27 Mar 2018"
38 | # endif
39 | # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
40 |
41 | /*-
42 | * The macros below are to be used for shared library (.so, .dll, ...)
43 | * versioning. That kind of versioning works a bit differently between
44 | * operating systems. The most usual scheme is to set a major and a minor
45 | * number, and have the runtime loader check that the major number is equal
46 | * to what it was at application link time, while the minor number has to
47 | * be greater or equal to what it was at application link time. With this
48 | * scheme, the version number is usually part of the file name, like this:
49 | *
50 | * libcrypto.so.0.9
51 | *
52 | * Some unixen also make a softlink with the major verson number only:
53 | *
54 | * libcrypto.so.0
55 | *
56 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the
57 | * shared library version is stored in the file, and is actually a series
58 | * of versions, separated by colons. The rightmost version present in the
59 | * library when linking an application is stored in the application to be
60 | * matched at run time. When the application is run, a check is done to
61 | * see if the library version stored in the application matches any of the
62 | * versions in the version string of the library itself.
63 | * This version string can be constructed in any way, depending on what
64 | * kind of matching is desired. However, to implement the same scheme as
65 | * the one used in the other unixen, all compatible versions, from lowest
66 | * to highest, should be part of the string. Consecutive builds would
67 | * give the following versions strings:
68 | *
69 | * 3.0
70 | * 3.0:3.1
71 | * 3.0:3.1:3.2
72 | * 4.0
73 | * 4.0:4.1
74 | *
75 | * Notice how version 4 is completely incompatible with version, and
76 | * therefore give the breach you can see.
77 | *
78 | * There may be other schemes as well that I haven't yet discovered.
79 | *
80 | * So, here's the way it works here: first of all, the library version
81 | * number doesn't need at all to match the overall OpenSSL version.
82 | * However, it's nice and more understandable if it actually does.
83 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
84 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
85 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
86 | * we need to keep a history of version numbers, which is done in the
87 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
88 | * should only keep the versions that are binary compatible with the current.
89 | */
90 | # define SHLIB_VERSION_HISTORY ""
91 | # define SHLIB_VERSION_NUMBER "1.0.0"
92 |
93 |
94 | #ifdef __cplusplus
95 | }
96 | #endif
97 | #endif /* HEADER_OPENSSLV_H */
98 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/pem2.h:
--------------------------------------------------------------------------------
1 | /* ====================================================================
2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * 3. All advertising materials mentioning features or use of this
17 | * software must display the following acknowledgment:
18 | * "This product includes software developed by the OpenSSL Project
19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
20 | *
21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
22 | * endorse or promote products derived from this software without
23 | * prior written permission. For written permission, please contact
24 | * licensing@OpenSSL.org.
25 | *
26 | * 5. Products derived from this software may not be called "OpenSSL"
27 | * nor may "OpenSSL" appear in their names without prior written
28 | * permission of the OpenSSL Project.
29 | *
30 | * 6. Redistributions of any form whatsoever must retain the following
31 | * acknowledgment:
32 | * "This product includes software developed by the OpenSSL Project
33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
34 | *
35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
46 | * OF THE POSSIBILITY OF SUCH DAMAGE.
47 | * ====================================================================
48 | *
49 | * This product includes cryptographic software written by Eric Young
50 | * (eay@cryptsoft.com). This product includes software written by Tim
51 | * Hudson (tjh@cryptsoft.com).
52 | *
53 | */
54 |
55 | /*
56 | * This header only exists to break a circular dependency between pem and err
57 | * Ben 30 Jan 1999.
58 | */
59 |
60 | #ifdef __cplusplus
61 | extern "C" {
62 | #endif
63 |
64 | #ifndef HEADER_PEM_H
65 | void ERR_load_PEM_strings(void);
66 | #endif
67 |
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/pqueue.h:
--------------------------------------------------------------------------------
1 | /* crypto/pqueue/pqueue.h */
2 | /*
3 | * DTLS implementation written by Nagendra Modadugu
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
5 | */
6 | /* ====================================================================
7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * 1. Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above copyright
17 | * notice, this list of conditions and the following disclaimer in
18 | * the documentation and/or other materials provided with the
19 | * distribution.
20 | *
21 | * 3. All advertising materials mentioning features or use of this
22 | * software must display the following acknowledgment:
23 | * "This product includes software developed by the OpenSSL Project
24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 | *
26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 | * endorse or promote products derived from this software without
28 | * prior written permission. For written permission, please contact
29 | * openssl-core@OpenSSL.org.
30 | *
31 | * 5. Products derived from this software may not be called "OpenSSL"
32 | * nor may "OpenSSL" appear in their names without prior written
33 | * permission of the OpenSSL Project.
34 | *
35 | * 6. Redistributions of any form whatsoever must retain the following
36 | * acknowledgment:
37 | * "This product includes software developed by the OpenSSL Project
38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 | *
40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 | * OF THE POSSIBILITY OF SUCH DAMAGE.
52 | * ====================================================================
53 | *
54 | * This product includes cryptographic software written by Eric Young
55 | * (eay@cryptsoft.com). This product includes software written by Tim
56 | * Hudson (tjh@cryptsoft.com).
57 | *
58 | */
59 |
60 | #ifndef HEADER_PQUEUE_H
61 | # define HEADER_PQUEUE_H
62 |
63 | # include
64 | # include
65 | # include
66 |
67 | #ifdef __cplusplus
68 | extern "C" {
69 | #endif
70 | typedef struct _pqueue *pqueue;
71 |
72 | typedef struct _pitem {
73 | unsigned char priority[8]; /* 64-bit value in big-endian encoding */
74 | void *data;
75 | struct _pitem *next;
76 | } pitem;
77 |
78 | typedef struct _pitem *piterator;
79 |
80 | pitem *pitem_new(unsigned char *prio64be, void *data);
81 | void pitem_free(pitem *item);
82 |
83 | pqueue pqueue_new(void);
84 | void pqueue_free(pqueue pq);
85 |
86 | pitem *pqueue_insert(pqueue pq, pitem *item);
87 | pitem *pqueue_peek(pqueue pq);
88 | pitem *pqueue_pop(pqueue pq);
89 | pitem *pqueue_find(pqueue pq, unsigned char *prio64be);
90 | pitem *pqueue_iterator(pqueue pq);
91 | pitem *pqueue_next(piterator *iter);
92 |
93 | void pqueue_print(pqueue pq);
94 | int pqueue_size(pqueue pq);
95 |
96 | #ifdef __cplusplus
97 | }
98 | #endif
99 | #endif /* ! HEADER_PQUEUE_H */
100 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/rand.h:
--------------------------------------------------------------------------------
1 | /* crypto/rand/rand.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_RAND_H
60 | # define HEADER_RAND_H
61 |
62 | # include
63 | # include
64 | # include
65 |
66 | # if defined(OPENSSL_SYS_WINDOWS)
67 | # include
68 | # endif
69 |
70 | #ifdef __cplusplus
71 | extern "C" {
72 | #endif
73 |
74 | # if defined(OPENSSL_FIPS)
75 | # define FIPS_RAND_SIZE_T size_t
76 | # endif
77 |
78 | /* Already defined in ossl_typ.h */
79 | /* typedef struct rand_meth_st RAND_METHOD; */
80 |
81 | struct rand_meth_st {
82 | void (*seed) (const void *buf, int num);
83 | int (*bytes) (unsigned char *buf, int num);
84 | void (*cleanup) (void);
85 | void (*add) (const void *buf, int num, double entropy);
86 | int (*pseudorand) (unsigned char *buf, int num);
87 | int (*status) (void);
88 | };
89 |
90 | # ifdef BN_DEBUG
91 | extern int rand_predictable;
92 | # endif
93 |
94 | int RAND_set_rand_method(const RAND_METHOD *meth);
95 | const RAND_METHOD *RAND_get_rand_method(void);
96 | # ifndef OPENSSL_NO_ENGINE
97 | int RAND_set_rand_engine(ENGINE *engine);
98 | # endif
99 | RAND_METHOD *RAND_SSLeay(void);
100 | void RAND_cleanup(void);
101 | int RAND_bytes(unsigned char *buf, int num);
102 | int RAND_pseudo_bytes(unsigned char *buf, int num);
103 | void RAND_seed(const void *buf, int num);
104 | void RAND_add(const void *buf, int num, double entropy);
105 | int RAND_load_file(const char *file, long max_bytes);
106 | int RAND_write_file(const char *file);
107 | const char *RAND_file_name(char *file, size_t num);
108 | int RAND_status(void);
109 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
110 | int RAND_egd(const char *path);
111 | int RAND_egd_bytes(const char *path, int bytes);
112 | int RAND_poll(void);
113 |
114 | # if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
115 |
116 | void RAND_screen(void);
117 | int RAND_event(UINT, WPARAM, LPARAM);
118 |
119 | # endif
120 |
121 | # ifdef OPENSSL_FIPS
122 | void RAND_set_fips_drbg_type(int type, int flags);
123 | int RAND_init_fips(void);
124 | # endif
125 |
126 | /* BEGIN ERROR CODES */
127 | /*
128 | * The following lines are auto generated by the script mkerr.pl. Any changes
129 | * made after this point may be overwritten when the script is next run.
130 | */
131 | void ERR_load_RAND_strings(void);
132 |
133 | /* Error codes for the RAND functions. */
134 |
135 | /* Function codes. */
136 | # define RAND_F_RAND_GET_RAND_METHOD 101
137 | # define RAND_F_RAND_INIT_FIPS 102
138 | # define RAND_F_SSLEAY_RAND_BYTES 100
139 |
140 | /* Reason codes. */
141 | # define RAND_R_DUAL_EC_DRBG_DISABLED 104
142 | # define RAND_R_ERROR_INITIALISING_DRBG 102
143 | # define RAND_R_ERROR_INSTANTIATING_DRBG 103
144 | # define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
145 | # define RAND_R_PRNG_NOT_SEEDED 100
146 |
147 | #ifdef __cplusplus
148 | }
149 | #endif
150 | #endif
151 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/rc2.h:
--------------------------------------------------------------------------------
1 | /* crypto/rc2/rc2.h */
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_RC2_H
60 | # define HEADER_RC2_H
61 |
62 | # include /* OPENSSL_NO_RC2, RC2_INT */
63 | # ifdef OPENSSL_NO_RC2
64 | # error RC2 is disabled.
65 | # endif
66 |
67 | # define RC2_ENCRYPT 1
68 | # define RC2_DECRYPT 0
69 |
70 | # define RC2_BLOCK 8
71 | # define RC2_KEY_LENGTH 16
72 |
73 | #ifdef __cplusplus
74 | extern "C" {
75 | #endif
76 |
77 | typedef struct rc2_key_st {
78 | RC2_INT data[64];
79 | } RC2_KEY;
80 |
81 | # ifdef OPENSSL_FIPS
82 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,
83 | int bits);
84 | # endif
85 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);
86 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,
87 | RC2_KEY *key, int enc);
88 | void RC2_encrypt(unsigned long *data, RC2_KEY *key);
89 | void RC2_decrypt(unsigned long *data, RC2_KEY *key);
90 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
91 | RC2_KEY *ks, unsigned char *iv, int enc);
92 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
93 | long length, RC2_KEY *schedule, unsigned char *ivec,
94 | int *num, int enc);
95 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
96 | long length, RC2_KEY *schedule, unsigned char *ivec,
97 | int *num);
98 |
99 | #ifdef __cplusplus
100 | }
101 | #endif
102 |
103 | #endif
104 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/rc4.h:
--------------------------------------------------------------------------------
1 | /* crypto/rc4/rc4.h */
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_RC4_H
60 | # define HEADER_RC4_H
61 |
62 | # include /* OPENSSL_NO_RC4, RC4_INT */
63 | # ifdef OPENSSL_NO_RC4
64 | # error RC4 is disabled.
65 | # endif
66 |
67 | # include
68 |
69 | #ifdef __cplusplus
70 | extern "C" {
71 | #endif
72 |
73 | typedef struct rc4_key_st {
74 | RC4_INT x, y;
75 | RC4_INT data[256];
76 | } RC4_KEY;
77 |
78 | const char *RC4_options(void);
79 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
80 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
81 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
82 | unsigned char *outdata);
83 |
84 | #ifdef __cplusplus
85 | }
86 | #endif
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/ripemd.h:
--------------------------------------------------------------------------------
1 | /* crypto/ripemd/ripemd.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_RIPEMD_H
60 | # define HEADER_RIPEMD_H
61 |
62 | # include
63 | # include
64 |
65 | #ifdef __cplusplus
66 | extern "C" {
67 | #endif
68 |
69 | # ifdef OPENSSL_NO_RIPEMD
70 | # error RIPEMD is disabled.
71 | # endif
72 |
73 | # if defined(__LP32__)
74 | # define RIPEMD160_LONG unsigned long
75 | # elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
76 | # define RIPEMD160_LONG unsigned long
77 | # define RIPEMD160_LONG_LOG2 3
78 | # else
79 | # define RIPEMD160_LONG unsigned int
80 | # endif
81 |
82 | # define RIPEMD160_CBLOCK 64
83 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
84 | # define RIPEMD160_DIGEST_LENGTH 20
85 |
86 | typedef struct RIPEMD160state_st {
87 | RIPEMD160_LONG A, B, C, D, E;
88 | RIPEMD160_LONG Nl, Nh;
89 | RIPEMD160_LONG data[RIPEMD160_LBLOCK];
90 | unsigned int num;
91 | } RIPEMD160_CTX;
92 |
93 | # ifdef OPENSSL_FIPS
94 | int private_RIPEMD160_Init(RIPEMD160_CTX *c);
95 | # endif
96 | int RIPEMD160_Init(RIPEMD160_CTX *c);
97 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
98 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
99 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);
100 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
101 | #ifdef __cplusplus
102 | }
103 | #endif
104 |
105 | #endif
106 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/seed.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Neither the name of author nor the names of its contributors may
10 | * be used to endorse or promote products derived from this software
11 | * without specific prior written permission.
12 | *
13 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 | * SUCH DAMAGE.
24 | *
25 | */
26 | /* ====================================================================
27 | * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
28 | *
29 | * Redistribution and use in source and binary forms, with or without
30 | * modification, are permitted provided that the following conditions
31 | * are met:
32 | *
33 | * 1. Redistributions of source code must retain the above copyright
34 | * notice, this list of conditions and the following disclaimer.
35 | *
36 | * 2. Redistributions in binary form must reproduce the above copyright
37 | * notice, this list of conditions and the following disclaimer in
38 | * the documentation and/or other materials provided with the
39 | * distribution.
40 | *
41 | * 3. All advertising materials mentioning features or use of this
42 | * software must display the following acknowledgment:
43 | * "This product includes software developed by the OpenSSL Project
44 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
45 | *
46 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
47 | * endorse or promote products derived from this software without
48 | * prior written permission. For written permission, please contact
49 | * openssl-core@openssl.org.
50 | *
51 | * 5. Products derived from this software may not be called "OpenSSL"
52 | * nor may "OpenSSL" appear in their names without prior written
53 | * permission of the OpenSSL Project.
54 | *
55 | * 6. Redistributions of any form whatsoever must retain the following
56 | * acknowledgment:
57 | * "This product includes software developed by the OpenSSL Project
58 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
59 | *
60 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
61 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
62 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
63 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
64 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
65 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
66 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
67 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
68 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
69 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
70 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
71 | * OF THE POSSIBILITY OF SUCH DAMAGE.
72 | * ====================================================================
73 | *
74 | * This product includes cryptographic software written by Eric Young
75 | * (eay@cryptsoft.com). This product includes software written by Tim
76 | * Hudson (tjh@cryptsoft.com).
77 | *
78 | */
79 |
80 | #ifndef HEADER_SEED_H
81 | # define HEADER_SEED_H
82 |
83 | # include
84 | # include
85 | # include
86 |
87 | # ifdef OPENSSL_NO_SEED
88 | # error SEED is disabled.
89 | # endif
90 |
91 | /* look whether we need 'long' to get 32 bits */
92 | # ifdef AES_LONG
93 | # ifndef SEED_LONG
94 | # define SEED_LONG 1
95 | # endif
96 | # endif
97 |
98 | # if !defined(NO_SYS_TYPES_H)
99 | # include
100 | # endif
101 |
102 | # define SEED_BLOCK_SIZE 16
103 | # define SEED_KEY_LENGTH 16
104 |
105 |
106 | #ifdef __cplusplus
107 | extern "C" {
108 | #endif
109 |
110 | typedef struct seed_key_st {
111 | # ifdef SEED_LONG
112 | unsigned long data[32];
113 | # else
114 | unsigned int data[32];
115 | # endif
116 | } SEED_KEY_SCHEDULE;
117 |
118 | # ifdef OPENSSL_FIPS
119 | void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
120 | SEED_KEY_SCHEDULE *ks);
121 | # endif
122 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
123 | SEED_KEY_SCHEDULE *ks);
124 |
125 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
126 | unsigned char d[SEED_BLOCK_SIZE],
127 | const SEED_KEY_SCHEDULE *ks);
128 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
129 | unsigned char d[SEED_BLOCK_SIZE],
130 | const SEED_KEY_SCHEDULE *ks);
131 |
132 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,
133 | const SEED_KEY_SCHEDULE *ks, int enc);
134 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
135 | const SEED_KEY_SCHEDULE *ks,
136 | unsigned char ivec[SEED_BLOCK_SIZE], int enc);
137 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
138 | size_t len, const SEED_KEY_SCHEDULE *ks,
139 | unsigned char ivec[SEED_BLOCK_SIZE], int *num,
140 | int enc);
141 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
142 | size_t len, const SEED_KEY_SCHEDULE *ks,
143 | unsigned char ivec[SEED_BLOCK_SIZE], int *num);
144 |
145 | #ifdef __cplusplus
146 | }
147 | #endif
148 |
149 | #endif /* HEADER_SEED_H */
150 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/srp.h:
--------------------------------------------------------------------------------
1 | /* crypto/srp/srp.h */
2 | /*
3 | * Written by Christophe Renou (christophe.renou@edelweb.fr) with the
4 | * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the
5 | * EdelKey project and contributed to the OpenSSL project 2004.
6 | */
7 | /* ====================================================================
8 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved.
9 | *
10 | * Redistribution and use in source and binary forms, with or without
11 | * modification, are permitted provided that the following conditions
12 | * are met:
13 | *
14 | * 1. Redistributions of source code must retain the above copyright
15 | * notice, this list of conditions and the following disclaimer.
16 | *
17 | * 2. Redistributions in binary form must reproduce the above copyright
18 | * notice, this list of conditions and the following disclaimer in
19 | * the documentation and/or other materials provided with the
20 | * distribution.
21 | *
22 | * 3. All advertising materials mentioning features or use of this
23 | * software must display the following acknowledgment:
24 | * "This product includes software developed by the OpenSSL Project
25 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
26 | *
27 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
28 | * endorse or promote products derived from this software without
29 | * prior written permission. For written permission, please contact
30 | * licensing@OpenSSL.org.
31 | *
32 | * 5. Products derived from this software may not be called "OpenSSL"
33 | * nor may "OpenSSL" appear in their names without prior written
34 | * permission of the OpenSSL Project.
35 | *
36 | * 6. Redistributions of any form whatsoever must retain the following
37 | * acknowledgment:
38 | * "This product includes software developed by the OpenSSL Project
39 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
42 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
45 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52 | * OF THE POSSIBILITY OF SUCH DAMAGE.
53 | * ====================================================================
54 | *
55 | * This product includes cryptographic software written by Eric Young
56 | * (eay@cryptsoft.com). This product includes software written by Tim
57 | * Hudson (tjh@cryptsoft.com).
58 | *
59 | */
60 | #ifndef __SRP_H__
61 | # define __SRP_H__
62 |
63 | # ifndef OPENSSL_NO_SRP
64 |
65 | # include
66 | # include
67 |
68 | #ifdef __cplusplus
69 | extern "C" {
70 | #endif
71 |
72 | # include
73 | # include
74 | # include
75 |
76 | typedef struct SRP_gN_cache_st {
77 | char *b64_bn;
78 | BIGNUM *bn;
79 | } SRP_gN_cache;
80 |
81 |
82 | DECLARE_STACK_OF(SRP_gN_cache)
83 |
84 | typedef struct SRP_user_pwd_st {
85 | /* Owned by us. */
86 | char *id;
87 | BIGNUM *s;
88 | BIGNUM *v;
89 | /* Not owned by us. */
90 | const BIGNUM *g;
91 | const BIGNUM *N;
92 | /* Owned by us. */
93 | char *info;
94 | } SRP_user_pwd;
95 |
96 | DECLARE_STACK_OF(SRP_user_pwd)
97 |
98 | void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
99 |
100 | typedef struct SRP_VBASE_st {
101 | STACK_OF(SRP_user_pwd) *users_pwd;
102 | STACK_OF(SRP_gN_cache) *gN_cache;
103 | /* to simulate a user */
104 | char *seed_key;
105 | BIGNUM *default_g;
106 | BIGNUM *default_N;
107 | } SRP_VBASE;
108 |
109 | /*
110 | * Structure interne pour retenir les couples N et g
111 | */
112 | typedef struct SRP_gN_st {
113 | char *id;
114 | BIGNUM *g;
115 | BIGNUM *N;
116 | } SRP_gN;
117 |
118 | DECLARE_STACK_OF(SRP_gN)
119 |
120 | SRP_VBASE *SRP_VBASE_new(char *seed_key);
121 | int SRP_VBASE_free(SRP_VBASE *vb);
122 | int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
123 |
124 | /* This method ignores the configured seed and fails for an unknown user. */
125 | SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
126 | /* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
127 | SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
128 |
129 | char *SRP_create_verifier(const char *user, const char *pass, char **salt,
130 | char **verifier, const char *N, const char *g);
131 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
132 | BIGNUM **verifier, BIGNUM *N, BIGNUM *g);
133 |
134 | # define SRP_NO_ERROR 0
135 | # define SRP_ERR_VBASE_INCOMPLETE_FILE 1
136 | # define SRP_ERR_VBASE_BN_LIB 2
137 | # define SRP_ERR_OPEN_FILE 3
138 | # define SRP_ERR_MEMORY 4
139 |
140 | # define DB_srptype 0
141 | # define DB_srpverifier 1
142 | # define DB_srpsalt 2
143 | # define DB_srpid 3
144 | # define DB_srpgN 4
145 | # define DB_srpinfo 5
146 | # undef DB_NUMBER
147 | # define DB_NUMBER 6
148 |
149 | # define DB_SRP_INDEX 'I'
150 | # define DB_SRP_VALID 'V'
151 | # define DB_SRP_REVOKED 'R'
152 | # define DB_SRP_MODIF 'v'
153 |
154 | /* see srp.c */
155 | char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N);
156 | SRP_gN *SRP_get_default_gN(const char *id);
157 |
158 | /* server side .... */
159 | BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
160 | BIGNUM *N);
161 | BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v);
162 | int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N);
163 | BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N);
164 |
165 | /* client side .... */
166 | BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass);
167 | BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g);
168 | BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
169 | BIGNUM *a, BIGNUM *u);
170 | int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);
171 |
172 | # define SRP_MINIMAL_N 1024
173 |
174 | #ifdef __cplusplus
175 | }
176 | #endif
177 |
178 | # endif
179 | #endif
180 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/ssl23.h:
--------------------------------------------------------------------------------
1 | /* ssl/ssl23.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_SSL23_H
60 | # define HEADER_SSL23_H
61 |
62 | #ifdef __cplusplus
63 | extern "C" {
64 | #endif
65 |
66 | /*
67 | * client
68 | */
69 | /* write to server */
70 | # define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT)
71 | # define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT)
72 | /* read from server */
73 | # define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT)
74 | # define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT)
75 |
76 | /* server */
77 | /* read from client */
78 | # define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT)
79 | # define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT)
80 |
81 | #ifdef __cplusplus
82 | }
83 | #endif
84 | #endif
85 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/stack.h:
--------------------------------------------------------------------------------
1 | /* crypto/stack/stack.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_STACK_H
60 | # define HEADER_STACK_H
61 |
62 | #ifdef __cplusplus
63 | extern "C" {
64 | #endif
65 |
66 | typedef struct stack_st {
67 | int num;
68 | char **data;
69 | int sorted;
70 | int num_alloc;
71 | int (*comp) (const void *, const void *);
72 | } _STACK; /* Use STACK_OF(...) instead */
73 |
74 | # define M_sk_num(sk) ((sk) ? (sk)->num:-1)
75 | # define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL)
76 |
77 | int sk_num(const _STACK *);
78 | void *sk_value(const _STACK *, int);
79 |
80 | void *sk_set(_STACK *, int, void *);
81 |
82 | _STACK *sk_new(int (*cmp) (const void *, const void *));
83 | _STACK *sk_new_null(void);
84 | void sk_free(_STACK *);
85 | void sk_pop_free(_STACK *st, void (*func) (void *));
86 | _STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *));
87 | int sk_insert(_STACK *sk, void *data, int where);
88 | void *sk_delete(_STACK *st, int loc);
89 | void *sk_delete_ptr(_STACK *st, void *p);
90 | int sk_find(_STACK *st, void *data);
91 | int sk_find_ex(_STACK *st, void *data);
92 | int sk_push(_STACK *st, void *data);
93 | int sk_unshift(_STACK *st, void *data);
94 | void *sk_shift(_STACK *st);
95 | void *sk_pop(_STACK *st);
96 | void sk_zero(_STACK *st);
97 | int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))
98 | (const void *, const void *);
99 | _STACK *sk_dup(_STACK *st);
100 | void sk_sort(_STACK *st);
101 | int sk_is_sorted(const _STACK *st);
102 |
103 | #ifdef __cplusplus
104 | }
105 | #endif
106 |
107 | #endif
108 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/txt_db.h:
--------------------------------------------------------------------------------
1 | /* crypto/txt_db/txt_db.h */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #ifndef HEADER_TXT_DB_H
60 | # define HEADER_TXT_DB_H
61 |
62 | # include
63 | # ifndef OPENSSL_NO_BIO
64 | # include
65 | # endif
66 | # include
67 | # include
68 |
69 | # define DB_ERROR_OK 0
70 | # define DB_ERROR_MALLOC 1
71 | # define DB_ERROR_INDEX_CLASH 2
72 | # define DB_ERROR_INDEX_OUT_OF_RANGE 3
73 | # define DB_ERROR_NO_INDEX 4
74 | # define DB_ERROR_INSERT_INDEX_CLASH 5
75 |
76 | #ifdef __cplusplus
77 | extern "C" {
78 | #endif
79 |
80 | typedef OPENSSL_STRING *OPENSSL_PSTRING;
81 | DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
82 |
83 | typedef struct txt_db_st {
84 | int num_fields;
85 | STACK_OF(OPENSSL_PSTRING) *data;
86 | LHASH_OF(OPENSSL_STRING) **index;
87 | int (**qual) (OPENSSL_STRING *);
88 | long error;
89 | long arg1;
90 | long arg2;
91 | OPENSSL_STRING *arg_row;
92 | } TXT_DB;
93 |
94 | # ifndef OPENSSL_NO_BIO
95 | TXT_DB *TXT_DB_read(BIO *in, int num);
96 | long TXT_DB_write(BIO *out, TXT_DB *db);
97 | # else
98 | TXT_DB *TXT_DB_read(char *in, int num);
99 | long TXT_DB_write(char *out, TXT_DB *db);
100 | # endif
101 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
102 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp);
103 | void TXT_DB_free(TXT_DB *db);
104 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,
105 | OPENSSL_STRING *value);
106 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);
107 |
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 |
112 | #endif
113 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/ui_compat.h:
--------------------------------------------------------------------------------
1 | /* crypto/ui/ui.h */
2 | /*
3 | * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
4 | * 2001.
5 | */
6 | /* ====================================================================
7 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * 1. Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above copyright
17 | * notice, this list of conditions and the following disclaimer in
18 | * the documentation and/or other materials provided with the
19 | * distribution.
20 | *
21 | * 3. All advertising materials mentioning features or use of this
22 | * software must display the following acknowledgment:
23 | * "This product includes software developed by the OpenSSL Project
24 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25 | *
26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 | * endorse or promote products derived from this software without
28 | * prior written permission. For written permission, please contact
29 | * openssl-core@openssl.org.
30 | *
31 | * 5. Products derived from this software may not be called "OpenSSL"
32 | * nor may "OpenSSL" appear in their names without prior written
33 | * permission of the OpenSSL Project.
34 | *
35 | * 6. Redistributions of any form whatsoever must retain the following
36 | * acknowledgment:
37 | * "This product includes software developed by the OpenSSL Project
38 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39 | *
40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 | * OF THE POSSIBILITY OF SUCH DAMAGE.
52 | * ====================================================================
53 | *
54 | * This product includes cryptographic software written by Eric Young
55 | * (eay@cryptsoft.com). This product includes software written by Tim
56 | * Hudson (tjh@cryptsoft.com).
57 | *
58 | */
59 |
60 | #ifndef HEADER_UI_COMPAT_H
61 | # define HEADER_UI_COMPAT_H
62 |
63 | # include
64 | # include
65 |
66 | #ifdef __cplusplus
67 | extern "C" {
68 | #endif
69 |
70 | /*
71 | * The following functions were previously part of the DES section, and are
72 | * provided here for backward compatibility reasons.
73 | */
74 |
75 | # define des_read_pw_string(b,l,p,v) \
76 | _ossl_old_des_read_pw_string((b),(l),(p),(v))
77 | # define des_read_pw(b,bf,s,p,v) \
78 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v))
79 |
80 | int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt,
81 | int verify);
82 | int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt,
83 | int verify);
84 |
85 | #ifdef __cplusplus
86 | }
87 | #endif
88 | #endif
89 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/include/openssl/whrlpool.h:
--------------------------------------------------------------------------------
1 | #ifndef HEADER_WHRLPOOL_H
2 | # define HEADER_WHRLPOOL_H
3 |
4 | # include
5 | # include
6 |
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 |
11 | # define WHIRLPOOL_DIGEST_LENGTH (512/8)
12 | # define WHIRLPOOL_BBLOCK 512
13 | # define WHIRLPOOL_COUNTER (256/8)
14 |
15 | typedef struct {
16 | union {
17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
18 | /* double q is here to ensure 64-bit alignment */
19 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
20 | } H;
21 | unsigned char data[WHIRLPOOL_BBLOCK / 8];
22 | unsigned int bitoff;
23 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
24 | } WHIRLPOOL_CTX;
25 |
26 | # ifndef OPENSSL_NO_WHIRLPOOL
27 | # ifdef OPENSSL_FIPS
28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
29 | # endif
30 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
31 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
33 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
34 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
35 | # endif
36 |
37 | #ifdef __cplusplus
38 | }
39 | #endif
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/lib/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openairplay/ap2-sender/6637411cc2c3f09d59369339e7a494a37ac13c23/ap2-sender/ThirdParty/prebuilt/lib/.DS_Store
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/lib/libcrypto.1.0.0.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openairplay/ap2-sender/6637411cc2c3f09d59369339e7a494a37ac13c23/ap2-sender/ThirdParty/prebuilt/lib/libcrypto.1.0.0.dylib
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/prebuilt/lib/libssl.1.0.0.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openairplay/ap2-sender/6637411cc2c3f09d59369339e7a494a37ac13c23/ap2-sender/ThirdParty/prebuilt/lib/libssl.1.0.0.dylib
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/rfc6234/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for rfc6234 code examples
2 |
3 | BINS += shatest
4 | DEPS = Makefile
5 |
6 | # Prettifiers
7 | LINK = @echo "* Linking $@"; $(CC) $(CFLAGS) $(LDFLAGS)
8 |
9 | all: ${BINS}
10 | @echo "* All Done"
11 |
12 | OBJS := $(shell ls *.c | sed 's/\.c/.o/' | sed 's/ /\n/g' | sort | uniq | tr '\n' ' ')
13 |
14 | -include $(OBJS:.o=.d)
15 |
16 | depend: clean
17 | @echo "* Making dependencies for $(OBJS)"
18 | @$(MAKE) -s $(OBJS)
19 | @echo "* Making dependencies - done"
20 |
21 | clean:
22 | @echo "* Cleansing"
23 | @rm -rf $(BINS) *.o *.so *.lo *.la *.slo *.loT *.d
24 |
25 | shatest: $(DEPS) $(OBJS)
26 | $(LINK) -o $@ $(OBJS)
27 |
28 | %.o: %.c $(DEPS)
29 | @echo "* Compiling $@";
30 | @$(CC) -c $(CFLAGS) $*.c -o $*.o
31 | @$(CC) -MM $(CFLAGS) $*.c > $*.d
32 | @cp -f $*.d $*.d.tmp
33 | @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
34 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
35 | @rm -f $*.d.tmp
36 |
37 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/rfc6234/README.md:
--------------------------------------------------------------------------------
1 | rfc6234 RFC6234 US Secure Hash Algorithms - Example Code Extract
2 | ================================================================
3 |
4 | These are the code examples given in the IETF RFC6234:
5 | http://tools.ietf.org/html/rfc6234
6 |
7 |
--------------------------------------------------------------------------------
/ap2-sender/ThirdParty/rfc6234/sha-private.h:
--------------------------------------------------------------------------------
1 | /************************ sha-private.h ************************/
2 | /***************** See RFC 6234 for details. *******************/
3 | #ifndef _SHA_PRIVATE__H
4 | #define _SHA_PRIVATE__H
5 | /*
6 | * These definitions are defined in FIPS 180-3, section 4.1.
7 | * Ch() and Maj() are defined identically in sections 4.1.1,
8 | * 4.1.2, and 4.1.3.
9 | *
10 | * The definitions used in FIPS 180-3 are as follows:
11 | */
12 |
13 | #ifndef USE_MODIFIED_MACROS
14 | #define SHA_Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
15 | #define SHA_Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
16 | #else /* USE_MODIFIED_MACROS */
17 | /*
18 | * The following definitions are equivalent and potentially faster.
19 | */
20 |
21 | #define SHA_Ch(x, y, z) (((x) & ((y) ^ (z))) ^ (z))
22 | #define SHA_Maj(x, y, z) (((x) & ((y) | (z))) | ((y) & (z)))
23 |
24 | #endif /* USE_MODIFIED_MACROS */
25 |
26 | #define SHA_Parity(x, y, z) ((x) ^ (y) ^ (z))
27 |
28 | #endif /* _SHA_PRIVATE__H */
29 |
30 |
--------------------------------------------------------------------------------
/ap2-sender/ap2_sender.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ap2-sender/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ap2-sender
4 | //
5 | // Created by Viktoriia on 14.08.2020.
6 | // Copyright © 2020 Viktoriia. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | @autoreleasepool {
13 | // Setup code that might create autoreleased objects goes here.
14 | }
15 | return NSApplicationMain(argc, argv);
16 | }
17 |
--------------------------------------------------------------------------------