Options is a list of:
- algorithm(+A)
- where A is one of ripemd160, sha256, sha384, sha512,
- sha512_256, sha3_224, sha3_256, sha3_384, sha3_512, or a
- variable. If A is a variable, then it is unified with the
+ where A is one of ripemd160, sha256, sha384, sha512, sha512_256,
+ sha3_224, sha3_256, sha3_384, sha3_512, blake2s256, blake2b512,
+ or a variable. If A is a variable, then it is unified with the
default algorithm, which is an algorithm that is considered
cryptographically secure at the time of this writing.
- encoding(+Encoding)
hash_algorithm(sha3_256).
hash_algorithm(sha3_384).
hash_algorithm(sha3_512).
+hash_algorithm(blake2s256).
+hash_algorithm(blake2b512).
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use ring::{digest,hkdf,pbkdf2,aead,error};
use ripemd160::{Ripemd160, Digest};
use sha3::{Sha3_224, Sha3_256, Sha3_384, Sha3_512};
+use blake2::{Blake2s, Blake2b};
pub fn get_key() -> KeyEvent {
let key;
let mut context = Sha3_512::new();
context.input(&bytes);
Addr::HeapCell(self.heap.to_list(context.result().as_ref().iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b))))))
+ } else if algorithm_str == "blake2s256" {
+ let mut context = Blake2s::new();
+ context.input(&bytes);
+ Addr::HeapCell(self.heap.to_list(context.result().as_ref().iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b))))))
+ } else if algorithm_str == "blake2b512" {
+ let mut context = Blake2b::new();
+ context.input(&bytes);
+ Addr::HeapCell(self.heap.to_list(context.result().as_ref().iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b))))))
} else if algorithm_str == "ripemd160" {
let mut context = Ripemd160::new();
context.input(&bytes);