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 
83 int
84 ndn_verifyDigestSha256Signature
85  (const uint8_t *signature, size_t signatureLength, const uint8_t *data,
86  size_t dataLength);
87 
92 size_t
93 ndn_getEcKeyInfoCount();
94 
101 const struct ndn_EcKeyInfo *
102 ndn_getEcKeyInfo(int i);
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: crypto.h:34