turned crypto_secretbox nonces into counters, thereby implementing counter mode (CTR mode). we use variable size counters, max counter size is 184 bit, max implemented currently are 64 bit, multiply by 32kb and you get the maximum file size supported by pcp encryption

This commit is contained in:
TLINDEN
2015-01-16 00:13:02 +01:00
parent 3c30d8871b
commit 2e7479525f
4 changed files with 163 additions and 6 deletions

View File

@@ -333,6 +333,11 @@ int pcp_sodium_verify_mac(byte **cleartext,
pcp_rec_t *pcp_rec_new(byte *cipher, size_t clen, pcp_key_t *secret, pcp_pubkey_t *pub);
void pcp_rec_free(pcp_rec_t *r);
/* CTR mode helpers */
byte *_gen_ctr_nonce(uint64_t ctr);
uint64_t _get_nonce_ctr(byte *nonce);
#endif /* _HAVE_PCP_CRYPTO_H */
/**@}*/

View File

@@ -377,8 +377,4 @@ struct _pcp_ks_bundle_t {
};
typedef struct _pcp_ks_bundle_t pcp_ks_bundle_t;
#endif //_HAVE_PCP_STRUCTS_H