fn crypto_sign_direct(sm: &mut Vec<u32>, m: &Vec<u32>, n: usize, sk: &Vec<u32>) -> usize {
  let mut h: Vec<u32> = vec![0; 64];
  let mut r: Vec<u32> = vec![0; 64];
  let mut x: Vec<i32> = vec![0; 64];
  let mut p: Vec<Vec<i64>> = ([gf(), gf(), gf(), gf()]).to_vec();

  for i in (0..n) {
	sm[64 + i] = m[i];
  }
  
  for i in (0..32) {
	sm[32 + i] = sk[i];
  }

  let mut x32: Vec<u32> = (&sm[32..]).to_vec();

  crypto_hash(&mut r, &x32, n+32); 
	
  reduce(&mut r);
  
  scalarbase(&mut p, &r);
	
  pack(sm, &p);
	
  for i in (0..32) {
	sm[i + 32] = sk[32 + i];
  }
  
  crypto_hash(&mut h, &sm, n + 64);
  reduce(&mut h);

  for i in (0..64) {
	x[i] = 0;
  }
  
  for i in (0..32) {
	x[i] = r[i] as i32;
  }
  
  for i in (0..32) {
	for j in (0..32) {
	  x[i+j] += (h[i] * sk[j]) as i32;
	}
  }
  
  let mut tmp: Vec<u32> = (&sm[32..]).to_vec();
  modL(&mut tmp, &mut x); 
  for i in (0..tmp.len() ) {
	sm[32+i] = tmp[i];
  }  
	
  return n + 64;
  
}
// Like crypto_sign, but uses secret key directly in hash.
Like crypto_sign, but uses secret key directly in hash.
Like crypto_sign but uses secret key directly in hash .
fn crypto_sign_direct(sm: &mut Vec<u32>, m: &Vec<u32>, n: usize, sk: &Vec<u32>) -> usize {
  let mut h: Vec<u32> = vec![0; 64];
  let mut r: Vec<u32> = vec![0; 64];
  let mut x: Vec<i32> = vec![0; 64];
  let mut p: Vec<Vec<i64>> = ([gf(), gf(), gf(), gf()]).to_vec();
  for i in (0..n) {
	sm[64 + i] = m[i];
  }
  for i in (0..32) {
	sm[32 + i] = sk[i];
  }
  let mut x32: Vec<u32> = (&sm[32..]).to_vec();
  crypto_hash(&mut r, &x32, n+32); 
  reduce(&mut r);
  scalarbase(&mut p, &r);
  pack(sm, &p);
  for i in (0..32) {
	sm[i + 32] = sk[32 + i];
  }
  crypto_hash(&mut h, &sm, n + 64);
  reduce(&mut h);
  for i in (0..64) {
	x[i] = 0;
  }
  for i in (0..32) {
	x[i] = r[i] as i32;
  }
  for i in (0..32) {
	for j in (0..32) {
	  x[i+j] += (h[i] * sk[j]) as i32;
	}
  }
  let mut tmp: Vec<u32> = (&sm[32..]).to_vec();
  modL(&mut tmp, &mut x); 
  for i in (0..tmp.len() ) {
	sm[32+i] = tmp[i];
  }  
  return n + 64;
}
fn crypto_sign_direct ( sm : & mut Vec < u32 > , m : & Vec < u32 > , n : usize , sk : & Vec < u32 > ) -> usize { let mut h : Vec < u32 > = vec ! [ 0 64 ] ; let mut r : Vec < u32 > = vec ! [ 0 64 ] ; let mut x : Vec < i32 > = vec ! [ 0 64 ] ; let mut p : Vec < Vec < i64 > > = ( [ gf ( ) , gf ( ) , gf ( ) , gf ( ) ] ) . to_vec ( ) ; for i in ( 0 .. n ) { sm [ 64 + i ] = m [ i ] ; } for i in ( 0 .. 32 ) { sm [ 32 + i ] = sk [ i ] ; } let mut x32 : Vec < u32 > = ( & sm [ 32 .. ] ) . to_vec ( ) ; crypto_hash ( & mut r , & x32 , n + 32 ) ; reduce ( & mut r ) ; scalarbase ( & mut p , & r ) ; pack ( sm , & p ) ; for i in ( 0 .. 32 ) { sm [ i + 32 ] = sk [ 32 + i ] ; } crypto_hash ( & mut h , & sm , n + 64 ) ; reduce ( & mut h ) ; for i in ( 0 .. 64 ) { x [ i ] = 0 ; } for i in ( 0 .. 32 ) { x [ i ] = r [ i ] as i32 ; } for i in ( 0 .. 32 ) { for j in ( 0 .. 32 ) { x [ i + j ] += ( h [ i ] * sk [ j ] ) as i32 ; } } let mut tmp : Vec < u32 > = ( & sm [ 32 .. ] ) . to_vec ( ) ; modL ( & mut tmp , & mut x ) ; for i in ( 0 .. tmp . len ( ) ) { sm [ 32 + i ] = tmp [ i ] ; } return n + 64 ; }
Like crypto_sign, but uses secret key directly in hash.
Like crypto_sign but uses secret key directly in hash .
sm
&mut Vec<u32>
m
&Vec<u32>
n
usize
sk
&Vec<u32>
sm
&mut Vec<u32>
m
&Vec<u32>
n
usize
sk
&Vec<u32>