mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 02:11:38 +03:00
use urcrypt instead of openssl for bash calculation
This commit is contained in:
parent
9bd589f6df
commit
6f7b5acd20
@ -2,12 +2,7 @@
|
|||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#include "all.h"
|
#include "all.h"
|
||||||
|
#include <urcrypt.h>
|
||||||
#if defined(U3_OS_osx)
|
|
||||||
#include <CommonCrypto/CommonDigest.h>
|
|
||||||
#else
|
|
||||||
#include <openssl/sha.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Data structures.
|
/** Data structures.
|
||||||
**/
|
**/
|
||||||
@ -133,19 +128,7 @@ _cj_bash(u3_noun bat)
|
|||||||
}
|
}
|
||||||
// assume little-endian
|
// assume little-endian
|
||||||
fat_y = (c3_y*) wor_w;
|
fat_y = (c3_y*) wor_w;
|
||||||
#if defined(U3_OS_osx)
|
urcrypt_sha256(fat_y, met_w, dig_y);
|
||||||
CC_SHA256_CTX ctx_h;
|
|
||||||
|
|
||||||
CC_SHA256_Init(&ctx_h);
|
|
||||||
CC_SHA256_Update(&ctx_h, fat_y, met_w);
|
|
||||||
CC_SHA256_Final(dig_y, &ctx_h);
|
|
||||||
#else
|
|
||||||
SHA256_CTX ctx_h;
|
|
||||||
|
|
||||||
SHA256_Init(&ctx_h);
|
|
||||||
SHA256_Update(&ctx_h, fat_y, met_w);
|
|
||||||
SHA256_Final(dig_y, &ctx_h);
|
|
||||||
#endif
|
|
||||||
pro = u3i_bytes(32, dig_y);
|
pro = u3i_bytes(32, dig_y);
|
||||||
u3h_put(u3R->jed.bas_p, bat, u3k(pro));
|
u3h_put(u3R->jed.bas_p, bat, u3k(pro));
|
||||||
u3a_wfree(wor_w);
|
u3a_wfree(wor_w);
|
||||||
|
Loading…
Reference in New Issue
Block a user