All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
crypto.h
1 
21 #ifndef NDN_CRYPTO_H
22 #define NDN_CRYPTO_H
23 
24 #include <ndn-cpp/c/common.h>
25 #include <ndn-cpp/c/errors.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 struct ndn_EcKeyInfo {
35  int keySize;
36  int curveId;
37  int *oidIntegerList;
38  size_t oidIntegerListLength;
39 };
40 
48 void ndn_digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest);
49 
57 ndn_Error
58 ndn_generateRandomBytes(uint8_t *buffer, size_t bufferLength);
59 
70 void
71 ndn_computeHmacWithSha256
72  (const uint8_t *key, size_t keyLength, const uint8_t *data, size_t dataLength,
73  uint8_t *digest);
74 
88 int
89 ndn_verifyHmacWithSha256Signature
90  (const uint8_t *key, size_t keyLength, const uint8_t *signature,
91  size_t signatureLength, const uint8_t *data, size_t dataLength);
92 
101 int
102 ndn_verifyDigestSha256Signature
103  (const uint8_t *signature, size_t signatureLength, const uint8_t *data,
104  size_t dataLength);
105 
110 size_t
111 ndn_getEcKeyInfoCount();
112 
119 const struct ndn_EcKeyInfo *
120 ndn_getEcKeyInfo(int i);
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif
Copyright (C) 2013-2018 Regents of the University of California.
Definition: crypto.h:34