tunnelkit/TunnelKit/Sources/Core/CryptoMacros.h

21 lines
486 B
C
Raw Normal View History

2018-08-23 08:19:25 +00:00
//
// CryptoMacros.h
// TunnelKit
2018-08-23 08:19:25 +00:00
//
// Created by Davide De Rosa on 06/07/2018.
// Copyright © 2018 London Trust Media. All rights reserved.
//
#import <Foundation/Foundation.h>
#define TUNNEL_CRYPTO_SUCCESS(ret) (ret > 0)
#define TUNNEL_CRYPTO_TRACK_STATUS(ret) if (ret > 0) ret =
#define TUNNEL_CRYPTO_RETURN_STATUS(ret)\
2018-08-23 08:19:25 +00:00
if (ret <= 0) {\
if (error) {\
*error = TunnelKitErrorWithCode(TunnelKitErrorCodeCryptoBoxEncryption);\
2018-08-23 08:19:25 +00:00
}\
return NO;\
}\
return YES;